Re: Supervisor FATAl Exited too quickly (process log may have details(About inet_http_server and unix_http_server)

2017-09-10 Thread Antonis Christofides
Hi,

add something like --log-file=/var/log/weather_project/gunicorn.log to the
gunicorn command line (and make sure Gunicorn has permission to write to that
directory), and restart the program. The information you need to locate the
problem is usually in that log file.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com

On 2017-09-09 19:27, Jonathan Cheng wrote:
> I wrote a Django project and I use supervisor with gunicorn
>
>
> |
> /etc/supervisor/conf.d/weather.conf
> |
>
>
>
> |
>     [group:weather_station]
>     programs=site
>    
>     [program:site]
>     directory=$PROJECT
>     command=/home/nhcc/.local/bin/gunicorn -c
> /$PROJECT/weather_station/gunicorn.conf.py -p gunicorn.pod 
> weather_station.wsgi
>     autostart=true
>     autorestart=true
>     stdout_logfile=/var/log/supervisor.log
>     environment=my-environment-variable
>     ~
> |
>
>
>
>
> |
> `sudo supervisorctl reread`
>
>
> `sudo supervisorctl reload`
>
>
> `sudo supervisorctl status`
> |
>
>
> It showed up the error
>
> > weather_station:site             FATAL     Exited too quickly (process log
> may have details)
>
>
> So I checked out the log file :
>
> |
> `/var/log/supervisor/supervisord.log`
> |
>
>
> > 2017-09-08 17:15:25,000 CRIT Supervisor running as root (no user in
> config file) 
> > 2017-09-08 17:15:25,000 WARN Included extra file
> "/etc/supervisor/conf.d/weather.conf" during parsing 
> >2017-09-08 17:15:25,007 INFO RPC interface 'supervisor' initialized 
> >2017-09-08 17:15:25,008 CRIT Server 'inet_http_server' running without
> any HTTP
> > authentication checking 
> > 2017-09-08 17:15:25,008 INFO RPC interface
> > 'supervisor' initialized 
> > 2017-09-08 17:15:25,008 CRIT Server 'unix_http_server' running without
> any HTTP authentication checking
> > 2017-09-08 17:15:25,008 INFO supervisord started with pid 32371
> > 2017-09-08 17:15:26,013 INFO spawned: 'site' with pid 32447 
> > 2017-09-08 17:15:26,018 INFO exited: site (exit status 127; not 
> expected)
> > 2017-09-08 17:15:27,022 INFO spawned: 'site' with pid 32448 
> > 2017-09-08 17:15:27,026 INFO exited: site (exit status 127; not 
> expected)
> > 2017-09-08 17:15:29,032 INFO spawned: 'site' with pid 32449 
> > 2017-09-08 17:15:29,038 INFO exited: site (exit status 127; not 
> expected)
> > 2017-09-08 17:15:32,043 INFO spawned: 'site' with pid 32451 
> > 2017-09-08 17:15:32,059 INFO exited: site (exit status 127; not 
> expected)
> > 2017-09-08 17:15:33,060 INFO gave up: site entered FATAL state, too
> > many start retries too quickly
>                                                                           
>                                                                          
>                          
>
>
>
>
> According to `Included extra file`[the
> solution](https://github.com/Supervisor/supervisor/issues/272)
>
> According to `Server 'unix_http_server' running without any HTTP
> authentication checking`[the
> solution](https://github.com/Supervisor/supervisor/issues/717)
>
> I added two section [unix_http_server] and [inet_http_server]
>
>
>  
> |
>    [unix_http_server]
>     file=/var/run/supervisor.sock   ;(the path to the socket file)
>     chmod=0766                ;socket file mode (default0700)
>     ;chown=nobody:nogroup       ;socket file uid:gid owner
>     ;username=user              ;(defaultisnousername (open server))
>     ;password=123              ;(defaultisnopassword (open server))
>    
>     [inet_http_server]        ;inet (TCP)server disabled bydefault
>     port=*:9001       ;(ip_address:port specifier,*:port forall iface,
>     ;username=user              ;(defaultisnousername (open server))
>     ;password=123              ;(defaultisnopassword (open server))
>
> |
>
>
>
> This is the current  supervisor.conf
>
>
>
> |
>     [unix_http_server]
>     file=/var/run/supervisor.sock   ;(the path to the socket file)
>     chmod=0766                ;socket file mode (default0700)
>    
>     [supervisord]
>     logfile=/var/log/supervisor/supervisord.log ;(main log
> file;default$CWD/supervisord.log)
>     pidfile=/var/run/supervisord.pid ;(supervisord 
> pidfile;defaultsupervisord.pid)
>     childlogdir=/var/log/supervisor            ;('AUTO'child log 
> dir,default$TEMP)
>    
>     [rpcinterface:supervisor]
>     supervisor.rpcinterface_factory
> =supervisor.rpcinterface:make_main_rpcinterface
>    
>     [supervisorctl]
>     serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix
> socket
>    
>     [inet_http_server]        ;inet (TCP)server disabled bydefault
>     port=*:9001       ;
>    
>     [include]
>     files =/etc/supervisor/*.conf
>     files = /etc/supervisor/conf.d/*.conf
>
>
>
> |
>
>
>
>
>
>
> Then I ran
>
>  
> |
>    sudo supervisord -c /etc/supervisor/supervisord.conf
>     sudo supervisorctl -c /etc/supervisor/supervisord.conf
> |
>
>
>
>
> And I checked the 

Re: Supervisor FATAl Exited too quickly (process log may have details(About inet_http_server and unix_http_server)

2017-09-09 Thread Mario Gudelj
Does that Guniorn command run directly from the command line? What's
gunicorn.pod? Make sure you can start gunicorn outside of supervisor and
then stick that command into conf file.

Cheers,

M

On Sun, 10 Sep 2017 at 2:28 am, Jonathan Cheng 
wrote:

> I wrote a Django project and I use supervisor with gunicorn
>
>
> /etc/supervisor/conf.d/weather.conf
>
>
>
> [group:weather_station]
> programs=site
>
> [program:site]
> directory=$PROJECT
> command=/home/nhcc/.local/bin/gunicorn -c /$PROJECT/weather_station/
> gunicorn.conf.py -p gunicorn.pod weather_station.wsgi
> autostart=true
> autorestart=true
> stdout_logfile=/var/log/supervisor.log
> environment=my-environment-variable
> ~
>
>
>
>
> `sudo supervisorctl reread`
>
>
> `sudo supervisorctl reload`
>
>
> `sudo supervisorctl status`
>
>
> It showed up the error
>
> > weather_station:site FATAL Exited too quickly (process
> log may have details)
>
>
> So I checked out the log file :
>
> `/var/log/supervisor/supervisord.log`
>
>
> > 2017-09-08 17:15:25,000 CRIT Supervisor running as root (no user in
>> config file)
>> > 2017-09-08 17:15:25,000 WARN Included extra file
>> "/etc/supervisor/conf.d/weather.conf" during parsing
>> >2017-09-08 17:15:25,007 INFO RPC interface 'supervisor' initialized
>> >2017-09-08 17:15:25,008 CRIT Server 'inet_http_server' running without
>> any HTTP
>> > authentication checking
>> > 2017-09-08 17:15:25,008 INFO RPC interface
>> > 'supervisor' initialized
>> > 2017-09-08 17:15:25,008 CRIT Server 'unix_http_server' running without
>> any HTTP authentication checking
>> > 2017-09-08 17:15:25,008 INFO supervisord started with pid 32371
>> > 2017-09-08 17:15:26,013 INFO spawned: 'site' with pid 32447
>> > 2017-09-08 17:15:26,018 INFO exited: site (exit status 127; not
>> expected)
>> > 2017-09-08 17:15:27,022 INFO spawned: 'site' with pid 32448
>> > 2017-09-08 17:15:27,026 INFO exited: site (exit status 127; not
>> expected)
>> > 2017-09-08 17:15:29,032 INFO spawned: 'site' with pid 32449
>> > 2017-09-08 17:15:29,038 INFO exited: site (exit status 127; not
>> expected)
>> > 2017-09-08 17:15:32,043 INFO spawned: 'site' with pid 32451
>> > 2017-09-08 17:15:32,059 INFO exited: site (exit status 127; not
>> expected)
>> > 2017-09-08 17:15:33,060 INFO gave up: site entered FATAL state, too
>> > many start retries too quickly
>>
>>
>>
>
>
>
>
> According to `Included extra file`[the solution](
> https://github.com/Supervisor/supervisor/issues/272)
>
> According to `Server 'unix_http_server' running without any HTTP
> authentication checking`[the solution](
> https://github.com/Supervisor/supervisor/issues/717)
>
> I added two section [unix_http_server] and [inet_http_server]
>
>
>
>[unix_http_server]
> file=/var/run/supervisor.sock   ; (the path to the socket file)
> chmod=0766 ; socket file mode (default 0700)
> ;chown=nobody:nogroup   ; socket file uid:gid owner
> ;username=user  ; (default is no username (open server))
> ;password=123   ; (default is no password (open server))
>
> [inet_http_server] ; inet (TCP) server disabled by default
> port=*:9001; (ip_address:port specifier, *:port for all iface,
> ;username=user  ; (default is no username (open server))
> ;password=123   ; (default is no password (open server))
>
>
>
>
> This is the current  supervisor.conf
>
>
>
> [unix_http_server]
> file=/var/run/supervisor.sock   ; (the path to the socket file)
> chmod=0766 ; socket file mode (default 0700)
>
> [supervisord]
> logfile=/var/log/supervisor/supervisord.log ; (main log file;default
> $CWD/supervisord.log)
> pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default
> supervisord.pid)
> childlogdir=/var/log/supervisor; ('AUTO' child log dir,
> default $TEMP)
>
> [rpcinterface:supervisor]
> supervisor.rpcinterface_factory = supervisor.rpcinterface:
> make_main_rpcinterface
>
> [supervisorctl]
> serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a
> unix socket
>
> [inet_http_server] ; inet (TCP) server disabled by default
> port=*:9001;
>
> [include]
> files = /etc/supervisor/*.conf
> files = /etc/supervisor/conf.d/*.conf
>
>
>
>
>
>
>
>
>
> Then I ran
>
>
>sudo supervisord -c /etc/supervisor/supervisord.conf
> sudo supervisorctl -c /etc/supervisor/supervisord.conf
>
>
>
>
> And I checked the log again
>
> The error is completely be same
>
> Does anyone know why??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at