unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.46k stars 691 forks source link

Give more information on failures #1214

Open KES777 opened 8 years ago

KES777 commented 8 years ago

Despite on I have all rights to the file: /home/web/public_html/run/socket I can not start server

$cd /home/web/public_html/run
$ls -l
srw-rw---- 1 web web      0 Mar 21 13:48 socket
$ rm socket
$ ps ax|grep uwsgi
$ <start uwsgi command here>
$cat uwsgi_error.log
Mon Mar 21 11:48:38 2016 - *** Starting uWSGI 2.0.12 (64bit) on [Mon Mar 21 11:48:38 2016] ***
Mon Mar 21 11:48:38 2016 - compiled with version: 5.3.1 20160101 on 16 January 2016 16:26:31
Mon Mar 21 11:48:38 2016 - os: Linux-4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06)
Mon Mar 21 11:48:38 2016 - nodename: vpn.guru
Mon Mar 21 11:48:38 2016 - machine: x86_64
Mon Mar 21 11:48:38 2016 - clock source: unix
Mon Mar 21 11:48:38 2016 - pcre jit disabled
Mon Mar 21 11:48:38 2016 - detected number of CPU cores: 2
Mon Mar 21 11:48:38 2016 - current working directory: /home/web/public_html/run
Mon Mar 21 11:48:38 2016 - writing pidfile to /home/web/public_html/run/pid
Mon Mar 21 11:48:38 2016 - detected binary path: /home/feelsafe/tmp/uwsgi/uwsgi-2.0.12/uwsgi
Mon Mar 21 11:48:38 2016 - chdir() to /home/web/public_html
Mon Mar 21 11:48:38 2016 - your processes number limit is 23812
Mon Mar 21 11:48:38 2016 - your memory page size is 4096 bytes
Mon Mar 21 11:48:38 2016 - detected max file descriptor number: 1024
Mon Mar 21 11:48:38 2016 - lock engine: pthread robust mutexes
Mon Mar 21 11:48:38 2016 - thunder lock: disabled (you can enable it with --thunder-lock)
Mon Mar 21 11:48:38 2016 - uwsgi socket 0 bound to UNIX address /home/web/public_html/run/socket fd 9
Mon Mar 21 11:48:38 2016 - initialized Perl 5.22.1 main interpreter at 0x1901910
Mon Mar 21 11:48:38 2016 - your server socket listen backlog is limited to 100 connections
Mon Mar 21 11:48:38 2016 - your mercy for graceful operations on workers is 60 seconds
Mon Mar 21 11:48:38 2016 - mapped 145536 bytes (142 KB) for 1 cores
Mon Mar 21 11:48:38 2016 - *** Operational MODE: single process ***
Mon Mar 21 11:48:39 2016 - PSGI app 0 (lib/MasonHandler.psgi) loaded in 1 seconds at 0x1d8fe80 (interpreter 0x1901910)
Mon Mar 21 11:48:39 2016 - spawned uWSGI master process (pid: 3170)
Mon Mar 21 11:48:39 2016 - spawned uWSGI worker 1 (pid: 3172, cores: 1)
Mon Mar 21 11:48:39 2016 - error removing unix socket, unlink(): Operation not permitted [core/socket.c line 198]
Mon Mar 21 11:48:39 2016 - bind(): Address already in use [core/socket.c line 230]
Mon Mar 21 11:48:39 2016 - ...brutally killing workers...
KES777 commented 8 years ago

This shows nothing

$ netstat -na | grep socket
xrmx commented 8 years ago

This may give you some hints...

Mon Mar 21 11:48:39 2016 - error removing unix socket, unlink(): Operation not permitted [core/socket.c line 198]
Mon Mar 21 11:48:39 2016 - bind(): Address already in use [core/socket.c line 230]

Without config is impossible yo help you debug this. Said that this looks like more like a support issue than an actual bug so better discuss it eventually in the mailing list.

KES777 commented 8 years ago

Yes, I saw it.

Despite on I have all rights to the file: /home/web/public_html/run/socket I can not start server

The problem were with:

stats = /tmp/uwsgitop.%n.socket

It is not clear from log:

  1. Does uwsgi run under required user:group (glad to see this info after: spawned uWSGI master process (pid: 3170))
  2. Which socket it try to remove (glad to see this info after: error removing unix socket, unlink())

So this ticket belongs to more verbose logging which will help to resolve server start issues

Thank you for attention

unbit commented 8 years ago

check the permission of /tmp/uwsgitop.%n.socket, as uWSGi is trying to remove it very probably you accidentally have it already created in /tmp from a previous run.

KES777 commented 8 years ago

Yes, the previous server run was under different user and current one can not remove /tmp/uwsgitip.%n.socket. I have spent about two hours to dig that, so I create this feature request to show more info.