Module not found error after updating from 2.8.0 to a newer version #1460
Unanswered
Kleinrotti
asked this question in
Getting Help
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current Behavior
I wanted to update from the 2.8.0 release to 3.2.1. But when building the plugin image with:
docker compose build --no-cache
This error appears:
=> ERROR [netbox 6/6] RUN DEBUG="true" SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bi 0.9s
[netbox 6/6] RUN DEBUG="true" SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input:
0.744 Traceback (most recent call last):
0.744 File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/init.py", line 255, in fetch_command
0.745 app_name = commands[subcommand]
0.745 ~~~~~~~~^^^^^^^^^^^^
0.745 KeyError: 'collectstatic'
0.745
0.745 During handling of the above exception, another exception occurred:
0.745
0.745 Traceback (most recent call last):
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/django/db/backends/postgresql/psycopg_any.py", line 5, in
0.745 from psycopg import ClientCursor, IsolationLevel, adapt, adapters, errors, sql
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/psycopg/init.py", line 9, in
0.745 from . import pq # noqa: F401 import early to stabilize side effects
0.745 ^^^^^^^^^^^^^^^^
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/psycopg/pq/init.py", line 18, in
0.745 from . import abc
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/psycopg/pq/abc.py", line 13, in
0.745 from .._compat import Self, TypeAlias
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/psycopg/_compat.py", line 48, in
0.745 from typing_extensions import TypeVar
0.745 ImportError: cannot import name 'TypeVar' from 'typing_extensions' (/opt/netbox/venv/lib/python3.12/site-packages/typing_extensions.py). Did you mean: 'TypeGuard'?
0.745
0.745 During handling of the above exception, another exception occurred:
0.745
0.745 Traceback (most recent call last):
0.745 File "/opt/netbox/netbox/manage.py", line 10, in
0.745 execute_from_command_line(sys.argv)
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
0.745 utility.execute()
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/init.py", line 436, in execute
0.745 self.fetch_command(subcommand).run_from_argv(self.argv)
0.745 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/init.py", line 262, in fetch_command
0.745 settings.INSTALLED_APPS
0.745 File "/opt/netbox/venv/lib/python3.12/site-packages/django/conf/init.py", line 81, in getattr
0.746 self._setup(name)
0.746 File "/opt/netbox/venv/lib/python3.12/site-packages/django/conf/init.py", line 68, in _setup
0.746 self._wrapped = Settings(settings_module)
0.746 ^^^^^^^^^^^^^^^^^^^^^^^^^
0.746 File "/opt/netbox/venv/lib/python3.12/site-packages/django/conf/init.py", line 166, in init
0.746 mod = importlib.import_module(self.SETTINGS_MODULE)
0.746 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.746 File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
0.746 return _bootstrap._gcd_import(name[level:], package, level)
0.746 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.746 File "", line 1387, in _gcd_import
0.746 File "", line 1360, in _find_and_load
0.746 File "", line 1331, in _find_and_load_unlocked
0.746 File "", line 935, in _load_unlocked
0.746 File "", line 995, in exec_module
0.746 File "", line 488, in _call_with_frames_removed
0.746 File "/opt/netbox/netbox/netbox/settings.py", line 14, in
0.746 from netbox.config import PARAMS as CONFIG_PARAMS
0.746 File "/opt/netbox/netbox/netbox/config/init.py", line 9, in
0.746 from .parameters import PARAMS
0.746 File "/opt/netbox/netbox/netbox/config/parameters.py", line 2, in
0.746 from django.contrib.postgres.forms import SimpleArrayField
0.746 File "/opt/netbox/venv/lib/python3.12/site-packages/django/contrib/postgres/forms/init.py", line 3, in
0.746 from .ranges import * # NOQA
0.746 ^^^^^^^^^^^^^^^^^^^^^
0.746 File "/opt/netbox/venv/lib/python3.12/site-packages/django/contrib/postgres/forms/ranges.py", line 3, in
0.746 from django.db.backends.postgresql.psycopg_any import (
0.746 File "/opt/netbox/venv/lib/python3.12/site-packages/django/db/backends/postgresql/psycopg_any.py", line 77, in
0.746 from psycopg2 import errors, extensions, sql # NOQA
0.746 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.746 ModuleNotFoundError: No module named 'psycopg2'
failed to solve: process "/bin/sh -c DEBUG="true" SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input" did not complete successfully: exit code: 1
This is my Dockerfile-Plugins:
`FROM netboxcommunity/netbox:${VERSION-v4.2-3.2.1}
COPY ./plugin_requirements.txt /opt/netbox/
RUN /usr/local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt
COPY configuration/configuration.py /etc/netbox/config/configuration.py
COPY configuration/plugins.py /etc/netbox/config/plugins.py
RUN DEBUG="true" SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy"
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input`
Expected Behavior
The build should be successful.
Docker Compose Version
v2.32.4
Docker Version
The git Revision
2efacf3
The git Status
Startup Command
docker compose build --no-cache
NetBox Logs
Content of docker-compose.override.yml
Beta Was this translation helpful? Give feedback.
All reactions