Replies: 8 comments 7 replies
-
https://markupsafe.palletsprojects.com/en/2.1.x/changes/#version-2-1-0 says that Just try with the latest 2.11.x first. |
Beta Was this translation helpful? Give feedback.
-
I followed following upgrade steps from the docs site. wget https://github.com/netbox-community/netbox/archive/v2.11.0.tar.gz sudo cp /opt/netbox-2.11.0/local_requirements.txt /opt/netbox/ sudo cp -pr /opt/netbox-2.11.0/netbox/media/ /opt/netbox/netbox/ sudo cp -r /opt/netbox-2.11.0/netbox/scripts /opt/netbox/netbox/ sudo cp /opt/netbox-2.11.0/gunicorn.py /opt/netbox/ then ran the ./upgrade.sh script. Here is what I see under /opt/netbox-2.11.0 root@bnnetbox:/opt/netbox-2.11.0/netbox/netbox# ls I don't see configuration.py file there. |
Beta Was this translation helpful? Give feedback.
-
Here is the result of 2.11.9 version upgrade. (failed) root@bnnetbox:/home/nbadmin# wget https://github.com/netbox-community/netbox/archive/v2.11.9.tar.gz v2.11.9.tar.gz [ <=> ] 6.78M 9.34MB/s in 0.7s 2022-03-14 12:51:02 (9.34 MB/s) - ‘v2.11.9.tar.gz’ saved [7109590] root@bnnetbox:/home/nbadmin# sudo tar -xzf v2.11.9.tar.gz -C /opt During handling of the above exception, another exception occurred: Traceback (most recent call last): configuration.py was there, under /opt/netbox-2.11.9/netbox/netbox location but disappeared after the upgrade attempt. |
Beta Was this translation helpful? Give feedback.
-
I also tried migrating to v.3 instance of netbox and psql migration didn't work. sudo -u postgres psql psql -c 'drop database netbox' no errors, but nothing was restored. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I was able to run the upgrade.sh without an error by copying specific files from the old version to the new one. udo ln -sfn /opt/netbox-2.11.9/ /opt/netbox I also cleaned the local_requirements file as it has some upsupported plugins listed in it. Following the upgrade, I tried pulling up the site, I received the following error. =============================================================================== Database migrations missing - When upgrading to a new NetBox release, the upgrade script must be run to apply any new database migrations. You can run migrations manually by executing python3 manage.py migrate from the command line. Unsupported PostgreSQL version - Ensure that PostgreSQL version 9.6 or higher is in use. You can check this by connecting to the database using NetBox's credentials and issuing a query for SELECT VERSION(). The complete exception is provided below: <class 'django.db.utils.ProgrammingError'> column dcim_interface._connected_interface_id does not exist Python version: 3.8.10
|
Beta Was this translation helpful? Give feedback.
-
Despite the upgrade process without an error, the error above indicated netbox is still on version 2.9.4 and psql comes up as below root@bnnetbox:/opt/netbox-2.11.9/netbox# sudo -u postgres psql I also ran the migrate under virtual environment (source /opt/netbox/venv/bin/activate) and ended up on the same error at the homepage of netbox instance. |
Beta Was this translation helpful? Give feedback.
-
What version of postgress are you using? It appears to be old.
Upgrade/Migrate to a newer version and then try the upgrade script again.
…On 3/15/22 08:01, cemkur wrote:
I was able to run the upgrade.sh without an error by copying specific
files from the old version to the new one.
udo ln -sfn /opt/netbox-2.11.9/ /opt/netbox
sudo cp /opt/netbox/local_requirements.txt /opt/netbox-2.11.9/
sudo cp /opt/netbox/netbox/netbox/configuration.py
/opt/netbox-2.11.9/netbox/netbox/
I also cleaned the local_requirements file as it has some upsupported
plugins listed in it.
Following the upgrade, I tried pulling up the site, I received the
following error.
===============================================================================
Server Error
A database programming error was detected while processing this
request. Common causes include the following:
Database migrations missing - When upgrading to a new NetBox release,
the upgrade script must be run to apply any new database migrations.
You can run migrations manually by executing python3 manage.py migrate
from the command line.
Unsupported PostgreSQL version - Ensure that PostgreSQL version 9.6 or
higher is in use. You can check this by connecting to the database
using NetBox's credentials and issuing a query for SELECT VERSION().
The complete exception is provided below:
<class 'django.db.utils.ProgrammingError'>
column dcim_interface._connected_interface_id does not exist
LINE 1: ...OUNT(*) AS "__count" FROM "dcim_interface" WHERE ("dcim_inte...
^
Python version: 3.8.10
NetBox version: 2.9.4
I ran the migrate database command which resulted in the following
errors, I this where I am stuck at the moment.
***@***.***:/opt/netbox-2.11.9/netbox# python3 manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File
"/usr/local/lib/python3.8/dist-packages/django/core/management/*init*.py",
line 401, in execute_from_command_line
utility.execute()
File
"/usr/local/lib/python3.8/dist-packages/django/core/management/*init*.py",
line 377, in execute
django.setup()
File "/usr/local/lib/python3.8/dist-packages/django/*init*.py", line
24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.8/dist-packages/django/apps/registry.py",
line 91, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python3.8/dist-packages/django/apps/config.py",
line 90, in create
module = import_module(entry)
File "/usr/lib/python3.8/importlib/*init*.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'cacheops'
—
Reply to this email directly, view it on GitHub
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnetbox-community%2Fnetbox%2Fdiscussions%2F8860%23discussioncomment-2364531&data=04%7C01%7Cjos100%40psu.edu%7Ccc9f0dbccc1a4b1312f308da067b964f%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637829425153252077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=8kr5K7J0PP1rqqTfcvk4Bh3CvaIEybrhyicGyA5aCVQ%3D&reserved=0>,
or unsubscribe
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANYW3MOT7JEDFMINJ4JYJSDVAB32LANCNFSM5QTUK5OQ&data=04%7C01%7Cjos100%40psu.edu%7Ccc9f0dbccc1a4b1312f308da067b964f%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637829425153252077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1KXKXDThImbED8U%2Ff0zyp2c%2B%2BnwJEhWO1v%2BbO%2FvVp3M%3D&reserved=0>.
Triage notifications on the go with GitHub Mobile for iOS
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Cjos100%40psu.edu%7Ccc9f0dbccc1a4b1312f308da067b964f%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637829425153252077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=p0D2gG1APPaVhB4A1Nkn913KtgFOBKIMZlOs04QZZNM%3D&reserved=0>
or Android
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Cjos100%40psu.edu%7Ccc9f0dbccc1a4b1312f308da067b964f%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637829425153252077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=P5IMtZgL7E%2BffWh1%2FN%2Bd8obnQXK6UZo6qvE4OCi8TUM%3D&reserved=0>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am quite novice on the subject of netbox, I have been using it for a year or so without an issue but I though it was time to upgrade, which is where started having problems with the upgrade.
The currently running version is 2.9.4
I tried upgrading to the latest version, failed. Then I found out that the currently running version had to be upgraded to 2.11 first. I started with simply upgrading to 2.9.5 (just a release up from the currently installed v.2.9.4) and it failed with the following.
I tried running the ./uprade.sh from the /opt/netbox-2.9.5 as well as /opt/netbox location and ended up at the same error.
I removed all plugins from configuration.py as local_re... files.
Any advice?
Thank you
Collecting zipp>=3.1.0; python_version < "3.10"
Using cached zipp-3.7.0-py3-none-any.whl (5.3 kB)
Installing collected packages: pytz, sqlparse, asgiref, Django, funcy, wrapt, deprecated, pyparsing, packaging, redis, six, 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, ruamel.yaml.clib, ruamel.yaml, MarkupSafe, Jinja2, coreschema, uritemplate, inflection, idna, charset-normalizer, urllib3, certifi, requests, itypes, coreapi, PyYAML, attrs, pyrsistent, zipp, importlib-resources, jsonschema, swagger-spec-validator, drf-yasg, gunicorn, Markdown, netaddr, Pillow, psycopg2-binary, pycryptodome, svgwrite
Successfully installed Django-3.1 Jinja2-2.11.2 Markdown-3.2.2 MarkupSafe-2.1.0 Pillow-7.2.0 PyYAML-5.3.1 asgiref-3.2.10 attrs-21.4.0 certifi-2021.10.8 charset-normalizer-2.0.12 click-8.0.4 coreapi-2.3.3 coreschema-0.0.4 deprecated-1.2.13 django-cacheops-5.0.1 django-cors-headers-3.4.0 django-debug-toolbar-2.2 django-filter-2.3.0 django-js-asset-2.0.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.3.0 django-timezone-field-4.0 djangorestframework-3.11.0 drf-yasg-1.17.1 funcy-1.17 gunicorn-20.0.4 idna-3.3 importlib-resources-5.4.0 inflection-0.5.1 itypes-1.2.0 jsonschema-4.4.0 netaddr-0.8.0 packaging-21.3 prometheus-client-0.13.1 psycopg2-binary-2.8.5 pycryptodome-3.9.8 pyparsing-3.0.7 pyrsistent-0.18.1 pytz-2021.3 redis-4.1.4 requests-2.27.1 rq-1.10.1 ruamel.yaml-0.17.21 ruamel.yaml.clib-0.2.6 six-1.16.0 sqlparse-0.4.2 svgwrite-1.4 swagger-spec-validator-2.7.4 uritemplate-4.1.1 urllib3-1.26.8 wrapt-1.14.0 zipp-3.7.0
Installing local dependencies (pip3 install -r local_requirements.txt)...
Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
File "netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/management/init.py", line 377, in execute
django.setup()
File "/opt/netbox/venv/lib/python3.8/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/netbox/venv/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/opt/netbox/venv/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/netbox/netbox/circuits/models.py", line 8, in
from dcim.models import CableTermination
File "/opt/netbox/netbox/dcim/models/init.py", line 1, in
from .device_component_templates import *
File "/opt/netbox/netbox/dcim/models/device_component_templates.py", line 7, in
from extras.models import ObjectChange
File "/opt/netbox/netbox/extras/models/init.py", line 1, in
from .change_logging import ChangeLoggedModel, ObjectChange
File "/opt/netbox/netbox/extras/models/change_logging.py", line 8, in
from utilities.utils import serialize_object
File "/opt/netbox/netbox/utilities/utils.py", line 7, in
from jinja2 import Environment
File "/opt/netbox/venv/lib/python3.8/site-packages/jinja2/init.py", line 12, in
from .environment import Environment
File "/opt/netbox/venv/lib/python3.8/site-packages/jinja2/environment.py", line 25, in
from .defaults import BLOCK_END_STRING
File "/opt/netbox/venv/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "/opt/netbox/venv/lib/python3.8/site-packages/jinja2/filters.py", line 13, in
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/opt/netbox/venv/lib/python3.8/site-packages/markupsafe/init.py)
Beta Was this translation helpful? Give feedback.
All reactions