-
-
Notifications
You must be signed in to change notification settings - Fork 101
Troubleshooting
If you have any issues and need to debug from within one of the containers, the container names are:
nginx, crackq, redis, ldap.crackq.org,
You can drop to a shell within the container using:
sudo docker exec -it crackq /bin/bash
To enable debugging use the following command:
sudo docker exec --user root -it crackq /bin/sed -i 's/INFO/DEBUG/g' /opt/crackq/build/crackq/log_config.ini
Beware this is very verbose.
If the container won't start, check hashcat and the relevant drivers are installed correctly by running hashcat from within the crackq container
sudo docker run -it nvidia-ubuntu nvidia-smi
sudo docker run -it nvidia-ubuntu clinfo
sudo docker run -it nvidia-ubuntu pyhashcat/hashcat/hashcat -b -m 1000
Your first step (after enabling debugging) if everything is up and running, but your jobs are not running correctly, should be to disable the brain functionality. This area of the application adds a lot of complexity and can cause the error messages to be hidden from the debug output. The best way to completely disable the brain is via the config (as of version 0.1.3) by adding the following entry under [misc]:
disable_brain: True
If your Crackq version is older than 0.1.3 this can only be done per job, by ticking the 'Disable brain' option.
If you see the following error:
ERROR: for crackq Cannot start service crackq: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:432: running prestart hook 1 caused \\\"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: nvml error: driver not loaded\\\\n\\\"\"": unknown
ERROR: Encountered errors while bringing up the project.
This is usually fixed by updating the Nvidia drivers, some drivers are not compatible with certain docker-compose versions.
ERROR: The Compose file './docker-compose.nvidia.yml' is invalid because:
Unsupported config option for services.crackq: 'runtime'
This is likely due to the version of docker installed, you might have skipped step 1 and installed from the OS repo.
ERROR: for crackq Cannot create container for service crackq: Unknown runtime specified nvidia
First of all check you have installed the NVidia container toolkit and runtime: https://github.com/NVIDIA/nvidia-docker
If the error persists, there is an open issue with the latest Docker/Docker-compose version where docker-compose does not recognise the Nvidia runtime. Apply the workaround noted here. Which is just adding the following to your /etc/docker/daemon.json file:
{
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}
}
crackq | FileNotFoundError: [Errno 2] No such file or directory: '/var/crackq/files/hashm_dict.json'
This is because you haven't run the benchmark script (see above), the benchmark creates a file listing all supported hashtypes and their benchmark speed into a file, which is needed by CrackQ. In a pinch you can ask it to copy the default benchmark file, but this is obviously not a good choice as all the brain callibration will be off.
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError)
If you see SQL related error it's most likely due to an outdated SQL schema, I've made changes to the user model a couple of times since release. To resolve this, just delete the sqlite DB at /var/crackq/files/crackqdb/sqlite and a new one will be created automatically when you restart the container. I will be adding DB migration in a future update which will handle any schema changes automagically.
If you are performing dev work you will likely want to change the Circus process manager setup so that you are able to view all errors from Flask directly. CrackQ uses Circus this to manage the 4 processes that run as part of the application. Namely the Flask app, 2 workers that handle running the jobs from the Redis queue and the Hashcat brain server/service. The Flask application uses Gunicorn as a WSGI interface, this is not great to use when debugging as it doesn't print errors to stdout very well. So the dev docker-compose file (docker-compose.dev.yml) is setup to run the Flask app with the debug WSGI Werkzeug, by using the dev version of the Circus ini file. You can modify the relevant line in the docker-compose file to switch back to the production config (see the commented line).