Forums

Error when loading site

Something went wrong :-( This website is hosted by PythonAnywhere, an online hosting environment. Something went wrong while trying to load it; please try again later.

Debugging tips
If this is your PythonAnywhere-hosted site, and you just reloaded it, then the problem might simply be that it hasn't loaded up yet. Try refreshing this page and see if this message disappears.

If you keep getting this message, you should check your site's server and error logs for any messages — you can view them from the Web tab inside PythonAnywhere.

If there's nothing in the logs, and you're sure your site is OK, then it might be a problem on our side. Drop us a line at support@pythonanywhere.com, in the forums, or using the "Send feedback" link on the site, quoting the error code below.

Error code: 502-backend

This error is given everytime I tried to load my www.invictaevironmental.com webapp. It was working fine up until recently. I have made no changes and there are no error messages in the server or error logs. Please help

Hi, 502 means that your web app crashed -- I see that in your web app configuration you've set up a virtual environment path which apparently does not lead to a venv. That could cause a crash like that -- could you check that?

It was working before without the virtual environment path setup. Either way I have now set it up correctly and still running into the same issue.

What are the most recent entries in your logs? (on the bottom of the log files)

Server Logs:

2021-03-05 18:54:50 spawned uWSGI worker 2 (pid: 6, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 2
2021-03-05 18:54:50 spawned uWSGI worker 3 (pid: 9, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 3
2021-03-05 18:54:50 spawned uWSGI worker 4 (pid: 12, cores: 1)
2021-03-05 18:54:50 spawned uWSGI worker 5 (pid: 13, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 4
2021-03-05 18:54:50 spawned uWSGI worker 6 (pid: 16, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 5
2021-03-05 18:54:50 spawned uWSGI worker 7 (pid: 19, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 6
2021-03-05 18:54:50 spawned uWSGI worker 8 (pid: 22, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 7
2021-03-05 18:54:50 spawned uWSGI worker 9 (pid: 25, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 8
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 9
2021-03-05 18:54:50 spawned uWSGI worker 10 (pid: 30, cores: 1)
2021-03-05 18:54:50 spawned uWSGI worker 11 (pid: 31, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 10
2021-03-05 18:54:50 spawned uWSGI worker 12 (pid: 34, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 11
2021-03-05 18:54:50 spawned uWSGI worker 13 (pid: 37, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 12
2021-03-05 18:54:50 spawned uWSGI worker 14 (pid: 40, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 13
2021-03-05 18:54:50 spawned uWSGI worker 15 (pid: 43, cores: 1)
2021-03-05 18:54:50 spawned uWSGI worker 16 (pid: 44, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 14
2021-03-05 18:54:50 spawned uWSGI worker 17 (pid: 47, cores: 1)
2021-03-05 18:54:50 spawned 2 offload threads for uWSGI worker 15
2021-03-05 18:54:50 spawned uWSGI worker 18 (pid: 50, cores: 1)
2021-03-05 18:54:50 pthread_create(): Resource temporarily unavailable [core/utils.c line 3853]
2021-03-05 18:54:50 unable to start offload thread 0 for worker 16 !!!
2021-03-05 18:54:50 spawned 0 offload threads for uWSGI worker 16
2021-03-05 18:54:50 pthread_create(): Resource temporarily unavailable [core/utils.c line 3853]
2021-03-05 18:54:50 unable to start offload thread 0 for worker 18 !!!
2021-03-05 18:54:50 spawned 0 offload threads for uWSGI worker 18
2021-03-05 18:54:50 spawned uWSGI worker 19 (pid: 51, cores: 1)
2021-03-05 18:54:50 fork(): Resource temporarily unavailable [core/master_utils.c line 740]
2021-03-05 18:54:50 metrics collector thread started
2021-03-05 18:54:50 pthread_create(): Resource temporarily unavailable [core/utils.c line 3853]
2021-03-05 18:54:50 !!! unable to spawn stats pusher thread !!!
2021-03-05 18:54:50 VACUUM: unix socket /var/sockets/www.invictaenvironmental.com/socket removed.
2021-03-05 18:54:50 pthread_create(): Resource temporarily unavailable [core/utils.c line 3853]
2021-03-05 18:54:50 unable to start offload thread 0 for worker 17 !!!
2021-03-05 18:54:50 spawned 0 offload threads for uWSGI worker 17
2021-03-05 18:54:50 pthread_create(): Resource temporarily unavailable [core/utils.c line 3853]
2021-03-05 18:54:50 unable to start offload thread 0 for worker 19 !!!
2021-03-05 18:54:50 spawned 0 offload threads for uWSGI worker 19

Error logs:

2021-01-30 18:49:15,546: OSError: write error
2021-02-05 18:17:14,273: OSError: write error
2021-02-08 07:14:19,898: OSError: write error
2021-02-25 18:13:59,023: OSError: write error
2021-03-05 18:54:26,019: OSError: write error

It looks like you bumped into a bug in our experimental virtualisation system. To remediate it, I have moved your web apps so they are on different servers. Let us know if that helped, because we may be wrong about the diagnosis.