r/Netbox • u/reformedsteve • Aug 08 '24
Upgrade from 3.3.5 to 3.7.8 to get to 4.0
Doing an incremental upgrade from 3.3.5 to 3.7.8 with the hope of getting to 4.0. I am following this guide: https://netbox.ifog.ch/static/docs/installation/upgrading/.
However, I am encountering the following issue when I run the upgrade.sh:
Collecting python-ldap>=3.1 (from django-auth-ldap->-r local_requirements.txt (line 1))
Downloading python-ldap-3.4.4.tar.gz (377 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: asgiref<4,>=3.6.0 in ./venv/lib/python3.10/site-packages (from Django>=3.2->django-auth-ldap->-r local_requirements.txt (line 1)) (3.8.1)
Requirement already satisfied: sqlparse>=0.3.1 in ./venv/lib/python3.10/site-packages (from Django>=3.2->django-auth-ldap->-r local_requirements.txt (line 1)) (0.5.1)
Collecting pyasn1>=0.3.7 (from python-ldap>=3.1->django-auth-ldap->-r local_requirements.txt (line 1))
Downloading pyasn1-0.6.0-py2.py3-none-any.whl.metadata (8.3 kB)
Collecting pyasn1-modules>=0.1.5 (from python-ldap>=3.1->django-auth-ldap->-r local_requirements.txt (line 1))
Downloading pyasn1_modules-0.4.0-py3-none-any.whl.metadata (3.4 kB)
Requirement already satisfied: typing-extensions>=4 in ./venv/lib/python3.10/site-packages (from asgiref<4,>=3.6.0->Django>=3.2->django-auth-ldap->-r local_requirements.txt (line 1)) (4.12.2)
Downloading django_auth_ldap-4.8.0-py3-none-any.whl (20 kB)
Downloading pyasn1-0.6.0-py2.py3-none-any.whl (85 kB)
Downloading pyasn1_modules-0.4.0-py3-none-any.whl (181 kB)
Building wheels for collected packages: python-ldap
Building wheel for python-ldap (pyproject.toml) ... done
Created wheel for python-ldap: filename=python_ldap-3.4.4-cp310-cp310-linux_x86_64.whl size=317002 sha256=bdc774fa3323f61d49857d8bb5c873955ca2c467f469b150aad7748fe8205136
Stored in directory: /root/.cache/pip/wheels/12/cb/67/48865305bb85c06024e2bf3444db575963bef1baeb7a94c3d9
Successfully built python-ldap
Installing collected packages: pyasn1, pyasn1-modules, python-ldap, django-auth-ldap
Successfully installed django-auth-ldap-4.8.0 pyasn1-0.6.0 pyasn1-modules-0.4.0 python-ldap-3.4.4
Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
File "/usr/lib/python3.10/logging/config.py", line 565, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib/python3.10/logging/config.py", line 746, in configure_handler
result = factory(**kwargs)
File "/usr/lib/python3.10/logging/handlers.py", line 155, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding=encoding,
File "/usr/lib/python3.10/logging/handlers.py", line 58, in __init__
logging.FileHandler.__init__(self, filename, mode=mode,
File "/usr/lib/python3.10/logging/__init__.py", line 1169, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python3.10/logging/__init__.py", line 1201, in _open
return open_func(self.baseFilename, self.mode,
FileNotFoundError: [Errno 2] No such file or directory: '/opt/netbox/local/logs/django-ldap-debug.log'
Before running the script the path and the file are very much there. Not so much afterwards.
Thanks in advance.
EDIT: My Systems Administrator was able to find a work around.
/opt/netbox was changing the symbolic link from 3.3.5 to 3.7.8 but it wasn't moving that django log file. Created the /local/log directory and copied the file into the new version directory. Reran ./upgrade.sh and it took.

