NetBox v2 Beta - gunicorn won't start

643 views
Skip to first unread message

Terry McKenna

unread,
Apr 18, 2017, 4:23:54 PM4/18/17
to NetBox
Hi Guys,

I followed the install instructions to the 'T', several times, and I always get this error, which results in a "Bad Gateway" error in the browser:

netbox@netbox:/usr/lib/python3/dist-packages$ sudo gunicorn -
[2017-04-18 16:04:52 +0000] [1938] [INFO] Starting gunicorn 19.6.0
[2017-04-18 16:04:52 +0000] [1938] [INFO] Listening at: http://127.0.0.1:8000 (1938)
[2017-04-18 16:04:52 +0000] [1938] [INFO] Using worker: sync
[2017-04-18 16:04:52 +0000] [1942] [INFO] Booting worker with pid: 1942
[2017-04-18 16:04:52 +0000] [1942] [ERROR] Exception in worker process
Traceback (most recent call last):
 
File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 557, in spawn_worker
    worker
.init_process()
 
File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 126, in init_process
   
self.load_wsgi()
 
File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 136, in load_wsgi
   
self.wsgi = self.app.wsgi()
 
File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
   
self.callable = self.load()
 
File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
   
return self.load_wsgiapp()
 
File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
   
return util.import_app(self.app_uri)
 
File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 366, in import_app
    __import__
(module)
ImportError: No module named -
[2017-04-18 16:04:52 +0000] [1942] [INFO] Worker exiting (pid: 1942)
[2017-04-18 16:04:52 +0000] [1938] [INFO] Shutting down: Master
[2017-04-18 16:04:52 +0000] [1938] [INFO] Reason: Worker failed to boot.


I am not using VIRTUALENV. My environment is exactly setup per the NetBox install instructions. I only installed Python3.

Ubuntu Server 16.10

I am able to access the NetBox site running the server from# python3 ./manage.py 0.0.0.0:80 --insecure.

I am trying to setup NGINX.

I can't seem to find a solution on the web.

Thanks

Jeremy Stretch

unread,
Apr 18, 2017, 4:28:23 PM4/18/17
to Terry McKenna, NetBox
You're passing a hyphen as an argument to gunicorn. Just do "sudo gunicorn".

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/14f9ada2-62cf-4a01-82c9-e7ecfec6b17e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Terry McKenna

unread,
Apr 18, 2017, 4:36:02 PM4/18/17
to NetBox
Somewhere, on some site, they said to pass - to get all errors, or some such thing.

netbox@netbox:~$ sudo gunicorn
usage
: gunicorn [OPTIONS] [APP_MODULE]
gunicorn
: error: No application module specified.

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.

Jeremy Stretch

unread,
Apr 18, 2017, 4:40:39 PM4/18/17
to Terry McKenna, NetBox
Per the docs, you need to specify the module:
gunicorn -c /opt/netbox/gunicorn_config.py netbox.wsgi


To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/9f2407d3-0357-4ef0-a79e-d5f270220f31%40googlegroups.com.

Terry McKenna

unread,
Apr 18, 2017, 4:46:32 PM4/18/17
to NetBox
This is my conf file:

netbox@netbox:/etc/supervisor/conf.d$ cat netbox.conf
[program:netbox]
command
= gunicorn -c /opt/netbox/gunicorn_config.py netbox.wsgi
directory
= /opt/netbox/netbox/
user
= www-data

Terry McKenna

unread,
Apr 19, 2017, 6:42:51 AM4/19/17
to NetBox
Here is the output when I run it manually:

netbox@netbox:~$ sudo gunicorn -c /opt/netbox/gunicorn_config.py netbox.wsgi
[2017-04-19 06:42:09 +0000] [4809] [INFO] Starting gunicorn 19.6.0
[2017-04-19 06:42:09 +0000] [4809] [INFO] Listening at: http://127.0.0.1:8001 (4809)
[2017-04-19 06:42:09 +0000] [4809] [INFO] Using worker: sync
[2017-04-19 06:42:09 +0000] [4813] [INFO] Booting worker with pid: 4813
[2017-04-19 06:42:09 +0000] [4813] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 557, in spawn_worker
    worker.init_process()
  File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 126, in init_process
    self.load_wsgi()
  File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 136, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 366, in import_app
    __import__(module)
  File "/opt/netbox/netbox/netbox/wsgi.py", line 12, in <module>
    from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2017-04-19 06:42:09 +0000] [4813] [INFO] Worker exiting (pid: 4813)
[2017-04-19 06:42:09 +0000] [4809] [INFO] Shutting down: Master
[2017-04-19 06:42:09 +0000] [4809] [INFO] Reason: Worker failed to boot.

Thanks

Terry McKenna

unread,
Apr 19, 2017, 2:37:02 PM4/19/17
to NetBox
I did a complete new install on a new server but this time logged in as root and it worked.
Reply all
Reply to author
Forward
0 new messages