Failing new install at last steps - missing gunicorn / django

891 views
Skip to first unread message

Ross Moutell

unread,
May 21, 2020, 4:26:51 PM5/21/20
to NetBox
So my old Netbox (v2.7.11) system on Unbuntu 16.04 has run out of road. It has no venv, https or systemd so I want to build a new one on 18.04 or 20.04 and migrate the database.

I have built my server and it tests successfully.


I follow the remaining steps and go to my site. I get an expected warning from my self signed cert.


screenshot.png
















And I see the following.

screenshot_1.png










systemctl status netbox.service shows the following

● netbox.service - NetBox WSGI Service
     Loaded: loaded (/etc/systemd/system/netbox.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Thu 2020-05-21 20:18:13 UTC; 18s ago
       Docs: https://netbox.readthedocs.io/en/stable/
    Process: 3248 ExecStart=/opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netbox.wsgi (code=exited, status=203/EXEC)
   Main PID: 3248 (code=exited, status=203/EXEC)

journalctl -xe shows the following

-- The job identifier is 7687.
May 21 20:19:14 netbox-primus systemd[1]: Stopped NetBox WSGI Service.
-- Subject: A stop job for unit netbox.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit netbox.service has finished.
--
-- The job identifier is 7610 and the job result is done.
May 21 20:19:14 netbox-primus systemd[1]: Started NetBox WSGI Service.
-- Subject: A start job for unit netbox.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit netbox.service has finished successfully.
--
-- The job identifier is 7610.
May 21 20:19:14 netbox-primus systemd[3285]: netbox.service: Failed to execute command: No such file or directory
May 21 20:19:14 netbox-primus systemd[3285]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory
-- Subject: Process /opt/netbox/venv/bin/gunicorn could not be executed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The process /opt/netbox/venv/bin/gunicorn could not be executed and failed.
--
-- The error number returned by this process is ERRNO.
May 21 20:19:14 netbox-primus systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit netbox.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 203.
May 21 20:19:14 netbox-primus systemd[1]: netbox.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit netbox.service has entered the 'failed' state with result 'exit-code'.
May 21 20:19:14 netbox-primus python3[3284]: Traceback (most recent call last):
May 21 20:19:14 netbox-primus python3[3284]:   File "/opt/netbox/netbox/manage.py", line 8, in <module>
May 21 20:19:14 netbox-primus python3[3284]:     from django.core.management import execute_from_command_line
May 21 20:19:14 netbox-primus python3[3284]: ModuleNotFoundError: No module named 'django'
May 21 20:19:14 netbox-primus systemd[1]: netbox-rq.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit netbox-rq.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
May 21 20:19:14 netbox-primus systemd[1]: netbox-rq.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit netbox-rq.service has entered the 'failed' state with result 'exit-code'.


It is true there is no file at " /opt/netbox/venv/bin/gunicorn: No such file or directory" but I cannot see the step where this is supposed to be put in place or what this file or directory is supposed to be.

I have installed django in my venv with

sudo -H pip3 install django-rq==2.3.2

As it seemed to be missing as per https://github.com/netbox-community/netbox/issues/4633 earlier in the process.

Kinda stuck at this point. Can anyone point me in the right direction?

Regards

Ross

Brian Candler

unread,
May 21, 2020, 5:43:03 PM5/21/20
to NetBox
What version of Netbox are you installing on the new system?

Instructions are written to go with the latest version, which automatically creates a venv for you.  You should never need to "pip3 install" anything.

Ross Moutell

unread,
May 21, 2020, 6:00:57 PM5/21/20
to NetBox
I am trying to install 2.7.11 on my new server as that is the version my current installation is at. I was operating under the assumption that to migrate the DB the Netbox versions would have to be the same at the source and destination. If that is not the case then I will work with the latest version.

Brian Candler

unread,
May 22, 2020, 1:45:47 AM5/22/20
to NetBox
No, you can import database from an older version.  Just need to run ./upgrade.sh after importing it so that it applies the necessary changes ("migrations").

Ross Moutell

unread,
May 22, 2020, 2:36:52 PM5/22/20
to NetBox
So this evening I tried to do a build of 2.8.4 on Ubuntu 18.04 and Ubuntu 20.04

Again for both the test sites work.

18.04 on top and 20.04 below.

1804.png




2004.png


On 18.04 I get the following errors after installing the web server and service


netbox-user@netbox-1804:/opt/netbox$ journalctl -xe
May 22 18:02:30 netbox-1804 systemd[1]: Reloading.
May 22 18:02:30 netbox-1804 sudo[2479]: pam_unix(sudo:session): session closed for user root
May 22 18:02:44 netbox-1804 sudo[2515]: netbox-user : TTY=pts/0 ; PWD=/opt/netbox-2.8.4 ; USER=root ; COMMAND=/bin/systemctl start netbox netbox-rq
May 22 18:02:44 netbox-1804 sudo[2515]: pam_unix(sudo:session): session opened for user root by netbox-user(uid=0)
May 22 18:02:44 netbox-1804 systemd[1]: Started NetBox WSGI Service.
-- Subject: Unit netbox.service has finished start-up


-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--

-- Unit netbox.service has finished starting up.
--
-- The start-up result is RESULT.
May 22 18:02:44 netbox-1804 systemd[2518]: netbox.service: Failed to execute command: No such file or directory
May 22 18:02:44 netbox-1804 systemd[2518]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory


-- Subject: Process /opt/netbox/venv/bin/gunicorn could not be executed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The process /opt/netbox/venv/bin/gunicorn could not be executed and failed.
--

-- The error number returned by this process is 2.
May 22 18:02:44 netbox-1804 systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC
May 22 18:02:44 netbox-1804 sudo[2515]: pam_unix(sudo:session): session closed for user root
May 22 18:02:44 netbox-1804 systemd[1]: netbox.service: Failed with result 'exit-code'.
May 22 18:02:44 netbox-1804 systemd[1]: Started NetBox Request Queue Worker.
-- Subject: Unit netbox-rq.service has finished start-up


-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--

-- Unit netbox-rq.service has finished starting up.
--
-- The start-up result is RESULT.
May 22 18:02:44 netbox-1804 sudo[2532]: netbox-user : TTY=pts/0 ; PWD=/opt/netbox-2.8.4 ; USER=root ; COMMAND=/bin/systemctl enable netbox netbox-rq
May 22 18:02:44 netbox-1804 sudo[2532]: pam_unix(sudo:session): session opened for user root by netbox-user(uid=0)
May 22 18:02:44 netbox-1804 systemd[1]: Reloading.
May 22 18:02:44 netbox-1804 python3[2531]: Traceback (most recent call last):
May 22 18:02:44 netbox-1804 python3[2531]:   File "/opt/netbox/netbox/manage.py", line 8, in <module>
May 22 18:02:44 netbox-1804 python3[2531]:     from django.core.management import execute_from_command_line
May 22 18:02:44 netbox-1804 python3[2531]: ModuleNotFoundError: No module named 'django'
May 22 18:02:44 netbox-1804 sudo[2532]: pam_unix(sudo:session): session closed for user root
May 22 18:02:44 netbox-1804 systemd[1]: netbox-rq.service: Main process exited, code=exited, status=1/FAILURE
May 22 18:02:44 netbox-1804 systemd[1]: netbox-rq.service: Failed with result 'exit-code'.


and on 20.04


netbox-user@netbox-primus:/opt/netbox/venv/bin$ journalctl -xe
-- The job identifier is 8013.
May 22 18:34:48 netbox-primus systemd[3510]: netbox.service: Failed to execute command: No such file or directory
May 22 18:34:48 netbox-primus systemd[3510]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory


-- Subject: Process /opt/netbox/venv/bin/gunicorn could not be executed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The process /opt/netbox/venv/bin/gunicorn could not be executed and failed.
--
-- The error number returned by this process is ERRNO.

May 22 18:34:48 netbox-primus systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC


-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit netbox.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 203.

May 22 18:34:48 netbox-primus systemd[1]: netbox.service: Failed with result 'exit-code'.


-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit netbox.service has entered the 'failed' state with result 'exit-code'.

May 22 18:34:48 netbox-primus python3[3509]: Traceback (most recent call last):
May 22 18:34:48 netbox-primus python3[3509]:   File "/opt/netbox/netbox/manage.py", line 8, in <module>
May 22 18:34:48 netbox-primus python3[3509]:     from django.core.management import execute_from_command_line
May 22 18:34:48 netbox-primus python3[3509]: ModuleNotFoundError: No module named 'django'
May 22 18:34:48 netbox-primus systemd[1]: netbox-rq.service: Main process exited, code=exited, status=1/FAILURE


-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit netbox-rq.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.

May 22 18:34:48 netbox-primus systemd[1]: netbox-rq.service: Failed with result 'exit-code'.


-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit netbox-rq.service has entered the 'failed' state with result 'exit-code'.


Feel like I must be doing something stupid but their is not much to miss in this section https://netbox.readthedocs.io/en/stable/installation/4-http-daemon/

Markku Leiniö

unread,
May 22, 2020, 3:58:28 PM5/22/20
to NetBox
Gunicorn should have been installed in https://netbox.readthedocs.io/en/stable/installation/3-netbox/ at "Set Up Python Environment", especially activating the venv and installing the requirements there. Let us know what happens when you do that.

Markku

Ross Moutell

unread,
May 23, 2020, 2:53:35 AM5/23/20
to NetBox
That has been done. I can't imagine Netbox would test successfully if I had not run the requirements into the venv.

Here are the notes I made for myself during the process. On 18.04 I would use postreqsql10 of course.




sudo apt-get install -y htop tree nfs-common postgresql libpq-dev

sudo systemctl start postgresql@12-main

sudo systemctl enable postgresql@12-main

sudo -u postgres psql

CREATE DATABASE netbox;

CREATE USER netbox WITH PASSWORD '**************';

GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox;

\q

psql -U netbox -W -h localhost netbox

\q

sudo apt-get install -y python3.6 python3-pip python3-venv python3-dev build-essential libxml2-dev libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev redis-server

redis-cli ping

wget https://github.com/netbox-community/netbox/archive/v2.8.4.tar.gz

sudo tar -xzf v2.8.4.tar.gz -C /opt

cd /opt/

sudo ln -s netbox-2.8.4/ netbox

cd /opt/netbox/

sudo groupadd --system netbox

less /etc/group

sudo adduser --system --gid 998 netbox

sudo chown --recursive netbox /opt/netbox/netbox/media/

sudo python3 -m venv /opt/netbox/venv

source venv/bin/activate

sudo -H pip3 install -r requirements.txt


cd netbox/netbox/

sudo cp configuration.example.py configuration.py

sudo nano configuration.py

# Add in allowed hosts.

ALLOWED_HOSTS = ['192.168.0.22', 'netbox-primus', 'netbox-primus.manymachinesonix.net']

Add in DB user and password.

DATABASE = {
    'NAME': 'netbox',          # Database name
    'USER': 'netbox',          # PostgreSQL username
    'PASSWORD': '***********', # PostgreSQL password
    'HOST': 'localhost',       # Database server
    'PORT': '',                # Database port (leave blank for default)
    'CONN_MAX_AGE': 300,       # Max database connection age
}

Exit and save the file.

cd ..

python3 generate_secret_key.py

sudo nano netbox/configuration.py

Add the secret key. Exit and save the file.

SECRET_KEY = '******************************'

cd /opt/netbox/netbox/

sudo python3 manage.py migrate

sudo python3 manage.py createsuperuser

netbox-su

email address

password

sudo python3 manage.py collectstatic --no-input

sudo python3 manage.py runserver 0.0.0.0:8000 --insecure

Visit site on port 8000

Ctrl-C to close.

********SNAPSHOT**********

# Create a csr for a CA

sudo openssl genrsa -out /etc/ssl/private/netbox.key 4096

sudo openssl req -new -key /etc/ssl/private/netbox.key -out /home/netbox-user/netbox.csr

# or a self signed cert

sudo openssl req -x509 -newkey rsa:4096 -keyout /etc/ssl/private/netbox.key -out /etc/ssl/certs/netbox.crt -days 3650 -nodes

# Install Apache

sudo apt-get install -y apache2

# Copy the default config file

sudo cp /opt/netbox/contrib/apache.conf /etc/apache2/sites-available/netbox.conf

# Edit the server name in the file to that of the server.

sudo nano /etc/apache2/sites-available/netbox.conf

sudo a2enmod ssl proxy proxy_http headers

sudo a2ensite netbox

sudo systemctl reload apache2

cd /opt/netbox

sudo cp contrib/gunicorn.py /opt/netbox/gunicorn.py

sudo cp contrib/*.service /etc/systemd/system/

sudo systemctl daemon-reload

sudo systemctl start netbox netbox-rq

sudo systemctl enable netbox netbox-rq

# Look at problems

systemctl status netbox.service

journalctl -xe

Ross Moutell

unread,
May 23, 2020, 2:54:01 AM5/23/20
to NetBox
netbox-user@netbox-primus:/opt/netbox$ cat requirements.txt
Django>=3.0,<3.1
django-cacheops==4.2
django-cors-headers==3.2.1
django-debug-toolbar==2.2
django-filter==2.2.0
django-mptt==0.11.0
django-pglocks==1.0.4
django-prometheus==2.0.0
django-rq==2.3.2
django-tables2==2.3.1
django-taggit==1.2.0
django-taggit-serializer==0.1.7
django-timezone-field==4.0
djangorestframework==3.11.0
drf-yasg[validation]==1.17.1
gunicorn==20.0.4
Jinja2==2.11.1
Markdown==3.2.1
netaddr==0.7.19
Pillow==7.1.1
psycopg2-binary==2.8.5
pycryptodome==3.9.7
PyYAML==5.3.1
redis==3.4.1
svgwrite==1.4
(venv) netbox-user@netbox-primus:/opt/netbox$ sudo -H pip3 install -r requirements.txt
[sudo] password for netbox-user:
Requirement already satisfied: Django<3.1,>=3.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 1)) (3.0.6)
Requirement already satisfied: django-cacheops==4.2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 2)) (4.2)
Requirement already satisfied: django-cors-headers==3.2.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 3)) (3.2.1)
Requirement already satisfied: django-debug-toolbar==2.2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 4)) (2.2)
Requirement already satisfied: django-filter==2.2.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 5)) (2.2.0)
Requirement already satisfied: django-mptt==0.11.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 6)) (0.11.0)
Requirement already satisfied: django-pglocks==1.0.4 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 7)) (1.0.4)
Requirement already satisfied: django-prometheus==2.0.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 8)) (2.0.0)
Requirement already satisfied: django-rq==2.3.2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 9)) (2.3.2)
Requirement already satisfied: django-tables2==2.3.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 10)) (2.3.1)
Requirement already satisfied: django-taggit==1.2.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 11)) (1.2.0)
Requirement already satisfied: django-taggit-serializer==0.1.7 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 12)) (0.1.7)
Requirement already satisfied: django-timezone-field==4.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 13)) (4.0)
Requirement already satisfied: djangorestframework==3.11.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 14)) (3.11.0)
Requirement already satisfied: drf-yasg[validation]==1.17.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 15)) (1.17.1)
Requirement already satisfied: gunicorn==20.0.4 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 16)) (20.0.4)
Requirement already satisfied: Jinja2==2.11.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 17)) (2.11.1)
Requirement already satisfied: Markdown==3.2.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 18)) (3.2.1)
Requirement already satisfied: netaddr==0.7.19 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 19)) (0.7.19)
Requirement already satisfied: Pillow==7.1.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 20)) (7.1.1)
Requirement already satisfied: psycopg2-binary==2.8.5 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 21)) (2.8.5)
Requirement already satisfied: pycryptodome==3.9.7 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 22)) (3.9.7)
Requirement already satisfied: PyYAML==5.3.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 23)) (5.3.1)
Requirement already satisfied: redis==3.4.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 24)) (3.4.1)
Requirement already satisfied: svgwrite==1.4 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 25)) (1.4)
Requirement already satisfied: pytz in /usr/local/lib/python3.8/dist-packages (from Django<3.1,>=3.0->-r requirements.txt (line 1)) (2020.1)
Requirement already satisfied: sqlparse>=0.2.2 in /usr/local/lib/python3.8/dist-packages (from Django<3.1,>=3.0->-r requirements.txt (line 1)) (0.3.1)
Requirement already satisfied: asgiref~=3.2 in /usr/local/lib/python3.8/dist-packages (from Django<3.1,>=3.0->-r requirements.txt (line 1)) (3.2.7)
Requirement already satisfied: funcy<2.0,>=1.8 in /usr/local/lib/python3.8/dist-packages (from django-cacheops==4.2->-r requirements.txt (line 2)) (1.14)
Requirement already satisfied: six>=1.4.0 in /usr/lib/python3/dist-packages (from django-cacheops==4.2->-r requirements.txt (line 2)) (1.14.0)
Requirement already satisfied: django-js-asset in /usr/local/lib/python3.8/dist-packages (from django-mptt==0.11.0->-r requirements.txt (line 6)) (1.2.2)
Requirement already satisfied: prometheus-client>=0.7 in /usr/local/lib/python3.8/dist-packages (from django-prometheus==2.0.0->-r requirements.txt (line 8)) (0.7.1)
Requirement already satisfied: rq>=1.2 in /usr/local/lib/python3.8/dist-packages (from django-rq==2.3.2->-r requirements.txt (line 9)) (1.4.1)
Requirement already satisfied: packaging in /usr/local/lib/python3.8/dist-packages (from drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (20.4)
Requirement already satisfied: ruamel.yaml>=0.15.34 in /usr/local/lib/python3.8/dist-packages (from drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (0.16.10)
Requirement already satisfied: uritemplate>=3.0.0 in /usr/local/lib/python3.8/dist-packages (from drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (3.0.1)
Requirement already satisfied: inflection>=0.3.1 in /usr/local/lib/python3.8/dist-packages (from drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (0.4.0)
Requirement already satisfied: coreapi>=2.3.3 in /usr/local/lib/python3.8/dist-packages (from drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (2.3.3)
Requirement already satisfied: coreschema>=0.0.4 in /usr/local/lib/python3.8/dist-packages (from drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (0.0.4)
Requirement already satisfied: swagger-spec-validator>=2.1.0; extra == "validation" in /usr/local/lib/python3.8/dist-packages (from drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (2.6.0)
Requirement already satisfied: setuptools>=3.0 in /usr/lib/python3/dist-packages (from gunicorn==20.0.4->-r requirements.txt (line 16)) (45.2.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib/python3/dist-packages (from Jinja2==2.11.1->-r requirements.txt (line 17)) (1.1.0)
Requirement already satisfied: click>=5.0 in /usr/lib/python3/dist-packages (from rq>=1.2->django-rq==2.3.2->-r requirements.txt (line 9)) (7.0)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging->drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (2.4.7)
Requirement already satisfied: ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.9" in /usr/local/lib/python3.8/dist-packages (from ruamel.yaml>=0.15.34->drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (0.2.0)
Requirement already satisfied: itypes in /usr/local/lib/python3.8/dist-packages (from coreapi>=2.3.3->drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (1.2.0)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from coreapi>=2.3.3->drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (2.22.0)
Requirement already satisfied: jsonschema in /usr/lib/python3/dist-packages (from swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.17.1->-r requirements.txt (line 15)) (3.2.0)

Markku Leiniö

unread,
May 23, 2020, 3:22:17 AM5/23/20
to NetBox
As you can see from the "/usr/local/lib/..." paths shown in your pip3 install command outputs, your packages have not been installed in the venv but in the system libraries.

What is the reason you are running "sudo -H" instead of just "sudo" when doing the pip3 install? I don't ever use -H so I don't know all the implications of it. Can you do the command again with no -H?

Markku

Markku Leiniö

unread,
May 23, 2020, 3:37:05 AM5/23/20
to NetBox
(Also, I'm not sure how sudo changes the environment i.e. is the venv still "active" under sudo. When the installation instructions are #-prompted I usually run "sudo -i" (to start a new shell), and then run the commands there, activating the venv etc.)

Markku

Ross Moutell

unread,
May 23, 2020, 4:20:28 AM5/23/20
to NetBox
I ran it as sudo because if I don't some parts fail.

(venv) netbox-user@netbox-primus:/opt/netbox$ pip3 install -r requirements.txt
Collecting Django<3.1,>=3.0
  Downloading Django-3.0.6-py3-none-any.whl (7.5 MB)
     |████████████████████████████████| 7.5 MB 5.7 MB/s
Collecting django-cacheops==4.2
  Downloading django_cacheops-4.2-py2.py3-none-any.whl (38 kB)
Collecting django-cors-headers==3.2.1
  Downloading django_cors_headers-3.2.1-py3-none-any.whl (14 kB)
Collecting django-debug-toolbar==2.2
  Downloading django_debug_toolbar-2.2-py3-none-any.whl (198 kB)
     |████████████████████████████████| 198 kB 8.3 MB/s
Collecting django-filter==2.2.0
  Downloading django_filter-2.2.0-py3-none-any.whl (69 kB)
     |████████████████████████████████| 69 kB 3.6 MB/s
Collecting django-mptt==0.11.0
  Downloading django_mptt-0.11.0-py2.py3-none-any.whl (109 kB)
     |████████████████████████████████| 109 kB 8.7 MB/s
Collecting django-pglocks==1.0.4
  Downloading django-pglocks-1.0.4.tar.gz (4.1 kB)
Collecting django-prometheus==2.0.0
  Downloading django_prometheus-2.0.0-py2.py3-none-any.whl (27 kB)
Collecting django-rq==2.3.2
  Downloading django_rq-2.3.2-py2.py3-none-any.whl (45 kB)
     |████████████████████████████████| 45 kB 2.0 MB/s
Collecting django-tables2==2.3.1
  Downloading django_tables2-2.3.1-py2.py3-none-any.whl (90 kB)
     |████████████████████████████████| 90 kB 4.2 MB/s
Collecting django-taggit==1.2.0
  Downloading django_taggit-1.2.0-py3-none-any.whl (45 kB)
     |████████████████████████████████| 45 kB 1.7 MB/s
Collecting django-taggit-serializer==0.1.7
  Downloading django-taggit-serializer-0.1.7.tar.gz (5.6 kB)
Collecting django-timezone-field==4.0
  Downloading django_timezone_field-4.0-py3-none-any.whl (7.6 kB)
Collecting djangorestframework==3.11.0
  Downloading djangorestframework-3.11.0-py3-none-any.whl (911 kB)
     |████████████████████████████████| 911 kB 8.7 MB/s
Collecting drf-yasg[validation]==1.17.1
  Downloading drf_yasg-1.17.1-py2.py3-none-any.whl (1.1 MB)
     |████████████████████████████████| 1.1 MB 9.2 MB/s
Collecting gunicorn==20.0.4
  Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB 3.2 MB/s
Collecting Jinja2==2.11.1
  Downloading Jinja2-2.11.1-py2.py3-none-any.whl (126 kB)
     |████████████████████████████████| 126 kB 8.3 MB/s
Collecting Markdown==3.2.1
  Downloading Markdown-3.2.1-py2.py3-none-any.whl (88 kB)
     |████████████████████████████████| 88 kB 3.7 MB/s
Collecting netaddr==0.7.19
  Downloading netaddr-0.7.19-py2.py3-none-any.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 8.8 MB/s
Collecting Pillow==7.1.1
  Downloading Pillow-7.1.1-cp38-cp38-manylinux1_x86_64.whl (2.1 MB)
     |████████████████████████████████| 2.1 MB 8.6 MB/s
Collecting psycopg2-binary==2.8.5
  Downloading psycopg2_binary-2.8.5-cp38-cp38-manylinux1_x86_64.whl (3.0 MB)
     |████████████████████████████████| 3.0 MB 8.5 MB/s
Collecting pycryptodome==3.9.7
  Downloading pycryptodome-3.9.7-cp38-cp38-manylinux1_x86_64.whl (13.7 MB)
     |████████████████████████████████| 13.7 MB 7.5 MB/s
Collecting PyYAML==5.3.1
  Downloading PyYAML-5.3.1.tar.gz (269 kB)
     |████████████████████████████████| 269 kB 8.2 MB/s
Collecting redis==3.4.1
  Downloading redis-3.4.1-py2.py3-none-any.whl (71 kB)
     |████████████████████████████████| 71 kB 4.2 MB/s
Collecting svgwrite==1.4
  Downloading svgwrite-1.4-py3-none-any.whl (66 kB)
     |████████████████████████████████| 66 kB 2.8 MB/s
Collecting pytz
  Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
     |████████████████████████████████| 510 kB 8.6 MB/s
Collecting sqlparse>=0.2.2
  Downloading sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
     |████████████████████████████████| 40 kB 2.9 MB/s
Collecting asgiref~=3.2
  Downloading asgiref-3.2.7-py2.py3-none-any.whl (19 kB)
Collecting six>=1.4.0
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting funcy<2.0,>=1.8
  Downloading funcy-1.14.tar.gz (548 kB)
     |████████████████████████████████| 548 kB 8.6 MB/s
Collecting django-js-asset
  Downloading django_js_asset-1.2.2-py2.py3-none-any.whl (5.8 kB)
Collecting prometheus-client>=0.7
  Downloading prometheus_client-0.7.1.tar.gz (38 kB)
Collecting rq>=1.2
  Downloading rq-1.4.1-py2.py3-none-any.whl (59 kB)
     |████████████████████████████████| 59 kB 3.4 MB/s
Collecting coreapi>=2.3.3
  Downloading coreapi-2.3.3-py2.py3-none-any.whl (25 kB)
Collecting inflection>=0.3.1
  Downloading inflection-0.4.0-py2.py3-none-any.whl (5.8 kB)
Collecting coreschema>=0.0.4
  Downloading coreschema-0.0.4.tar.gz (10 kB)
Collecting packaging
  Downloading packaging-20.4-py2.py3-none-any.whl (37 kB)
Collecting uritemplate>=3.0.0
  Downloading uritemplate-3.0.1-py2.py3-none-any.whl (15 kB)
Collecting ruamel.yaml>=0.15.34
  Downloading ruamel.yaml-0.16.10-py2.py3-none-any.whl (111 kB)
     |████████████████████████████████| 111 kB 8.4 MB/s
Collecting swagger-spec-validator>=2.1.0; extra == "validation"
  Downloading swagger_spec_validator-2.6.0-py2.py3-none-any.whl (26 kB)
Requirement already satisfied: setuptools>=3.0 in ./venv/lib/python3.8/site-packages (from gunicorn==20.0.4->-r requirements.txt (line 16)) (44.0.0)
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl (32 kB)
Collecting click>=5.0
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
     |████████████████████████████████| 82 kB 728 kB/s
Collecting itypes
  Downloading itypes-1.2.0-py2.py3-none-any.whl (4.8 kB)
Collecting requests
  Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 1.6 MB/s
Collecting pyparsing>=2.0.2
  Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 3.1 MB/s
Collecting ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.9"
  Downloading ruamel.yaml.clib-0.2.0-cp38-cp38-manylinux1_x86_64.whl (578 kB)
     |████████████████████████████████| 578 kB 8.7 MB/s
Collecting jsonschema
  Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
     |████████████████████████████████| 56 kB 2.4 MB/s
Collecting idna<3,>=2.5
  Downloading idna-2.9-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 1.7 MB/s
Collecting chardet<4,>=3.0.2
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 8.6 MB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
     |████████████████████████████████| 157 kB 8.4 MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
     |████████████████████████████████| 126 kB 7.9 MB/s
Collecting pyrsistent>=0.14.0
  Downloading pyrsistent-0.16.0.tar.gz (108 kB)
     |████████████████████████████████| 108 kB 8.8 MB/s
Collecting attrs>=17.4.0
  Downloading attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Building wheels for collected packages: django-pglocks, django-taggit-serializer, PyYAML, funcy, prometheus-client, coreschema, pyrsistent
  Building wheel for django-pglocks (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uu5hftt9/django-pglocks/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uu5hftt9/django-pglocks/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-u5p2cnpx
       cwd: /tmp/pip-install-uu5hftt9/django-pglocks/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for django-pglocks
  Running setup.py clean for django-pglocks
  Building wheel for django-taggit-serializer (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uu5hftt9/django-taggit-serializer/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uu5hftt9/django-taggit-serializer/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-s_3r8lwp
       cwd: /tmp/pip-install-uu5hftt9/django-taggit-serializer/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for django-taggit-serializer
  Running setup.py clean for django-taggit-serializer
  Building wheel for PyYAML (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uu5hftt9/PyYAML/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uu5hftt9/PyYAML/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-n636krs4
       cwd: /tmp/pip-install-uu5hftt9/PyYAML/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for PyYAML
  Running setup.py clean for PyYAML
  Building wheel for funcy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uu5hftt9/funcy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uu5hftt9/funcy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-bisjleq9
       cwd: /tmp/pip-install-uu5hftt9/funcy/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for funcy
  Running setup.py clean for funcy
  Building wheel for prometheus-client (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uu5hftt9/prometheus-client/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uu5hftt9/prometheus-client/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-6z10kbaa
       cwd: /tmp/pip-install-uu5hftt9/prometheus-client/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for prometheus-client
  Running setup.py clean for prometheus-client
  Building wheel for coreschema (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uu5hftt9/coreschema/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uu5hftt9/coreschema/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-sstsfpth
       cwd: /tmp/pip-install-uu5hftt9/coreschema/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for coreschema
  Running setup.py clean for coreschema
  Building wheel for pyrsistent (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uu5hftt9/pyrsistent/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uu5hftt9/pyrsistent/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-edua0d_c
       cwd: /tmp/pip-install-uu5hftt9/pyrsistent/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for pyrsistent
  Running setup.py clean for pyrsistent
Failed to build django-pglocks django-taggit-serializer PyYAML funcy prometheus-client coreschema pyrsistent
Installing collected packages: pytz, sqlparse, asgiref, Django, redis, six, funcy, django-cacheops, django-cors-headers, django-debug-toolbar, django-filter, django-js-asset, django-mptt, django-pglocks, prometheus-client, django-prometheus, click, rq, django-rq, django-tables2, django-taggit, django-taggit-serializer, django-timezone-field, djangorestframework, itypes, uritemplate, MarkupSafe, Jinja2, coreschema, idna, chardet, certifi, urllib3, requests, coreapi, inflection, pyparsing, packaging, ruamel.yaml.clib, ruamel.yaml, PyYAML, pyrsistent, attrs, jsonschema, swagger-spec-validator, drf-yasg, gunicorn, Markdown, netaddr, Pillow, psycopg2-binary, pycryptodome, svgwrite
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/opt/netbox/venv/lib/python3.8/site-packages/pytz-2020.1.dist-info'
Consider using the `--user` option or check the permissions.

Ross Moutell

unread,
May 23, 2020, 4:22:57 AM5/23/20
to NetBox
The -H was for another error that appeared but I can't recreate it right now. The error told me to try the -H option.

Ross Moutell

unread,
May 23, 2020, 4:29:39 AM5/23/20
to NetBox
Looking at man sudo I think -H might be part of the problem. I will run through the process again later without -H and post the warning / error that appears.

Markku Leiniö

unread,
May 23, 2020, 4:35:04 AM5/23/20
to NetBox
Can you try what I have used = "sudo -i":
sudo -i
cd /opt/netbox
rm -rf venv (to start from scratch)
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt

Markku

Ross Moutell

unread,
May 23, 2020, 4:45:57 AM5/23/20
to NetBox
Still getting two errors. This is on 20.04 though. I will go through the whole process from scratch again later with 18.04 and 20.04

(venv) netbox-user@netbox-primus:/opt/netbox$ sudo -i
[sudo] password for netbox-user:
root@netbox-primus:~# cd /opt/netbox
root@netbox-primus:/opt/netbox# rm -rf venv
root@netbox-primus:/opt/netbox# python3 -m venv venv
root@netbox-primus:/opt/netbox# source venv/bin/activate
(venv) root@netbox-primus:/opt/netbox# pip3 install -r requirements.txt
Collecting Django<3.1,>=3.0
  Using cached Django-3.0.6-py3-none-any.whl (7.5 MB)
Collecting django-cacheops==4.2
  Using cached django_cacheops-4.2-py2.py3-none-any.whl (38 kB)
Collecting django-cors-headers==3.2.1
  Using cached django_cors_headers-3.2.1-py3-none-any.whl (14 kB)
Collecting django-debug-toolbar==2.2
  Using cached django_debug_toolbar-2.2-py3-none-any.whl (198 kB)
Collecting django-filter==2.2.0
  Using cached django_filter-2.2.0-py3-none-any.whl (69 kB)
Collecting django-mptt==0.11.0
  Using cached django_mptt-0.11.0-py2.py3-none-any.whl (109 kB)
Processing /root/.cache/pip/wheels/8f/31/50/db3005c21f606ac7475866d29fb47b69614457688f7ad0c9ac/django_pglocks-1.0.4-py3-none-any.whl
Collecting django-prometheus==2.0.0
  Using cached django_prometheus-2.0.0-py2.py3-none-any.whl (27 kB)
Collecting django-rq==2.3.2
  Using cached django_rq-2.3.2-py2.py3-none-any.whl (45 kB)
Collecting django-tables2==2.3.1
  Using cached django_tables2-2.3.1-py2.py3-none-any.whl (90 kB)
Collecting django-taggit==1.2.0
  Using cached django_taggit-1.2.0-py3-none-any.whl (45 kB)
Processing /root/.cache/pip/wheels/71/f0/6c/6e990b5740b83eb688afa51271f76798d836ff699a76b1afd9/django_taggit_serializer-0.1.7-py2.py3-none-any.whl
Collecting django-timezone-field==4.0
  Using cached django_timezone_field-4.0-py3-none-any.whl (7.6 kB)
Collecting djangorestframework==3.11.0
  Using cached djangorestframework-3.11.0-py3-none-any.whl (911 kB)
Collecting drf-yasg[validation]==1.17.1
  Using cached drf_yasg-1.17.1-py2.py3-none-any.whl (1.1 MB)
Collecting gunicorn==20.0.4
  Using cached gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
Collecting Jinja2==2.11.1
  Using cached Jinja2-2.11.1-py2.py3-none-any.whl (126 kB)
Collecting Markdown==3.2.1
  Using cached Markdown-3.2.1-py2.py3-none-any.whl (88 kB)
Collecting netaddr==0.7.19
  Using cached netaddr-0.7.19-py2.py3-none-any.whl (1.6 MB)
Collecting Pillow==7.1.1
  Using cached Pillow-7.1.1-cp38-cp38-manylinux1_x86_64.whl (2.1 MB)
Collecting psycopg2-binary==2.8.5
  Using cached psycopg2_binary-2.8.5-cp38-cp38-manylinux1_x86_64.whl (3.0 MB)
Collecting pycryptodome==3.9.7
  Using cached pycryptodome-3.9.7-cp38-cp38-manylinux1_x86_64.whl (13.7 MB)

Collecting PyYAML==5.3.1
  Downloading PyYAML-5.3.1.tar.gz (269 kB)
     |████████████████████████████████| 269 kB 5.8 MB/s
Collecting redis==3.4.1
  Using cached redis-3.4.1-py2.py3-none-any.whl (71 kB)
Collecting svgwrite==1.4
  Using cached svgwrite-1.4-py3-none-any.whl (66 kB)
Collecting pytz
  Using cached pytz-2020.1-py2.py3-none-any.whl (510 kB)
Collecting sqlparse>=0.2.2
  Using cached sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
Collecting asgiref~=3.2
  Using cached asgiref-3.2.7-py2.py3-none-any.whl (19 kB)

Collecting six>=1.4.0
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Processing /root/.cache/pip/wheels/85/46/45/fe0554d6310d4198baa18d48f080b5da2a53afe7872a6dc98d/funcy-1.14-py2.py3-none-any.whl
Collecting django-js-asset
  Using cached django_js_asset-1.2.2-py2.py3-none-any.whl (5.8 kB)
Processing /root/.cache/pip/wheels/a7/f7/eb/1abd6e61e5a9ecbc7d05a2a84c045b99cb30a0d3e760dab497/prometheus_client-0.7.1-py3-none-any.whl
Collecting rq>=1.2
  Using cached rq-1.4.1-py2.py3-none-any.whl (59 kB)
Collecting inflection>=0.3.1
  Using cached inflection-0.4.0-py2.py3-none-any.whl (5.8 kB)
Collecting coreapi>=2.3.3
  Using cached coreapi-2.3.3-py2.py3-none-any.whl (25 kB)
Processing /root/.cache/pip/wheels/37/21/45/2ce3dd0189e3d2fb7a325b9d3e6491acb7882c8275466d5401/coreschema-0.0.4-py3-none-any.whl
Collecting uritemplate>=3.0.0
  Using cached uritemplate-3.0.1-py2.py3-none-any.whl (15 kB)
Collecting ruamel.yaml>=0.15.34
  Using cached ruamel.yaml-0.16.10-py2.py3-none-any.whl (111 kB)
Collecting packaging
  Using cached packaging-20.4-py2.py3-none-any.whl (37 kB)
Collecting swagger-spec-validator>=2.1.0; extra == "validation"
  Using cached swagger_spec_validator-2.6.0-py2.py3-none-any.whl (26 kB)

Requirement already satisfied: setuptools>=3.0 in ./venv/lib/python3.8/site-packages (from gunicorn==20.0.4->-r requirements.txt (line 16)) (44.0.0)
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl (32 kB)
Collecting click>=5.0
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
     |████████████████████████████████| 82 kB 446 kB/s
Collecting itypes
  Using cached itypes-1.2.0-py2.py3-none-any.whl (4.8 kB)

Collecting requests
  Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 3.0 MB/s
Collecting ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.9"
  Using cached ruamel.yaml.clib-0.2.0-cp38-cp38-manylinux1_x86_64.whl (578 kB)
Collecting pyparsing>=2.0.2
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)

Collecting jsonschema
  Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
     |████████████████████████████████| 56 kB 2.4 MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
     |████████████████████████████████| 126 kB 8.1 MB/s
Collecting idna<3,>=2.5
  Downloading idna-2.9-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 3.2 MB/s
Collecting chardet<4,>=3.0.2
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 8.7 MB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
     |████████████████████████████████| 157 kB 8.3 MB/s
Collecting pyrsistent>=0.14.0
  Downloading pyrsistent-0.16.0.tar.gz (108 kB)
     |████████████████████████████████| 108 kB 8.6 MB/s
Collecting attrs>=17.4.0
  Downloading attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Building wheels for collected packages: PyYAML, pyrsistent

  Building wheel for PyYAML (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox-2.8.4/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-viefh55y/PyYAML/setup.py'"'"'; __file__='"'"'/tmp/pip-install-viefh55y/PyYAML/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-04dvq7q2
       cwd: /tmp/pip-install-viefh55y/PyYAML/

  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for PyYAML
  Running setup.py clean for PyYAML
  Building wheel for pyrsistent (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/netbox-2.8.4/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-viefh55y/pyrsistent/setup.py'"'"'; __file__='"'"'/tmp/pip-install-viefh55y/pyrsistent/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-j1x79527
       cwd: /tmp/pip-install-viefh55y/pyrsistent/

  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
 
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for pyrsistent
  Running setup.py clean for pyrsistent
Failed to build PyYAML pyrsistent
Installing collected packages: pytz, sqlparse, asgiref, Django, six, redis, funcy, django-cacheops, django-cors-headers, django-debug-toolbar, django-filter, django-js-asset, django-mptt, django-pglocks, prometheus-client, django-prometheus, click, rq, django-rq, django-tables2, django-taggit, django-taggit-serializer, django-timezone-field, djangorestframework, inflection, uritemplate, itypes, urllib3, idna, chardet, certifi, requests, MarkupSafe, Jinja2, coreschema, coreapi, ruamel.yaml.clib, ruamel.yaml, pyparsing, packaging, pyrsistent, attrs, jsonschema, PyYAML, swagger-spec-validator, drf-yasg, gunicorn, Markdown, netaddr, Pillow, psycopg2-binary, pycryptodome, svgwrite
    Running setup.py install for pyrsistent ... done
    Running setup.py install for PyYAML ... done
Successfully installed Django-3.0.6 Jinja2-2.11.1 Markdown-3.2.1 MarkupSafe-1.1.1 Pillow-7.1.1 PyYAML-5.3.1 asgiref-3.2.7 attrs-19.3.0 certifi-2020.4.5.1 chardet-3.0.4 click-7.1.2 coreapi-2.3.3 coreschema-0.0.4 django-cacheops-4.2 django-cors-headers-3.2.1 django-debug-toolbar-2.2 django-filter-2.2.0 django-js-asset-1.2.2 django-mptt-0.11.0 django-pglocks-1.0.4 django-prometheus-2.0.0 django-rq-2.3.2 django-tables2-2.3.1 django-taggit-1.2.0 django-taggit-serializer-0.1.7 django-timezone-field-4.0 djangorestframework-3.11.0 drf-yasg-1.17.1 funcy-1.14 gunicorn-20.0.4 idna-2.9 inflection-0.4.0 itypes-1.2.0 jsonschema-3.2.0 netaddr-0.7.19 packaging-20.4 prometheus-client-0.7.1 psycopg2-binary-2.8.5 pycryptodome-3.9.7 pyparsing-2.4.7 pyrsistent-0.16.0 pytz-2020.1 redis-3.4.1 requests-2.23.0 rq-1.4.1 ruamel.yaml-0.16.10 ruamel.yaml.clib-0.2.0 six-1.15.0 sqlparse-0.3.1 svgwrite-1.4 swagger-spec-validator-2.6.0 uritemplate-3.0.1 urllib3-1.25.9
(venv) root@netbox-primus:/opt/netbox#

Markku Leiniö

unread,
May 23, 2020, 5:59:11 AM5/23/20
to NetBox
I have encountered some bdist_wheel errors myself as well (don't remember specific situations), but they weren't doing any harm in those cases. I believe one way to avoid those is to run "pip3 install wheel" before installing the requirements.

Markku

Markku Leiniö

unread,
May 23, 2020, 6:47:21 AM5/23/20
to NetBox
I just installed Ubuntu 20.04 from scratch, and installed NetBox following the instructions in the documentation (running the commands as root, the shell initiated by "sudo -i"). The only deviation was this:

root@ubuntutest:/opt/netbox# groupadd --system netbox
root@ubuntutest:/opt/netbox# adduser --system --gid netbox netbox
Value "netbox" invalid for option gid (number expected)
...
root@ubuntutest:/opt/netbox# grep netbox /etc/group
netbox:x:998:
root@ubuntutest:/opt/netbox# adduser --system --gid 998 netbox
Adding system user `netbox' (UID 114) ...
Adding new user `netbox' (UID 114) with group `netbox' ...
Creating home directory `/home/netbox' ...
root@ubuntutest:/opt/netbox#

I didn't install wheel manually, and I got the bdist_wheel errors as well while installing the requirements. But NetBox seems to work fine.

Markku

Ross Moutell

unread,
May 23, 2020, 7:21:55 AM5/23/20
to NetBox
I have it working as well now. Thank you for your information and assistance. Now onto the DB migration.

Jason Creviston

unread,
Jul 17, 2020, 3:54:49 PM7/17/20
to NetBox
I also had the gunicorn issue with Ubuntu 20.04 (and the the --gid issue that Markku mentioned, which using the '998 netbox' resolves)

with gunicorn, I did this:

sudo which gunicorn
with the output of /usr/local/bin/gunicorn

so I made sure I was in the /opt/netbox/venv/bin folder, then added a symlink:
sudo ln -s /usr/local/bin/gunicorn gunicorn

Markku Leiniö

unread,
Jul 18, 2020, 1:39:47 AM7/18/20
to NetBox
Gunicorn is listed in requirements.txt so it should have been installed correctly in the Set Up Python Environment phase. What error messages you got if you were forced to make that manual link?

Markku
Reply all
Reply to author
Forward
0 new messages