Proxy Error - Error reading from remote server

2,330 views
Skip to first unread message

Rodney Hunter

unread,
May 15, 2018, 1:57:35 PM5/15/18
to NetBox
First, I need to admit that I am not proficient with Linux. We used to have a Linux guy that helped when we ran into issues but he is no longer here.

With that being said, I am attempting to upgrade from version to 2.2.8 to 2.3.3. After completing the update, I get the following error -

"Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.
Reason: Error reading from remote server"

I am running Python v2, Apache 2.4.18 and Ubuntu 16.04.2.

These are the steps I run to perform the upgrade under sudo credentials -

cd /home/tsdept
wget https://github.com/digitalocean/netbox/archive/vX.Y.Z.tar.gz
tar -xvzf v2.3.3.tar.gz -C /opt
cd /opt/
rm netbox
ln -sf netbox-2.3.3/ netbox
cp /opt/netbox-2.2.8/netbox/netbox/configuration.py /opt/netbox/netbox/netbox/configuration.py cp /opt/netbox-2.2.8/gunicorn_config.py /opt/netbox/gunicorn_config.py cd netbox ./upgrade.sh sudo supervisorctl restart netbox

I appreciate any help!
Thanks

Brian Candler

unread,
May 18, 2018, 3:49:32 AM5/18/18
to NetBox
Try setting DEBUG = True in configuration.py, then run netbox under the local debug webserver:

cd /opt/netbox/netbox
python3 manage.py runserver "[::]:8000" --insecure

If it fails to start, you should get a decent error message that you can post here.
If it starts up OK, use a web browser to connect to http://x.x.x.x:8000/ and see if any additional error is generated.

Rodney Hunter

unread,
May 18, 2018, 10:25:01 AM5/18/18
to NetBox
Hey Brian,

Thanks for your help. I set DEBUG to true and ran netbox under local debug using python3 and it started with no errors and I was able to access the web with no errors. However, I completed the install using python version 2, so if i try the same command (python2 manage.py runserver "[::]:8000" --insecure) I get the following error

Unhandled exception in thread started by <function wrapper at 0x7f4afa4d32a8>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 117, in inner_run
    autoreload.raise_last_exception()
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 251, in raise_last_exception
    six.reraise(*_exception)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 94, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named timezone_field

To me, it seems like the logical solution is to switch from python version 2 to version 3. I am not exactly sure how to switch versions.

Rodney Hunter

unread,
May 18, 2018, 10:51:42 AM5/18/18
to NetBox
I found in the readthedocs documentation how to migrate to python 3 and it was pretty easy. After that migration, everything is working great again on version 2.3.3.

Thanks for your help! It is very much appreciated!

Brian Candler

unread,
May 19, 2018, 3:36:58 AM5/19/18
to NetBox
Glad you got it working.  I use python3 because that's what Ubuntu 16.04+ comes with by default (and I don't want to add python2 into the mix unless necessary), but AFAIK Netbox should still support python2.

I believe you can pass flag "-2" to upgrade.sh to force version 2.
Reply all
Reply to author
Forward
0 new messages