-
Notifications
You must be signed in to change notification settings - Fork 6
Debugging tips
Jacob deGroot-Maggetti edited this page Mar 24, 2023
·
1 revision
This page is for noting bugs that have been encountered in the past, and recording techniques that have worked to debug these issues.
- "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
andDockerfile
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 changeCMD ["python", "manage.py", "runserver", "8888"]
toCMD ["python", "manage.py", "runserver", "0.0.0.0:8888"]
. (Upon making this change, we also needed to add localhost to theALLOWED_HOSTS
insettings.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. Runningcurl
inside the container resulted in a bunch of HTML being printed to the terminal, while running it outside led to acurl: (52) Empty reply from server
error. Googling this error message was enough to orient us in the right direction.
- To solve the error, in