Forums

Unable to start an empty app

Hello, sorry for my English and the number of messages I sent in support, I'll try to describe the problem.

At the moment I have an empty flask application (www.hvh-online.com /home/Lvadislav/hvh/network.py), in which I commented absolutely everything except for 2 lines:

from flask import Flask
app = Flask(__name__)

But this application does not start, the server logs show that it tries to do this every few minutes without result.

If I try to create a new application and move the code there, then everything works fine) Thanks in advance for your reply.

hi Lvadislav- can you post the error logs causing the server to restart?

  • 2018-02-04 12:25:01 *** Starting uWSGI 2.0.14 (64bit) on [Sun Feb 4 12:25:00 2018] ***
  • 2018-02-04 12:25:01 compiled with version: 5.4.0 20160609 on 22 November 2017 21:24:09
  • 2018-02-04 12:25:01 os: Linux-4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018
  • 2018-02-04 12:25:01 nodename: giles-liveweb7
  • 2018-02-04 12:25:01 machine: x86_64
  • 2018-02-04 12:25:01 clock source: unix
  • 2018-02-04 12:25:01 pcre jit disabled
  • 2018-02-04 12:25:01 detected number of CPU cores: 2
  • 2018-02-04 12:25:01 current working directory: (unreachable)/etc/uwsgi/vassals
  • 2018-02-04 12:25:01 detected binary path: /usr/local/bin/uwsgi
  • 2018-02-04 12:25:01 *** dumping internal routing table ***
  • 2018-02-04 12:25:01 [rule: 0] subject: path_info regexp: .svgz$ action: addheader:Content-Encoding:gzip
  • 2018-02-04 12:25:01 *** end of the internal routing table ***
  • 2018-02-04 12:25:01 chdir() to /home/Lvadislav/
  • 2018-02-04 12:25:01 limiting number of processes to 90...
  • 2018-02-04 12:25:01 your processes number limit is 90
  • 2018-02-04 12:25:01 your memory page size is 4096 bytes
  • 2018-02-04 12:25:01 detected max file descriptor number: 123456
  • 2018-02-04 12:25:01 building mime-types dictionary from file /etc/mime.types...
  • 2018-02-04 12:25:01 536 entry found
  • 2018-02-04 12:25:01 lock engine: pthread robust mutexes
  • 2018-02-04 12:25:01 thunder lock: disabled (you can enable it with --thunder-lock)
  • 2018-02-04 12:25:01 uwsgi socket 0 bound to UNIX address /var/sockets/www.hvh-online.com/socket fd 3
  • 2018-02-04 12:25:01 Python version: 3.6.0 (default, Jan 13 2017, 00:00:00) [GCC 4.8.4]
  • 2018-02-04 12:25:01 *** Python threads support is disabled. You can enable it with --enable-threads ***
  • 2018-02-04 12:25:01 Python main interpreter initialized at 0x19e14c0
  • 2018-02-04 12:25:01 your server socket listen backlog is limited to 100 connections
  • 2018-02-04 12:25:01 your mercy for graceful operations on workers is 60 seconds
  • 2018-02-04 12:25:01 setting request body buffering size to 65536 bytes
  • 2018-02-04 12:25:01 mapped 667904 bytes (652 KB) for 3 cores
  • 2018-02-04 12:25:01 *** Operational MODE: preforking ***
  • 2018-02-04 12:25:01 initialized 65 metrics
  • 2018-02-04 12:25:01 WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x19e14c0 pid: 27910 (default - app)
  • 2018-02-04 12:25:01 *** uWSGI is running in multiple interpreter mode ***
  • 2018-02-04 12:25:01 gracefully (RE)spawned uWSGI master process (pid: 27910)
  • 2018-02-04 12:25:01 spawned uWSGI worker 1 (pid: 27912, cores: 1)
  • 2018-02-04 12:25:01 fork(): Resource temporarily unavailable [core/master_utils.c line 729]
  • 2018-02-04 12:25:01 fork(): Resource temporarily unavailable [core/master_utils.c line 729]
  • 2018-02-04 12:25:01 metrics collector thread started
  • 2018-02-04 12:25:01 pthread_create(): Resource temporarily unavailable [core/utils.c line 3816]
  • 2018-02-04 12:25:01 !!! unable to spawn stats pusher thread !!!
  • 2018-02-04 12:25:01 chdir(): No such file or directory [core/uwsgi.c line 1590]
  • 2018-02-04 12:25:01 pthread_create(): Resource temporarily unavailable [core/utils.c line 3816]
  • 2018-02-04 12:25:01 VACUUM: unix socket /var/sockets/www.hvh-online.com/socket removed.
  • 2018-02-04 12:25:01 unable to start offload thread 0 for worker 1 !!!
  • 2018-02-04 12:25:01 spawned 0 offload threads for uWSGI worker 1

Maybe, It can help, I added just one request handler to the application and found out that literally at the moment of the server startup, it works fine, but immediately breaks (I spent a lot of time refreshing the page), the application is still empty, now it consists of 5 lines:

from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
    return 'Luck'

https://i.imgur.com/Ucxahnq.png - page screenshot (when I add it here, it breaks the page)

Now it works fine without any changes. If you have influenced it, thank you.