Forums

Web apps not work (502-backend)

My web apps not work. Even autogenerated examples. In access log I see that app starts (it's make outgoing request) but doesn't answer on incoming requests. I tried Flask and simple wsgi apps on Python 2.7/3.5. There are no errors in error log, only some strange messages in server log related to uWSGI. Here example:

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

It looks like you've specified a working directory that does not exist.

I did not anything but problem solved itself. So my web app works now. I don't know what happened.