netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.04k stars 2.57k forks source link

Netbox w/ NAPALM errors out on upgrade on CentOS 8 due to ModuleNotFoundError: No module named 'setuptools_rust' #5774

Closed ggiesen closed 3 years ago

ggiesen commented 3 years ago

Environment

Steps to Reproduce

  1. Add napalm to local_requirements.txt
  2. Run upgrade.sh

Expected Behavior

Upgrade netbox

Collecting cryptography>=2.5 (from paramiko>=2.6.0->napalm->-r local_requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/f8/04/51dc8a4ccb37b69a4e165a94837f70653b0b6ca49a6346361062b1f6bb09/cryptography-3.4.3.tar.gz
    Complete output from command python setup.py egg_info:

            =============================DEBUG ASSISTANCE==========================
            If you are seeing an error here please try the following to
            successfully install cryptography:

            Upgrade to the latest pip and try again. This will fix errors for most
            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
            =============================DEBUG ASSISTANCE==========================

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-kswj99rt/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-kswj99rt/cryptography/
You are using pip version 9.0.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
ggiesen commented 3 years ago

This is not explicitly a Netbox issue, just documenting the problem with cryptography 3.4 on distributions with older pip versions. See github/pyca/cryptography#5753.

Temporary fix is to add the following to local_requirements.txt:

cryptography<3.4

ggiesen commented 3 years ago

If anyone has any better fixes, please add them here. Closing the issue.

jeremystretch commented 3 years ago

Did you try upgrading pip as the error message suggests?

ggiesen commented 3 years ago

Yes, I was leary about overwriting my system's pip package, but either way it did not work.

I also tried installing the rust and cargo packages.

jeremystretch commented 3 years ago

The virtual environment uses its own copy of pip, which can be a different version from the system installation. Did you upgrade the right one? You need to do pip install -U pip with the virtual environment active.

ggiesen commented 3 years ago

$ cd /opt/netbox $ source venv/bin/activate (venv) [user@host netbox]$ pip install -U pip

Cache entry deserialization failed, entry ignored
Collecting pip
  Using cached https://files.pythonhosted.org/packages/fe/ef/60d7ba03b5c442309ef42e7d69959f73aacccd0d86008362a681c4698e83/pip-21.0.1-py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
Successfully installed pip-21.0.1

(venv) [user@host netbox]$ deactivate

[user@host netbox] ./upgrade.sh

Removing old virtual environment...
Creating a new virtual environment at /opt/netbox-2.10.4/venv...
Installing Python system packages (pip3 install wheel)...
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/65/63/39d04c74222770ed1589c0eaba06c05891801219272420b40311cd60c880/wheel-0.36.2-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.36.2
You are using pip version 9.0.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Installing core dependencies (pip3 install -r requirements.txt)...
Collecting Django==3.1.3 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/7f/17/16267e782a30ea2ce08a9a452c1db285afb0ff226cfe3753f484d3d65662/Django-3.1.3-py3-none-any.whl (7.8MB)
    100% |████████████████████████████████| 7.8MB 170kB/s
Collecting django-cacheops==5.1 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/5d/0c/530f4f32e770c1f0df3ecc988f97ef548ae59ce5a49caae8bcad96afcaec/django_cacheops-5.1-py2.py3-none-any.whl
Collecting django-cors-headers==3.5.0 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/51/99/41898d5eddb68bc5545c08f5315e00d6036cc6f1aba5fd824042dd1b04ea/django_cors_headers-3.5.0-py3-none-any.whl
Collecting django-debug-toolbar==3.1.1 (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/22/14/864c8805134fa25a8165f895c630cdd08d8ae4dd2d3557878624a9f686d2/django_debug_toolbar-3.1.1-py3-none-any.whl (197kB)
    100% |████████████████████████████████| 204kB 5.2MB/s
Collecting django-filter==2.4.0 (from -r requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/71/2b/b2fe483c3095b6222725dd05f9ad9e6ed6cb7347c154fdbd80238d36f1a8/django_filter-2.4.0-py3-none-any.whl (73kB)
    100% |████████████████████████████████| 81kB 10.6MB/s
Collecting django-mptt==0.11.0 (from -r requirements.txt (line 6))
  Downloading https://files.pythonhosted.org/packages/83/86/78a64e1aa72dc6156a1a4f1f830564c932b0900460607def7ccd56a1df80/django_mptt-0.11.0-py2.py3-none-any.whl (109kB)
    100% |████████████████████████████████| 112kB 8.4MB/s
Collecting django-pglocks==1.0.4 (from -r requirements.txt (line 7))
  Downloading https://files.pythonhosted.org/packages/59/76/2c7d104151316077dcaa103e1d5652ded6c32798c8d706570fb7b48385cb/django-pglocks-1.0.4.tar.gz
Collecting django-prometheus==2.1.0 (from -r requirements.txt (line 8))
  Downloading https://files.pythonhosted.org/packages/9b/1b/af5e3c82da897618c90836e7ff3c17f6c3f1dfb82ba33cc20815b2a1f8be/django_prometheus-2.1.0-py2.py3-none-any.whl
Collecting django-rq==2.4.0 (from -r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/53/bb/fb8306b3cba7f6cbae57a1f4d17c3abd4aeb767c1febf97cf1d38d3c724f/django_rq-2.4.0-py2.py3-none-any.whl (46kB)
    100% |████████████████████████████████| 51kB 10.3MB/s
Collecting django-tables2==2.3.3 (from -r requirements.txt (line 10))
  Downloading https://files.pythonhosted.org/packages/dd/1d/27bcbfe4dc80c2e38ee80f2d2a35555a00b44731f6155c60a214a4494490/django_tables2-2.3.3-py2.py3-none-any.whl (91kB)
    100% |████████████████████████████████| 92kB 7.3MB/s
Collecting django-taggit==1.3.0 (from -r requirements.txt (line 11))
  Downloading https://files.pythonhosted.org/packages/56/3e/dde2d7151bc0c4ac65d225e611a85e54a897c551507e8eca2c06a083f3f4/django_taggit-1.3.0-py3-none-any.whl (45kB)
    100% |████████████████████████████████| 51kB 10.5MB/s
Collecting django-timezone-field==4.0 (from -r requirements.txt (line 12))
  Downloading https://files.pythonhosted.org/packages/b3/23/ac06d9dcc9450b8ed51a7f861630b5ae4c1779c53401c83703fb87fbef39/django_timezone_field-4.0-py3-none-any.whl
Collecting djangorestframework==3.12.2 (from -r requirements.txt (line 13))
  Downloading https://files.pythonhosted.org/packages/8e/42/4cd19938181a912150e55835109b1933be26b776f3d4fb186491968dc41d/djangorestframework-3.12.2-py3-none-any.whl (957kB)
    100% |████████████████████████████████| 962kB 1.3MB/s
Collecting drf-yasg[validation]==1.20.0 (from -r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/fc/5c/4584321c7a7fd85429f73fd4c3406b09309e3a071e250177739384a4ab48/drf_yasg-1.20.0-py2.py3-none-any.whl (1.6MB)
    100% |████████████████████████████████| 1.6MB 824kB/s
Collecting gunicorn==20.0.4 (from -r requirements.txt (line 15))
  Downloading https://files.pythonhosted.org/packages/69/ca/926f7cd3a2014b16870086b2d0fdc84a9e49473c68a8dff8b57f7c156f43/gunicorn-20.0.4-py2.py3-none-any.whl (77kB)
    100% |████████████████████████████████| 81kB 10.1MB/s
Collecting Jinja2==2.11.2 (from -r requirements.txt (line 16))
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl (125kB)
    100% |████████████████████████████████| 133kB 7.8MB/s
Collecting Markdown==3.3.3 (from -r requirements.txt (line 17))
  Downloading https://files.pythonhosted.org/packages/ac/ef/24a91ca96efa0d7802dffb83ccc7a3c677027bea19ec3c9ee80be740408e/Markdown-3.3.3-py3-none-any.whl (96kB)
    100% |████████████████████████████████| 102kB 9.4MB/s
Collecting netaddr==0.8.0 (from -r requirements.txt (line 18))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/ff/cd/9cdfea8fc45c56680b798db6a55fa60a22e2d3d3ccf54fc729d083b50ce4/netaddr-0.8.0-py2.py3-none-any.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 675kB/s
Collecting Pillow==8.0.1 (from -r requirements.txt (line 19))
  Downloading https://files.pythonhosted.org/packages/5f/19/d4c25111d36163698396f93c363114cf1cddbacb24744f6612f25b6aa3d0/Pillow-8.0.1-cp36-cp36m-manylinux1_x86_64.whl (2.2MB)
    100% |████████████████████████████████| 2.2MB 577kB/s
Collecting psycopg2-binary==2.8.6 (from -r requirements.txt (line 20))
  Downloading https://files.pythonhosted.org/packages/f2/1b/720b36697158113ca1b2221a8e96a470088ccf3770d182214689d1a96a07/psycopg2_binary-2.8.6-cp36-cp36m-manylinux1_x86_64.whl (3.0MB)
    100% |████████████████████████████████| 3.0MB 431kB/s
Collecting pycryptodome==3.9.9 (from -r requirements.txt (line 21))
  Downloading https://files.pythonhosted.org/packages/2b/6f/7e38d7c97fbbc3987539c804282c33f56b6b07381bf2390deead696440c5/pycryptodome-3.9.9-cp36-cp36m-manylinux1_x86_64.whl (13.7MB)
    100% |████████████████████████████████| 13.7MB 94kB/s
Collecting PyYAML==5.3.1 (from -r requirements.txt (line 22))
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz (269kB)
    100% |████████████████████████████████| 276kB 3.5MB/s
Collecting svgwrite==1.4 (from -r requirements.txt (line 23))
  Downloading https://files.pythonhosted.org/packages/1c/85/1dc25b36c3ac4f3fe285d33065fc0f2ea7bdfb9209d6369e01a3e8ef6252/svgwrite-1.4-py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 9.6MB/s
Collecting asgiref<4,>=3.2.10 (from Django==3.1.3->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/89/49/5531992efc62f9c6d08a7199dc31176c8c60f7b2548c6ef245f96f29d0d9/asgiref-3.3.1-py3-none-any.whl
Collecting pytz (from Django==3.1.3->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/70/94/784178ca5dd892a98f113cdd923372024dc04b8d40abe77ca76b5fb90ca6/pytz-2021.1-py2.py3-none-any.whl (510kB)
    100% |████████████████████████████████| 512kB 2.4MB/s
Collecting sqlparse>=0.2.2 (from Django==3.1.3->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/14/05/6e8eb62ca685b10e34051a80d7ea94b7137369d8c0be5c3b9d9b6e3f5dae/sqlparse-0.4.1-py3-none-any.whl (42kB)
    100% |████████████████████████████████| 51kB 11.1MB/s
Collecting six>=1.4.0 (from django-cacheops==5.1->-r requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting redis>=3.0.0 (from django-cacheops==5.1->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/a7/7c/24fb0511df653cf1a5d938d8f5d19802a88cef255706fdda242ff97e91b7/redis-3.5.3-py2.py3-none-any.whl (72kB)
    100% |████████████████████████████████| 81kB 10.1MB/s
Collecting funcy<2.0,>=1.8 (from django-cacheops==5.1->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/66/89/479de0afbbfb98d1c4b887936808764627300208bb771fcd823403645a36/funcy-1.15-py2.py3-none-any.whl
Collecting django-js-asset (from django-mptt==0.11.0->-r requirements.txt (line 6))
  Downloading https://files.pythonhosted.org/packages/aa/2d/98089cf51c8e83bc70723021390b94a3638a4a0ce30a47e2e70476b2095d/django_js_asset-1.2.2-py2.py3-none-any.whl
Collecting prometheus-client>=0.7 (from django-prometheus==2.1.0->-r requirements.txt (line 8))
  Downloading https://files.pythonhosted.org/packages/f4/7e/ef341c67ed43ad2e39633a35c28b77bc555f9572f4df4fee11c2b467db00/prometheus_client-0.9.0-py2.py3-none-any.whl (53kB)
    100% |████████████████████████████████| 61kB 10.7MB/s
Collecting rq>=1.2 (from django-rq==2.4.0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/2e/47/a04457e5ff635d85af9dba41255ba3b23bf97c894c38967ceae0f7652611/rq-1.7.0-py2.py3-none-any.whl (62kB)
    100% |████████████████████████████████| 71kB 10.5MB/s
Collecting packaging (from drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/3e/89/7ea760b4daa42653ece2380531c90f64788d979110a2ab51049d92f408af/packaging-20.9-py2.py3-none-any.whl (40kB)
    100% |████████████████████████████████| 40kB 9.2MB/s
Collecting uritemplate>=3.0.0 (from drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/bf/0c/60d82c077998feb631608dca3cc1fe19ac074e772bf0c24cf409b977b815/uritemplate-3.0.1-py2.py3-none-any.whl
Collecting inflection>=0.3.1 (from drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/59/91/aa6bde563e0085a02a435aa99b49ef75b0a4b062635e606dab23ce18d720/inflection-0.5.1-py2.py3-none-any.whl
Collecting ruamel.yaml>=0.15.34 (from drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/7e/39/186f14f3836ac5d2a6a042c8de69988770e8b9abb537610edc429e4914aa/ruamel.yaml-0.16.12-py2.py3-none-any.whl (111kB)
    100% |████████████████████████████████| 112kB 8.3MB/s
Collecting coreapi>=2.3.3 (from drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/fc/3a/9dedaad22962770edd334222f2b3c3e7ad5e1c8cab1d6a7992c30329e2e5/coreapi-2.3.3-py2.py3-none-any.whl
Collecting coreschema>=0.0.4 (from drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/93/08/1d105a70104e078718421e6c555b8b293259e7fc92f7e9a04869947f198f/coreschema-0.0.4.tar.gz
Collecting swagger-spec-validator>=2.1.0; extra == "validation" (from drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/09/de/e78cefbf5838b434b63a789264b79821cb2267f1498fbed23ef8590133e4/swagger_spec_validator-2.7.3-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=3.0 in ./venv/lib/python3.6/site-packages (from gunicorn==20.0.4->-r requirements.txt (line 15))
Collecting MarkupSafe>=0.23 (from Jinja2==2.11.2->-r requirements.txt (line 16))
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting importlib-metadata; python_version < "3.8" (from Markdown==3.3.3->-r requirements.txt (line 17))
  Downloading https://files.pythonhosted.org/packages/f3/ed/da40116a204abb5c4dd1d929346d33e0d29cedb2cedd18ea98f0385dcd92/importlib_metadata-3.4.0-py3-none-any.whl
Collecting importlib-resources; python_version < "3.7" (from netaddr==0.8.0->-r requirements.txt (line 18))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/82/70/7bf5f275a738629a7252c30c8461502d3658a75363db9f4f88ddbeb9eeac/importlib_resources-5.1.0-py3-none-any.whl
Collecting click>=5.0.0 (from rq>=1.2->django-rq==2.4.0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl (82kB)
    100% |████████████████████████████████| 92kB 9.8MB/s
Collecting pyparsing>=2.0.2 (from packaging->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl (67kB)
    100% |████████████████████████████████| 71kB 9.6MB/s
Collecting ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.9" (from ruamel.yaml>=0.15.34->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/88/ff/ec25dc01ef04232a9e68ff18492e37dfa01f1f58172e702ad4f38536d41b/ruamel.yaml.clib-0.2.2-cp36-cp36m-manylinux1_x86_64.whl (549kB)
    100% |████████████████████████████████| 552kB 2.1MB/s
Collecting itypes (from coreapi>=2.3.3->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/3f/bb/3bd99c7cd34d4a123b2903e16da364f6d2078b1c3a3530a8ad105c668104/itypes-1.2.0-py2.py3-none-any.whl
Collecting requests (from coreapi>=2.3.3->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/29/c1/24814557f1d22c56d50280771a17307e6bf87b70727d975fd6b2ce6b014a/requests-2.25.1-py2.py3-none-any.whl (61kB)
    100% |████████████████████████████████| 61kB 9.5MB/s
Collecting jsonschema (from swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/c5/8f/51e89ce52a085483359217bc72cdbf6e75ee595d5b1d4b5ade40c7e018b8/jsonschema-3.2.0-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 9.9MB/s
Collecting zipp>=0.5 (from importlib-metadata; python_version < "3.8"->Markdown==3.3.3->-r requirements.txt (line 17))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/41/ad/6a4f1a124b325618a7fb758b885b68ff7b058eec47d9220a12ab38d90b1f/zipp-3.4.0-py3-none-any.whl
Collecting typing-extensions>=3.6.4; python_version < "3.8" (from importlib-metadata; python_version < "3.8"->Markdown==3.3.3->-r requirements.txt (line 17))
  Downloading https://files.pythonhosted.org/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl
Collecting urllib3<1.27,>=1.21.1 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/23/fc/8a49991f7905261f9ca9df5aa9b58363c3c821ce3e7f671895442b7100f2/urllib3-1.26.3-py2.py3-none-any.whl (137kB)
    100% |████████████████████████████████| 143kB 6.9MB/s
Collecting idna<3,>=2.5 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 9.4MB/s
Collecting chardet<5,>=3.0.2 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/19/c7/fa589626997dd07bd87d9269342ccb74b1720384a4d739a1872bd84fbe68/chardet-4.0.0-py2.py3-none-any.whl (178kB)
    100% |████████████████████████████████| 184kB 5.3MB/s
Collecting certifi>=2017.4.17 (from requests->coreapi>=2.3.3->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/5e/a0/5f06e1e1d463903cf0c0eebeb751791119ed7a4b3737fdc9a77f1cdfb51f/certifi-2020.12.5-py2.py3-none-any.whl (147kB)
    100% |████████████████████████████████| 153kB 6.1MB/s
Collecting attrs>=17.4.0 (from jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/c3/aa/cb45262569fcc047bf070b5de61813724d6726db83259222cd7b4c79821a/attrs-20.3.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 9.6MB/s
Collecting pyrsistent>=0.14.0 (from jsonschema->swagger-spec-validator>=2.1.0; extra == "validation"->drf-yasg[validation]==1.20.0->-r requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/4d/70/fd441df751ba8b620e03fd2d2d9ca902103119616f0f6cc42e6405035062/pyrsistent-0.17.3.tar.gz (106kB)
    100% |████████████████████████████████| 112kB 7.7MB/s
Building wheels for collected packages: django-pglocks, PyYAML, coreschema, pyrsistent
  Running setup.py bdist_wheel for django-pglocks ... done
  Stored in directory: /root/.cache/pip/wheels/52/36/e4/91f6930d10b2d715454ec59ded09c9e9af7b667ef557fb19ee
  Running setup.py bdist_wheel for PyYAML ... done
  Stored in directory: /root/.cache/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd
  Running setup.py bdist_wheel for coreschema ... done
  Stored in directory: /root/.cache/pip/wheels/10/7b/ba/04fcd6b33e6123ca11a5f5ab56decb1a2d87ced028377a1377
  Running setup.py bdist_wheel for pyrsistent ... done
  Stored in directory: /root/.cache/pip/wheels/f0/b8/de/b593ad311be4eb458499d100db081e453576032272398b7ddc
Successfully built django-pglocks PyYAML coreschema pyrsistent
Installing collected packages: asgiref, pytz, sqlparse, 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-timezone-field, djangorestframework, pyparsing, packaging, uritemplate, inflection, ruamel.yaml.clib, ruamel.yaml, itypes, urllib3, idna, chardet, certifi, requests, MarkupSafe, Jinja2, coreschema, coreapi, PyYAML, attrs, pyrsistent, zipp, typing-extensions, importlib-metadata, jsonschema, swagger-spec-validator, drf-yasg, gunicorn, Markdown, importlib-resources, netaddr, Pillow, psycopg2-binary, pycryptodome, svgwrite
Successfully installed Django-3.1.3 Jinja2-2.11.2 Markdown-3.3.3 MarkupSafe-1.1.1 Pillow-8.0.1 PyYAML-5.3.1 asgiref-3.3.1 attrs-20.3.0 certifi-2020.12.5 chardet-4.0.0 click-7.1.2 coreapi-2.3.3 coreschema-0.0.4 django-cacheops-5.1 django-cors-headers-3.5.0 django-debug-toolbar-3.1.1 django-filter-2.4.0 django-js-asset-1.2.2 django-mptt-0.11.0 django-pglocks-1.0.4 django-prometheus-2.1.0 django-rq-2.4.0 django-tables2-2.3.3 django-taggit-1.3.0 django-timezone-field-4.0 djangorestframework-3.12.2 drf-yasg-1.20.0 funcy-1.15 gunicorn-20.0.4 idna-2.10 importlib-metadata-3.4.0 importlib-resources-5.1.0 inflection-0.5.1 itypes-1.2.0 jsonschema-3.2.0 netaddr-0.8.0 packaging-20.9 prometheus-client-0.9.0 psycopg2-binary-2.8.6 pycryptodome-3.9.9 pyparsing-2.4.7 pyrsistent-0.17.3 pytz-2021.1 redis-3.5.3 requests-2.25.1 rq-1.7.0 ruamel.yaml-0.16.12 ruamel.yaml.clib-0.2.2 six-1.15.0 sqlparse-0.4.1 svgwrite-1.4 swagger-spec-validator-2.7.3 typing-extensions-3.7.4.3 uritemplate-3.0.1 urllib3-1.26.3 zipp-3.4.0
You are using pip version 9.0.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Installing local dependencies (pip3 install -r local_requirements.txt)...
Collecting napalm (from -r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/66/64/9413e85b3b7360d9c32adc3ad13b09454a994d300bc1907d8c8051afb3ae/napalm-3.2.0-py2.py3-none-any.whl (230kB)
    100% |████████████████████████████████| 235kB 2.9MB/s
Collecting django-auth-ldap (from -r local_requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/e3/49/2297161849f1133ddafd8f81e6e48323db100fda7b4cd211cf7a9a453d2f/django_auth_ldap-2.2.0-py3-none-any.whl
Collecting napalm-huawei-vrp (from -r local_requirements.txt (line 6))
  Downloading https://files.pythonhosted.org/packages/6e/21/cc745a4bcaee762c39cd67bbfbc80b2ef77e7740ec1266e87bcd6d41b70f/napalm_huawei_vrp-0.1.5-py3-none-any.whl
Collecting napalm-asa (from -r local_requirements.txt (line 7))
  Downloading https://files.pythonhosted.org/packages/09/40/0114439a882aff27bc2cef29d5020d86c0de8a548fcd2212fac7f2e066d3/napalm-asa-0.1.1.tar.gz
Collecting ntc-netbox-plugin-onboarding (from -r local_requirements.txt (line 8))
  Downloading https://files.pythonhosted.org/packages/a2/13/c67efdf37e1cdc39c3f1f1e31ac0f57e8fcbb5098942117ea00ef6b45638/ntc_netbox_plugin_onboarding-2.1.0-py3-none-any.whl (598kB)
    100% |████████████████████████████████| 604kB 1.6MB/s
Collecting netbox-tunnels-plugin (from -r local_requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/95/ea/376c950968aa72ecdc4cd7e9de9711b5755b4a5278d1b008838e8eecfc75/netbox_tunnels_plugin-0.3.6-py3-none-any.whl
Collecting scp (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/b7/37/122d300034f2c8576158a7830e02c687730635e65a95f9eb2b4eb002554d/scp-0.13.3-py2.py3-none-any.whl
Collecting cffi>=1.11.3 (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/1c/1a/90fa7e7ee05d91d0339ef264bd8c008f57292aba4a91ec512a0bbb379d1d/cffi-1.14.4-cp36-cp36m-manylinux1_x86_64.whl (401kB)
    100% |████████████████████████████████| 409kB 2.4MB/s
Collecting paramiko>=2.6.0 (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/95/19/124e9287b43e6ff3ebb9cdea3e5e8e88475a873c05ccdf8b7e20d2c4201e/paramiko-2.7.2-py2.py3-none-any.whl (206kB)
    100% |████████████████████████████████| 215kB 3.7MB/s
Requirement already satisfied: setuptools>=38.4.0 in ./venv/lib/python3.6/site-packages (from napalm->-r local_requirements.txt (line 2))
Requirement already satisfied: requests>=2.7.0 in ./venv/lib/python3.6/site-packages (from napalm->-r local_requirements.txt (line 2))
Collecting textfsm (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/bd/27/0b149b6da3e47cc8daebace6920093114392171a8f5c24f1f2ad9a9e9c4d/textfsm-1.1.0-py2.py3-none-any.whl
Requirement already satisfied: netaddr in ./venv/lib/python3.6/site-packages (from napalm->-r local_requirements.txt (line 2))
Requirement already satisfied: pyYAML in ./venv/lib/python3.6/site-packages (from napalm->-r local_requirements.txt (line 2))
Collecting pyeapi>=0.8.2 (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/a2/30/05d37e23c3d718cccf475e6664afae37d96af6601c03d3c6eae4bb480ac4/pyeapi-0.8.4.tar.gz (138kB)
    100% |████████████████████████████████| 143kB 5.5MB/s
Collecting lxml>=4.3.0 (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/bd/78/56a7c88a57d0d14945472535d0df9fb4bbad7d34ede658ec7961635c790e/lxml-4.6.2-cp36-cp36m-manylinux1_x86_64.whl (5.5MB)
    100% |████████████████████████████████| 5.5MB 231kB/s
Requirement already satisfied: jinja2 in ./venv/lib/python3.6/site-packages (from napalm->-r local_requirements.txt (line 2))
Collecting junos-eznc>=2.2.1 (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/69/a7/5680c3ce87923e55247f8ca4b7953cee4af3672c986a229eac38973a8dc3/junos_eznc-2.5.4-py2.py3-none-any.whl (195kB)
    100% |████████████████████████████████| 204kB 5.6MB/s
Collecting ciscoconfparse (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/85/19/addacb49e83a0b3e352968ef7daeaf81cf9eafe09b33b17a9d34cb05e289/ciscoconfparse-1.5.29-py3-none-any.whl (93kB)
    100% |████████████████████████████████| 102kB 10.6MB/s
Collecting future (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz (829kB)
    100% |████████████████████████████████| 829kB 1.5MB/s
Collecting netmiko>=3.1.0 (from napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/75/13/9d28a46bcccd329d3aca321da2df925c5e9e64a3476cff4c38270ca16775/netmiko-3.3.3-py3-none-any.whl (168kB)
    100% |████████████████████████████████| 174kB 6.3MB/s
Collecting python-ldap>=3.1 (from django-auth-ldap->-r local_requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/9d/e2/deb47064d443344b708ffb5899ea269b201d7c22dcc653ebadcbb44c57d5/python-ldap-3.3.1.tar.gz (379kB)
    100% |████████████████████████████████| 389kB 2.9MB/s
Requirement already satisfied: Django>=1.11 in ./venv/lib/python3.6/site-packages (from django-auth-ldap->-r local_requirements.txt (line 3))
Requirement already satisfied: zipp<4.0.0,>=3.4.0 in ./venv/lib/python3.6/site-packages (from ntc-netbox-plugin-onboarding->-r local_requirements.txt (line 8))
Collecting invoke<2.0.0,>=1.4.1 (from netbox-tunnels-plugin->-r local_requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/87/8f/c153d7db091f342da6bc97f7bedd1b2ce2867c4a8b0aab40fbba85a05e33/invoke-1.5.0-py3-none-any.whl (211kB)
    100% |████████████████████████████████| 215kB 5.3MB/s
Collecting pycparser (from cffi>=1.11.3->napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl (112kB)
    100% |████████████████████████████████| 112kB 9.4MB/s
Collecting cryptography>=2.5 (from paramiko>=2.6.0->napalm->-r local_requirements.txt (line 2))
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/f8/04/51dc8a4ccb37b69a4e165a94837f70653b0b6ca49a6346361062b1f6bb09/cryptography-3.4.3.tar.gz (545kB)
    100% |████████████████████████████████| 552kB 2.0MB/s
    Complete output from command python setup.py egg_info:

            =============================DEBUG ASSISTANCE==========================
            If you are seeing an error here please try the following to
            successfully install cryptography:

            Upgrade to the latest pip and try again. This will fix errors for most
            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
            =============================DEBUG ASSISTANCE==========================

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-j2b19284/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-j2b19284/cryptography/
You are using pip version 9.0.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

My guess is because the venv is destroyed by the upgrade script, so it reverts to using system pip?

jeremystretch commented 3 years ago

Yeah, that seems to be the issue. We should add upgrading pip as a step in upgrade.sh.

As a workaround, you can issue the commands manually:

cd /opt/netbox
source venv/bin/activate
pip install -U pip

Then, comment out lines 8-27 in upgrade.sh and run it again. That should preserve the existing venv with the pip version and required packages intact.