Troubleshooting - f0cker/crackq Wiki

Troubleshooting

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 was 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.

Debugging

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 -it crackq /bin/sed -i 's/INFO/DEBUG/g' /opt/crackq/build/crackq/log_config.ini

Beware this is very verbose.

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).