Debugging tips - DDMAL/CantusDB GitHub Wiki

This page is for noting bugs that have been encountered in the past, and recording techniques that have worked to debug these issues.

Dockerfile and docker-compose.yml

  • "Safari can't open the page "127.0.0.1:8888" because the server unexpectedly dropped the connection": (This error message has not been encountered in CantusDB directly, but rather it occurred while setting up a sandbox version of CantusDB meant to test techniques for improving/optimizing queries on certain pages. We had created a simple django app filled with fake chants/offices/sources/sequences etc., and took the docker-compose.yml and Dockerfile files from CantusDB. When we started the app and tried to interact with it in the browser, we saw this error message.)
    • To solve the error, in Dockerfile, we needed to change CMD ["python", "manage.py", "runserver", "8888"] to CMD ["python", "manage.py", "runserver", "0.0.0.0:8888"]. (Upon making this change, we also needed to add localhost to the ALLOWED_HOSTS in settings.py)
    • In similar situations, a debugging technique worth trying is to run curl http://localhost:8888/ (adjust IP address and port as necessary) both inside the Django container and outside of it, and compare the results. Running curl inside the container resulted in a bunch of HTML being printed to the terminal, while running it outside led to a curl: (52) Empty reply from server error. Googling this error message was enough to orient us in the right direction.