Problems during install testing - HTTP: failed to make connection to backend

2,243 views
Skip to first unread message

Sean Scarfo

unread,
Nov 13, 2017, 6:24:13 PM11/13/17
to NetBox
Hey everyone,  

I'm new(ish) to linux, but can follow directions, tail a log, and have been using ubuntu server on and off for the past few years.  Trying to install netbox, and 'seemed' to be able to follow instructions all the way through. 

However when I test of course it fails.   

Getting error 503 in browswer
Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.4.18 (Ubuntu) Server at 192.168.20.8 Port 8081

[Mon Nov 13 18:12:03.558979 2017] [proxy:error] [pid 1870] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed
[Mon Nov 13 18:12:03.559163 2017] [proxy:error] [pid 1870] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Mon Nov 13 18:12:03.559224 2017] [proxy_http:error] [pid 1870] [client 192.168.20.59:59932] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Mon Nov 13 18:12:03.675474 2017] [proxy:error] [pid 1873] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed
[Mon Nov 13 18:12:03.675593 2017] [proxy:error] [pid 1873] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Mon Nov 13 18:12:03.675642 2017] [proxy_http:error] [pid 1873] [client 192.168.20.59:59933] AH01114: HTTP: failed to make connection to backend: 127.0.0.1, referer: http://192.168.20.8:8081/


I've verified that SELinux is not installed.   
I've verified that PIP and django are installed as well as gunicorn, wsgi, and supervisor.  

Trying to find the cause, I tried running gunicorn manually, and I got these errors. 

 sudo gunicorn -c /opt/netbox/gunicorn_config.py netbox.wsgi
[2017-11-13 18:16:53 -0500] [1973] [INFO] Starting gunicorn 19.7.1
[2017-11-13 18:16:53 -0500] [1973] [INFO] Listening at: http://127.0.0.1:8001 (1973)
[2017-11-13 18:16:53 -0500] [1973] [INFO] Using worker: sync
[2017-11-13 18:16:53 -0500] [1976] [INFO] Booting worker with pid: 1976
[2017-11-13 18:16:53 -0500] [1976] [ERROR] Exception in worker process
Traceback (most recent call last):
 
File "/usr/local/lib/python3.5/dist-packages/gunicorn/arbiter.py", line 578, in spawn_worker
    worker
.init_process()
 
File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 126, in init_process
   
self.load_wsgi()
 
File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 135, in load_wsgi
   
self.wsgi = self.app.wsgi()
 
File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/base.py", line 67, in wsgi
   
self.callable = self.load()
 
File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
   
return self.load_wsgiapp()
 
File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
   
return util.import_app(self.app_uri)
 
File "/usr/local/lib/python3.5/dist-packages/gunicorn/util.py", line 352, 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'
[2017-11-13 18:16:53 -0500] [1976] [INFO] Worker exiting (pid: 1976)
[2017-11-13 18:16:53 -0500] [1977] [INFO] Booting worker with pid: 1977
[2017-11-13 18:16:53 -0500] [1977] [ERROR] Exception in worker process




Any suggestions?  I'm trying to run this on a different port 80 as I have another IPAM that I have in use and need to leave up till I get this working. 

Jeremy Stretch

unread,
Nov 14, 2017, 11:50:16 AM11/14/17
to Sean Scarfo, NetBox
> ImportError: No module named 'django'

This line indicates that the Django framework hasn't been found in your Python path. First, I'll note that you're running Python 3: Make sure you used pip3 to install packages and not pip (which would install them for Python 2).

You can verify installed packages with `pip freeze` (Python 2) and `pip3 freeze` (Python 3).

Jeremy


--
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/09dc97b0-bbde-4337-86ba-4480905740e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Scarfo

unread,
Nov 14, 2017, 3:57:53 PM11/14/17
to NetBox
Verified that packages were installed under pip3.  However, I do see packages under pip as well.  

Suggestions?
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.

Sean Scarfo

unread,
Nov 16, 2017, 10:01:15 AM11/16/17
to NetBox
Any suggestions on how to make sure Django finds my python path?

Jeremy Stretch

unread,
Nov 16, 2017, 11:30:17 AM11/16/17
to Sean Scarfo, NetBox
Make sure you've installed and are invoking the Python3 version of gunicorn ("pip3 install gunicorn"). To check what version you have installed:

$ head `which gunicorn`
#!/usr/bin/python3
...

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/258aa9fe-5f88-41ac-bdff-943c61d06a41%40googlegroups.com.

Sean Scarfo

unread,
Nov 20, 2017, 7:01:58 AM11/20/17
to NetBox
Yep, definately shows as 
#!/usr/bin/python3

Any suggestions?

Jacob Mansfield

unread,
Nov 20, 2017, 10:14:54 AM11/20/17
to Sean Scarfo, NetBox
What happens if you run /usr/bin/python3, then type import django?
(Hit Ctrl+D to exit)
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/733bc37c-c10c-4243-84fe-d5be4efddb21%40googlegroups.com.

Sean Scarfo

unread,
Nov 20, 2017, 3:42:48 PM11/20/17
to NetBox
I'm able to enter into the python interpreter, and when I type import django, I get no feedback from the interpreter.  I'm assuming it was able to successfully import the module. 

Simon Meister

unread,
Nov 20, 2017, 4:25:28 PM11/20/17
to Sean Scarfo, NetBox
Not sure but I had the same issue after the upgrade. I changed in gunicorn_config.py the bind to 127.0.0.1:8001 instead of 0.0.0.0:8001

sudo supervisorctl restart netbox

And the netbox was up and running.

Regards,
Simon


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/c821d7e7-a1fe-4110-8f5b-ea31fbd7c0f9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages