Forums

Error code: 502-backend - unix socket removed.

I'm constantly getting the same error as described in https://www.pythonanywhere.com/forums/topic/8974/

It doesn't matter how much I hit restart, and I also checked and kill all processes in Consoles, but the problem doesn't go away (((

2017-01-03 20:25:59 *** Starting uWSGI 2.0.5.1 (64bit) on [Tue Jan  3 17:25:57 2017] ***
2017-01-03 20:25:59 compiled with version: 4.8.4 on 24 October 2016 12:07:25
2017-01-03 20:25:59 os: Linux-3.13.0-100-generic #147-Ubuntu SMP Tue Oct 18 16:48:51 UTC 2016
2017-01-03 20:25:59 nodename: giles-liveweb1
2017-01-03 20:25:59 machine: x86_64
2017-01-03 20:25:59 clock source: unix
2017-01-03 20:25:59 pcre jit disabled
2017-01-03 20:25:59 detected number of CPU cores: 4
2017-01-03 20:25:59 current working directory: /etc/uwsgi/vassals
2017-01-03 20:25:59 detected binary path: /usr/local/bin/uwsgi
2017-01-03 20:25:59 *** dumping internal routing table ***
2017-01-03 20:25:59 [rule: 0] subject: path_info regexp: \.svgz$ action: addheader:Content-Encoding:gzip
2017-01-03 20:25:59 *** end of the internal routing table ***
2017-01-03 20:25:59 using Linux cgroup /mnt/cgroups/cpu/user_types/free with mode 700
2017-01-03 20:25:59 assigned process 8136 to cgroup /mnt/cgroups/cpu/user_types/free/tasks
2017-01-03 20:25:59 using Linux cgroup /mnt/cgroups/cpuacct/domains/rugbystat.pythonanywhere.com with mode 700
2017-01-03 20:25:59 assigned process 8136 to cgroup /mnt/cgroups/cpuacct/domains/rugbystat.pythonanywhere.com/tasks
2017-01-03 20:25:59 using Linux cgroup /mnt/cgroups/memory/domains/rugbystat.pythonanywhere.com with mode 700
2017-01-03 20:25:59 assigned process 8136 to cgroup /mnt/cgroups/memory/domains/rugbystat.pythonanywhere.com/tasks
2017-01-03 20:25:59 uWSGI running as root, you can use --uid/--gid/--chroot options
2017-01-03 20:25:59 chroot() to /mnt/chroots/rugbystat/dangermouse
2017-01-03 20:25:59 setgid() to 60000
2017-01-03 20:25:59 setuid() to 2134431
2017-01-03 20:25:59 limiting number of processes to 15...
2017-01-03 20:25:59 your processes number limit is 15
2017-01-03 20:25:59 your memory page size is 4096 bytes
2017-01-03 20:25:59 detected max file descriptor number: 123456
2017-01-03 20:25:59 building mime-types dictionary from file /etc/mime.types...
2017-01-03 20:25:59 536 entry found
2017-01-03 20:25:59 lock engine: pthread robust mutexes
2017-01-03 20:25:59 thunder lock: disabled (you can enable it with --thunder-lock)
2017-01-03 20:25:59 uwsgi socket 0 bound to UNIX address /var/sockets/rugbystat.pythonanywhere.com/socket fd 7
2017-01-03 20:25:59 Python version: 3.5.2 (default, Jul 17 2016, 00:00:00)  [GCC 4.8.4]
2017-01-03 20:25:59 *** Python threads support is disabled. You can enable it with --enable-threads ***
2017-01-03 20:25:59 Python main interpreter initialized at 0x164a290
2017-01-03 20:25:59 your server socket listen backlog is limited to 100 connections
2017-01-03 20:25:59 your mercy for graceful operations on workers is 60 seconds
2017-01-03 20:25:59 setting request body buffering size to 65536 bytes
2017-01-03 20:25:59 mapped 333952 bytes (326 KB) for 1 cores
2017-01-03 20:25:59 *** Operational MODE: single process ***
2017-01-03 20:25:59 initialized 35 metrics
2017-01-03 20:25:59 WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x164a290 pid: 8136 (default app)
2017-01-03 20:25:59 *** uWSGI is running in multiple interpreter mode ***
2017-01-03 20:25:59 spawned uWSGI master process (pid: 8136)
2017-01-03 20:25:59 spawned uWSGI worker 1 (pid: 8138, cores: 1)
2017-01-03 20:25:59 metrics collector thread started
2017-01-03 20:25:59 pthread_create(): Resource temporarily unavailable [core/utils.c line 3785]
2017-01-03 20:25:59 !!! unable to spawn stats pusher thread !!!
2017-01-03 20:25:59 chdir(): No such file or directory [core/uwsgi.c line 1541]
2017-01-03 20:25:59 VACUUM: unix socket /var/sockets/rugbystat.pythonanywhere.com/socket removed.
2017-01-03 20:25:59 pthread_create(): Resource temporarily unavailable [core/utils.c line 3785]
2017-01-03 20:25:59 unable to start offload thread 0 for worker 1 !!!
2017-01-03 20:25:59 spawned 0 offload threads for uWSGI worker 1
2017-01-03 20:26:01 *** Starting uWSGI 2.0.5.1 (64bit) on [Tue Jan  3 17:25:59 2017] ***
2017-01-03 20:26:01 compiled with version: 4.8.4 on 24 October 2016 12:07:25
2017-01-03 20:26:01 os: Linux-3.13.0-100-generic #147-Ubuntu SMP Tue Oct 18 16:48:51 UTC 2016
2017-01-03 20:26:01 nodename: giles-liveweb1
2017-01-03 20:26:01 machine: x86_64
2017-01-03 20:26:01 clock source: unix
2017-01-03 20:26:01 pcre jit disabled
2017-01-03 20:26:01 detected number of CPU cores: 4
2017-01-03 20:26:01 current working directory: /etc/uwsgi/vassals
2017-01-03 20:26:01 detected binary path: /usr/local/bin/uwsgi
2017-01-03 20:26:01 *** dumping internal routing table ***
2017-01-03 20:26:01 [rule: 0] subject: path_info regexp: \.svgz$ action: addheader:Content-Encoding:gzip
2017-01-03 20:26:01 *** end of the internal routing table ***
2017-01-03 20:26:01 using Linux cgroup /mnt/cgroups/cpu/user_types/free with mode 700
2017-01-03 20:26:01 assigned process 8140 to cgroup /mnt/cgroups/cpu/user_types/free/tasks
2017-01-03 20:26:01 using Linux cgroup /mnt/cgroups/cpuacct/domains/rugbystat.pythonanywhere.com with mode 700
2017-01-03 20:26:01 assigned process 8140 to cgroup /mnt/cgroups/cpuacct/domains/rugbystat.pythonanywhere.com/tasks
2017-01-03 20:26:01 using Linux cgroup /mnt/cgroups/memory/domains/rugbystat.pythonanywhere.com with mode 700
2017-01-03 20:26:01 assigned process 8140 to cgroup /mnt/cgroups/memory/domains/rugbystat.pythonanywhere.com/tasks
2017-01-03 20:26:01 uWSGI running as root, you can use --uid/--gid/--chroot options
2017-01-03 20:26:01 chroot() to /mnt/chroots/rugbystat/dangermouse
2017-01-03 20:26:01 setgid() to 60000
2017-01-03 20:26:01 setuid() to 2134431
2017-01-03 20:26:01 limiting number of processes to 15...
2017-01-03 20:26:01 your processes number limit is 15
2017-01-03 20:26:01 your memory page size is 4096 bytes
2017-01-03 20:26:01 detected max file descriptor number: 123456
2017-01-03 20:26:01 building mime-types dictionary from file /etc/mime.types...
2017-01-03 20:26:01 536 entry found
2017-01-03 20:26:01 lock engine: pthread robust mutexes
2017-01-03 20:26:01 thunder lock: disabled (you can enable it with --thunder-lock)
2017-01-03 20:26:01 uwsgi socket 0 bound to UNIX address /var/sockets/rugbystat.pythonanywhere.com/socket fd 7
2017-01-03 20:26:01 Python version: 3.5.2 (default, Jul 17 2016, 00:00:00)  [GCC 4.8.4]
2017-01-03 20:26:01 *** Python threads support is disabled. You can enable it with --enable-threads ***
2017-01-03 20:26:01 Python main interpreter initialized at 0x2612290
2017-01-03 20:26:01 your server socket listen backlog is limited to 100 connections
2017-01-03 20:26:01 your mercy for graceful operations on workers is 60 seconds
2017-01-03 20:26:01 setting request body buffering size to 65536 bytes
2017-01-03 20:26:01 mapped 333952 bytes (326 KB) for 1 cores
2017-01-03 20:26:01 *** Operational MODE: single process ***
2017-01-03 20:26:01 initialized 35 metrics
2017-01-03 20:26:01 WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x2612290 pid: 8140 (default app)
2017-01-03 20:26:01 *** uWSGI is running in multiple interpreter mode ***
2017-01-03 20:26:01 spawned uWSGI master process (pid: 8140)
2017-01-03 20:26:01 spawned uWSGI worker 1 (pid: 8142, cores: 1)
2017-01-03 20:26:01 metrics collector thread started
2017-01-03 20:26:01 pthread_create(): Resource temporarily unavailable [core/utils.c line 3785]
2017-01-03 20:26:01 !!! unable to spawn stats pusher thread !!!
2017-01-03 20:26:01 chdir(): No such file or directory [core/uwsgi.c line 1541]
2017-01-03 20:26:01 VACUUM: unix socket /var/sockets/rugbystat.pythonanywhere.com/socket removed.

PS: if it matters, I also couldn't get a list of running consoles:

Your consoles:

Retrieving consoles list...

Hi there --

Regarding the website, it looks like your website is trying to start up a redis server when it's restarted, so every time it starts it creates one and eventually you hit your process limit. We don't recommend you start extra servers from your website code -- there's no guarantee that they'll keep running or even be able to start at all.

Regarding the console list -- it looks like our current code has a bug when people are using Internet Explorer (even version 11) or certain older versions of Firefox -- is either of those the case for you? If so, hopefully we'll have a fix deployed tomorrow or the day after.

I tried to use redislite and now turned to redislabs. I've read it is absolutely admittable at PA, isn't it?

Yes, I tried to use Redis as-is previously not knowing about the restriction, but then switched code to get rid of extra servers and (!) it even started once. But after consequent deploys it didn't start anymore.

PS: I use Chromium 37.0.2062.120

Ah, right. That makes sense -- the redis servers had piled up and were getting in the way, and I had to log in to the web server your app is running on and shut them down. If you reload your website now, it should work.

Re: Chromium -- that makes sense, it's old enough that I imagine it doesn't support the new JavaScript features we inadvertently added a dependency to. The fix is still going through testing, but I have high hopes we'll be able to push it out later on today or early tomorrow.

Thank you very much! now everything works as planned

Great! The fix for the console list is now live, BTW -- let us know if you're still seeing problems there.

no, not at all. It loads with 'no consoles' at first, but then js-update with the console link

Excellent, thanks for confirming!

I have also received this problem. The code I use is to set up a chatbot website. However, I'm not certain where the Redis is being called from, as I have no experience with this. Would you be able to help me solve this problem?

What's your broker url?

To be honest, I don't really know! Just to get started, I forked this github repo and am trying to get it working. No code has been changed up till now.

You can search the repository on Github and see where the redis code is.

Ah.. I hadn't thought of that yet :) Thank you

Same problem here. Not using any redis code (I think) and not using Github. Could you log in to the web server where my app is running on and shut them down, or recommend another solution, please?