Supervisor: ERROR (spawn error) when trying to launch gunicorn

peachykeen

I have been trying to setup gunicorn with supervisor per these instructions. However when I run

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start Server-CardLearning

I get the error Server-CardLearning: ERROR (spawn error).

My configuration file is simple.

[program:Server-CardLearning]
command = gunicorn app:app -b localhost:8000
directory = /home/alexg/www/<flask project>
user = www-data

I get the following errors in my log file.

...
...
2017-11-30 13:48:52,276 INFO gave up: Server-CardLearning entered FATAL state, too many start retries too quickly
2017-11-30 13:49:10,595 INFO spawnerr: unknown error making dispatchers for 'Server-CardLearning': ENOENT
2017-11-30 13:49:11,597 INFO spawnerr: unknown error making dispatchers for 'Server-CardLearning': ENOENT
2017-11-30 13:49:13,599 INFO spawnerr: unknown error making dispatchers for 'Server-CardLearning': ENOENT
2017-11-30 13:49:16,603 INFO spawnerr: unknown error making dispatchers for 'Server-CardLearning': ENOENT
2017-11-30 13:49:16,603 INFO gave up: Server-CardLearning entered FATAL state, too many start retries too quickly
2017-11-30 13:58:12,101 INFO spawned: 'Server-CardLearning' with pid 13725
2017-11-30 13:58:12,560 INFO exited: Server-CardLearning (exit status 3; not expected)
2017-11-30 13:58:13,563 INFO spawned: 'Server-CardLearning' with pid 13730
2017-11-30 13:58:13,982 INFO exited: Server-CardLearning (exit status 3; not expected)
2017-11-30 13:58:15,986 INFO spawned: 'Server-CardLearning' with pid 13735
2017-11-30 13:58:16,411 INFO exited: Server-CardLearning (exit status 3; not expected)
2017-11-30 13:58:19,416 INFO spawned: 'Server-CardLearning' with pid 13742
2017-11-30 13:58:19,842 INFO exited: Server-CardLearning (exit status 3; not expected)
2017-11-30 13:58:20,843 INFO gave up: Server-CardLearning entered FATAL state, too many start retries too quickly
...
...
2017-11-30 14:10:29,728 INFO spawned: 'Server-CardLearning' with pid 13901
2017-11-30 14:10:29,957 INFO exited: Server-CardLearning (exit status 2; not expected)
2017-11-30 14:10:30,961 INFO spawned: 'Server-CardLearning' with pid 13902
2017-11-30 14:10:31,193 INFO exited: Server-CardLearning (exit status 2; not expected)
2017-11-30 14:10:33,200 INFO spawned: 'Server-CardLearning' with pid 13903
2017-11-30 14:10:33,436 INFO exited: Server-CardLearning (exit status 2; not expected)
2017-11-30 14:10:36,443 INFO spawned: 'Server-CardLearning' with pid 13904
2017-11-30 14:10:36,681 INFO exited: Server-CardLearning (exit status 2; not expected)
2017-11-30 14:10:37,682 INFO gave up: Server-CardLearning entered FATAL state, too many start retries too quickly

Where am I going wrong? I have tried some things I saw on stack overflow, but nothing proved to be relevant to this problem.

peachykeen

The root of the problem seemed to be that I had an issue with app.py. I was using some Flask library that I had installed on my local machine but not the server and for some reason I didn't get big errors when I ran the server via flask run --host=0.0.0.0.

I figured this out by adjusting supervisor .conf file which is located at /etc/supervisor/conf.d/Server-CardLearning.conf

The new .conf file reads:

[program:Server-CardLearning]
environment=SECRET_KEY="some_secret_key"
command=gunicorn app:app -b localhost:8000
directory=/home/alexg/www/Server-CardLearning
user=alexg
autostart=true
stderr_logfile=/var/log/supervisor/test.err.log
stdout_logfile=/var/log/supervisor/test.out.log

By adding the two log files I was able to run:

cat /var/log/supervisor/test.err.log

to see that I had an uninstalled library! ~Gasp!~

After installing the library, I ran:

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start Server-CardLearning

Now, if that doesn't fix it, I also found that digging around in the supervisor console was helpful:

$ sudo supervisorctl
supervisor> help
supervisor> status

I hope this helps someone out!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Getting the "main class not found" error when trying to launch any Java Program

Supervisor socket error issue

Win7 Virtualbox is giving this error when trying to launch a vm: Error loading 'crypt32.dll': 1790

Error: spawn EACCES when trying to build Ionic app in Ubuntu 15.10

FBSOpenApplicationErrorDomain error 3 when trying to launch a watch kit app on a physical device

Not able to configure uwgi via supervisor " uwsgi:uwsgi_00: ERROR (spawn error) "

iOS launch error when referencing ReactiveUI 7.4

Microsoft VS Code: When I try to launch my program error "spawn php ENOENT" shows up

"process launch failed: unknown error" when trying to run Rust program via LLDB

Error when trying to fix

"Error: Could not find or load main class" when trying to launch Run Configuration in Intellij

Error in deploy Gunicorn and Supervisor on AWS EC2

Getting error when trying to launch node.js app with PM2 Cluster

Error when trying to launch powershell script from WinForms App

"An Unknown error occurred" When trying to launch my Siri Shortcut

OSX fix Selenium Chromedriver launch error spawn Unknown system error -86 Bad CPU type in executable?

Error when trying to encrypt

Error when trying to launch program that uses libtcod for ruby

"Installation or uninstallation is not working temporarily" error when trying to launch Tizen watch application from Tizen SDK

Trying to launch the emulator on VM giving an error

Error when trying to encode

when I am trying to launch my app in my device and I am getting the error as launch option nil in my xcode?

startActivity throws error when trying to launch Settings.ACTION_LOCATION_SOURCE_SETTINGS

core dump error trying to launch spotify

Error when trying to login

Permission denied error when using UseUrls() when trying to launch Kestrel

How do I fix Java Eclipse "Launch Error" when trying to run code?

Flutter: Error when trying to launch app after inserting new permissions package

Runtime error when trying to spawn multiple processes (image detection and print to terminal)

TOP Ranking

HotTag

Archive