Skip to content

Upgrade to v4.3-beta1 fails if FIELD_CHOICES is in use #19224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
opericgithub opened this issue Apr 16, 2025 · 6 comments
Closed

Upgrade to v4.3-beta1 fails if FIELD_CHOICES is in use #19224

opericgithub opened this issue Apr 16, 2025 · 6 comments
Assignees
Labels
beta Concerns a bug/feature in a beta release severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@opericgithub
Copy link

opericgithub commented Apr 16, 2025

Deployment Type

Self-hosted

NetBox Version

v4.2.7

Python Version

3.12

Steps to Reproduce

  1. FIELD_CHOICES (in configuration.py) have been in use for a long time to define custom status values for racks, devices, circuits, and prefixes.

  2. Perform an upgrade following the steps from the documentation:

sudo git fetch --tags

sudo git checkout v4.3.0-beta1

sudo ./upgrade.sh

  1. The upgrade cannot proceed due to errors, which are described below in the Observed Behavior section.

NOTICE: When the same upgrade steps are performed without any use of FIELD_CHOICES, the upgrade completes without issues.

Expected Behavior

Upgrade should complete successfully or at least provide clear migration guidance for deprecated or removed constants like FIELD_CHOICES.

Observed Behavior

netbox@netbox:/opt/netbox$ sudo git checkout  v4.3.0-beta1
Previous HEAD position was 03f3f5c95 Release v4.2.7
HEAD is now at 7375042f9 Release v4.3-beta1 (#19172)
netbox@netbox:/opt/netbox$ sudo ./upgrade.sh
You are installing (or upgrading to) NetBox version 4.3.0-beta1
Using Python 3.12.3
Removing old virtual environment...
Creating a new virtual environment at /opt/netbox/venv...
Updating pip (pip install --upgrade pip)...
Requirement already satisfied: pip in ./venv/lib/python3.12/site-packages (24.0)
Collecting pip
  Using cached pip-25.0.1-py3-none-any.whl.metadata (3.7 kB)
Using cached pip-25.0.1-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-25.0.1
pip 25.0.1 from /opt/netbox/venv/lib/python3.12/site-packages/pip (python 3.12)
Installing Python system packages (pip install wheel)...
Collecting wheel
  Using cached wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
Using cached wheel-0.45.1-py3-none-any.whl (72 kB)
Installing collected packages: wheel
Successfully installed wheel-0.45.1
Installing core dependencies (pip install -r requirements.txt)...
Collecting Django==5.2.0 (from -r requirements.txt (line 1))
  Downloading Django-5.2-py3-none-any.whl.metadata (4.1 kB)
Collecting django-cors-headers==4.7.0 (from -r requirements.txt (line 2))
  Using cached django_cors_headers-4.7.0-py3-none-any.whl.metadata (16 kB)
Collecting django-debug-toolbar==5.1.0 (from -r requirements.txt (line 3))
  Downloading django_debug_toolbar-5.1.0-py3-none-any.whl.metadata (4.5 kB)
Collecting django-filter==25.1 (from -r requirements.txt (line 4))
  Using cached django_filter-25.1-py3-none-any.whl.metadata (5.1 kB)
Collecting django-htmx==1.23.0 (from -r requirements.txt (line 5))
  Using cached django_htmx-1.23.0-py3-none-any.whl.metadata (2.6 kB)
Collecting django-graphiql-debug-toolbar==0.2.0 (from -r requirements.txt (line 6))
  Using cached django_graphiql_debug_toolbar-0.2.0-py3-none-any.whl.metadata (3.5 kB)
Collecting django-mptt==0.17.0 (from -r requirements.txt (line 7))
  Using cached django_mptt-0.17.0-py3-none-any.whl.metadata (5.3 kB)
Collecting django-pglocks==1.0.4 (from -r requirements.txt (line 8))
  Using cached django_pglocks-1.0.4-py3-none-any.whl
Collecting django-prometheus==2.3.1 (from -r requirements.txt (line 9))
  Using cached django_prometheus-2.3.1-py2.py3-none-any.whl.metadata (9.4 kB)
Collecting django-redis==5.4.0 (from -r requirements.txt (line 10))
  Using cached django_redis-5.4.0-py3-none-any.whl.metadata (32 kB)
Collecting django-rich==1.14.0 (from -r requirements.txt (line 11))
  Using cached django_rich-1.14.0-py3-none-any.whl.metadata (7.7 kB)
Collecting django-rq==3.0 (from -r requirements.txt (line 12))
  Using cached django_rq-3.0.0-py2.py3-none-any.whl.metadata (18 kB)
Collecting django-storages==1.14.6 (from -r requirements.txt (line 13))
  Downloading django_storages-1.14.6-py3-none-any.whl.metadata (4.7 kB)
Collecting django-taggit==6.1.0 (from -r requirements.txt (line 14))
  Using cached django_taggit-6.1.0-py3-none-any.whl.metadata (3.5 kB)
Collecting django-tables2==2.7.5 (from -r requirements.txt (line 15))
  Using cached django_tables2-2.7.5-py3-none-any.whl.metadata (6.0 kB)
Collecting django-timezone-field==7.1 (from -r requirements.txt (line 16))
  Using cached django_timezone_field-7.1-py3-none-any.whl.metadata (13 kB)
Collecting djangorestframework==3.16.0 (from -r requirements.txt (line 17))
  Using cached djangorestframework-3.16.0-py3-none-any.whl.metadata (11 kB)
Collecting drf-spectacular==0.28.0 (from -r requirements.txt (line 18))
  Using cached drf_spectacular-0.28.0-py3-none-any.whl.metadata (14 kB)
Collecting drf-spectacular-sidecar==2025.4.1 (from -r requirements.txt (line 19))
  Using cached drf_spectacular_sidecar-2025.4.1-py3-none-any.whl.metadata (3.6 kB)
Collecting feedparser==6.0.11 (from -r requirements.txt (line 20))
  Using cached feedparser-6.0.11-py3-none-any.whl.metadata (2.4 kB)
Collecting gunicorn==23.0.0 (from -r requirements.txt (line 21))
  Using cached gunicorn-23.0.0-py3-none-any.whl.metadata (4.4 kB)
Collecting Jinja2==3.1.6 (from -r requirements.txt (line 22))
  Using cached jinja2-3.1.6-py3-none-any.whl.metadata (2.9 kB)
Collecting jsonschema==4.23.0 (from -r requirements.txt (line 23))
  Using cached jsonschema-4.23.0-py3-none-any.whl.metadata (7.9 kB)
Collecting Markdown==3.8 (from -r requirements.txt (line 24))
  Downloading markdown-3.8-py3-none-any.whl.metadata (5.1 kB)
Collecting mkdocs-material==9.6.11 (from -r requirements.txt (line 25))
  Using cached mkdocs_material-9.6.11-py3-none-any.whl.metadata (19 kB)
Collecting mkdocstrings==0.29.1 (from mkdocstrings[python]==0.29.1->-r requirements.txt (line 26))
  Using cached mkdocstrings-0.29.1-py3-none-any.whl.metadata (8.3 kB)
Collecting netaddr==1.3.0 (from -r requirements.txt (line 27))
  Using cached netaddr-1.3.0-py3-none-any.whl.metadata (5.0 kB)
Collecting nh3==0.2.21 (from -r requirements.txt (line 28))
  Using cached nh3-0.2.21-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.0 kB)
Collecting Pillow==11.2.1 (from -r requirements.txt (line 29))
  Downloading pillow-11.2.1-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (8.9 kB)
Collecting psycopg==3.2.6 (from psycopg[c,pool]==3.2.6->-r requirements.txt (line 30))
  Using cached psycopg-3.2.6-py3-none-any.whl.metadata (4.4 kB)
Collecting PyYAML==6.0.2 (from -r requirements.txt (line 31))
  Using cached PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting requests==2.32.3 (from -r requirements.txt (line 32))
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting rq==2.3.2 (from -r requirements.txt (line 33))
  Downloading rq-2.3.2-py3-none-any.whl.metadata (6.9 kB)
Collecting social-auth-app-django==5.4.3 (from -r requirements.txt (line 34))
  Using cached social_auth_app_django-5.4.3-py3-none-any.whl.metadata (2.8 kB)
Collecting social-auth-core==4.5.6 (from -r requirements.txt (line 35))
  Using cached social_auth_core-4.5.6-py3-none-any.whl.metadata (3.5 kB)
Collecting strawberry-graphql==0.264.0 (from -r requirements.txt (line 36))
  Downloading strawberry_graphql-0.264.0-py3-none-any.whl.metadata (7.7 kB)
Collecting strawberry-graphql-django==0.58.0 (from -r requirements.txt (line 37))
  Downloading strawberry_graphql_django-0.58.0-py3-none-any.whl.metadata (4.9 kB)
Collecting svgwrite==1.4.3 (from -r requirements.txt (line 38))
  Using cached svgwrite-1.4.3-py3-none-any.whl.metadata (8.8 kB)
Collecting tablib==3.8.0 (from -r requirements.txt (line 39))
  Using cached tablib-3.8.0-py3-none-any.whl.metadata (3.8 kB)
Collecting tzdata==2025.2 (from -r requirements.txt (line 40))
  Using cached tzdata-2025.2-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting asgiref>=3.8.1 (from Django==5.2.0->-r requirements.txt (line 1))
  Using cached asgiref-3.8.1-py3-none-any.whl.metadata (9.3 kB)
Collecting sqlparse>=0.3.1 (from Django==5.2.0->-r requirements.txt (line 1))
  Using cached sqlparse-0.5.3-py3-none-any.whl.metadata (3.9 kB)
Collecting graphene-django>=2.0.0 (from django-graphiql-debug-toolbar==0.2.0->-r requirements.txt (line 6))
  Using cached graphene_django-3.2.3-py2.py3-none-any.whl.metadata (8.2 kB)
Collecting django-js-asset (from django-mptt==0.17.0->-r requirements.txt (line 7))
  Using cached django_js_asset-3.1.2-py3-none-any.whl.metadata (6.4 kB)
Collecting six>=1.0.0 (from django-pglocks==1.0.4->-r requirements.txt (line 8))
  Using cached six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting prometheus-client>=0.7 (from django-prometheus==2.3.1->-r requirements.txt (line 9))
  Using cached prometheus_client-0.21.1-py3-none-any.whl.metadata (1.8 kB)
Collecting redis!=4.0.0,!=4.0.1,>=3 (from django-redis==5.4.0->-r requirements.txt (line 10))
  Using cached redis-5.2.1-py3-none-any.whl.metadata (9.1 kB)
Collecting rich>=10 (from django-rich==1.14.0->-r requirements.txt (line 11))
  Using cached rich-14.0.0-py3-none-any.whl.metadata (18 kB)
Collecting uritemplate>=2.0.0 (from drf-spectacular==0.28.0->-r requirements.txt (line 18))
  Using cached uritemplate-4.1.1-py2.py3-none-any.whl.metadata (2.9 kB)
Collecting inflection>=0.3.1 (from drf-spectacular==0.28.0->-r requirements.txt (line 18))
  Using cached inflection-0.5.1-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting sgmllib3k (from feedparser==6.0.11->-r requirements.txt (line 20))
  Using cached sgmllib3k-1.0.0-py3-none-any.whl
Collecting packaging (from gunicorn==23.0.0->-r requirements.txt (line 21))
  Using cached packaging-24.2-py3-none-any.whl.metadata (3.2 kB)
Collecting MarkupSafe>=2.0 (from Jinja2==3.1.6->-r requirements.txt (line 22))
  Using cached MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.0 kB)
Collecting attrs>=22.2.0 (from jsonschema==4.23.0->-r requirements.txt (line 23))
  Using cached attrs-25.3.0-py3-none-any.whl.metadata (10 kB)
Collecting jsonschema-specifications>=2023.03.6 (from jsonschema==4.23.0->-r requirements.txt (line 23))
  Using cached jsonschema_specifications-2024.10.1-py3-none-any.whl.metadata (3.0 kB)
Collecting referencing>=0.28.4 (from jsonschema==4.23.0->-r requirements.txt (line 23))
  Using cached referencing-0.36.2-py3-none-any.whl.metadata (2.8 kB)
Collecting rpds-py>=0.7.1 (from jsonschema==4.23.0->-r requirements.txt (line 23))
  Using cached rpds_py-0.24.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.1 kB)
Collecting babel~=2.10 (from mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached babel-2.17.0-py3-none-any.whl.metadata (2.0 kB)
Collecting backrefs~=5.7.post1 (from mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached backrefs-5.8-py312-none-any.whl.metadata (3.3 kB)
Collecting colorama~=0.4 (from mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting mkdocs-material-extensions~=1.3 (from mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached mkdocs_material_extensions-1.3.1-py3-none-any.whl.metadata (6.9 kB)
Collecting mkdocs~=1.6 (from mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached mkdocs-1.6.1-py3-none-any.whl.metadata (6.0 kB)
Collecting paginate~=0.5 (from mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached paginate-0.5.7-py2.py3-none-any.whl.metadata (11 kB)
Collecting pygments~=2.16 (from mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached pygments-2.19.1-py3-none-any.whl.metadata (2.5 kB)
Collecting pymdown-extensions~=10.2 (from mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached pymdown_extensions-10.14.3-py3-none-any.whl.metadata (3.0 kB)
Collecting mkdocs-autorefs>=1.4 (from mkdocstrings==0.29.1->mkdocstrings[python]==0.29.1->-r requirements.txt (line 26))
  Using cached mkdocs_autorefs-1.4.1-py3-none-any.whl.metadata (13 kB)
Collecting typing-extensions>=4.6 (from psycopg==3.2.6->psycopg[c,pool]==3.2.6->-r requirements.txt (line 30))
  Using cached typing_extensions-4.13.2-py3-none-any.whl.metadata (3.0 kB)
Collecting charset-normalizer<4,>=2 (from requests==2.32.3->-r requirements.txt (line 32))
  Using cached charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (35 kB)
Collecting idna<4,>=2.5 (from requests==2.32.3->-r requirements.txt (line 32))
  Using cached idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting urllib3<3,>=1.21.1 (from requests==2.32.3->-r requirements.txt (line 32))
  Using cached urllib3-2.4.0-py3-none-any.whl.metadata (6.5 kB)
Collecting certifi>=2017.4.17 (from requests==2.32.3->-r requirements.txt (line 32))
  Using cached certifi-2025.1.31-py3-none-any.whl.metadata (2.5 kB)
Collecting click>=5 (from rq==2.3.2->-r requirements.txt (line 33))
  Using cached click-8.1.8-py3-none-any.whl.metadata (2.3 kB)
Collecting PyJWT>=2.7.0 (from social-auth-core==4.5.6->-r requirements.txt (line 35))
  Using cached PyJWT-2.10.1-py3-none-any.whl.metadata (4.0 kB)
Collecting cryptography>=1.4 (from social-auth-core==4.5.6->-r requirements.txt (line 35))
  Using cached cryptography-44.0.2-cp39-abi3-manylinux_2_34_x86_64.whl.metadata (5.7 kB)
Collecting defusedxml>=0.5.0 (from social-auth-core==4.5.6->-r requirements.txt (line 35))
  Using cached defusedxml-0.7.1-py2.py3-none-any.whl.metadata (32 kB)
Collecting oauthlib>=1.0.3 (from social-auth-core==4.5.6->-r requirements.txt (line 35))
  Using cached oauthlib-3.2.2-py3-none-any.whl.metadata (7.5 kB)
Collecting python3-openid>=3.0.10 (from social-auth-core==4.5.6->-r requirements.txt (line 35))
  Using cached python3_openid-3.2.0-py3-none-any.whl.metadata (1.6 kB)
Collecting requests-oauthlib>=0.6.1 (from social-auth-core==4.5.6->-r requirements.txt (line 35))
  Using cached requests_oauthlib-2.0.0-py2.py3-none-any.whl.metadata (11 kB)
Collecting graphql-core<3.4.0,>=3.2.0 (from strawberry-graphql==0.264.0->-r requirements.txt (line 36))
  Using cached graphql_core-3.2.6-py3-none-any.whl.metadata (11 kB)
Collecting python-dateutil<3.0.0,>=2.7.0 (from strawberry-graphql==0.264.0->-r requirements.txt (line 36))
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting mkdocstrings-python>=1.16.2 (from mkdocstrings[python]==0.29.1->-r requirements.txt (line 26))
  Using cached mkdocstrings_python-1.16.10-py3-none-any.whl.metadata (5.6 kB)
Collecting psycopg-c==3.2.6 (from psycopg[c,pool]==3.2.6->-r requirements.txt (line 30))
  Using cached psycopg_c-3.2.6-cp312-cp312-linux_x86_64.whl
Collecting psycopg-pool (from psycopg[c,pool]==3.2.6->-r requirements.txt (line 30))
  Using cached psycopg_pool-3.2.6-py3-none-any.whl.metadata (2.6 kB)
Collecting cffi>=1.12 (from cryptography>=1.4->social-auth-core==4.5.6->-r requirements.txt (line 35))
  Using cached cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB)
Collecting graphene<4,>=3.0 (from graphene-django>=2.0.0->django-graphiql-debug-toolbar==0.2.0->-r requirements.txt (line 6))
  Using cached graphene-3.4.3-py2.py3-none-any.whl.metadata (6.9 kB)
Collecting graphql-relay<4,>=3.1.1 (from graphene-django>=2.0.0->django-graphiql-debug-toolbar==0.2.0->-r requirements.txt (line 6))
  Using cached graphql_relay-3.2.0-py3-none-any.whl.metadata (12 kB)
Collecting promise>=2.1 (from graphene-django>=2.0.0->django-graphiql-debug-toolbar==0.2.0->-r requirements.txt (line 6))
  Using cached promise-2.3-py3-none-any.whl
Collecting text-unidecode (from graphene-django>=2.0.0->django-graphiql-debug-toolbar==0.2.0->-r requirements.txt (line 6))
  Using cached text_unidecode-1.3-py2.py3-none-any.whl.metadata (2.4 kB)
Collecting ghp-import>=1.0 (from mkdocs~=1.6->mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached ghp_import-2.1.0-py3-none-any.whl.metadata (7.2 kB)
Collecting mergedeep>=1.3.4 (from mkdocs~=1.6->mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached mergedeep-1.3.4-py3-none-any.whl.metadata (4.3 kB)
Collecting mkdocs-get-deps>=0.2.0 (from mkdocs~=1.6->mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached mkdocs_get_deps-0.2.0-py3-none-any.whl.metadata (4.0 kB)
Collecting pathspec>=0.11.1 (from mkdocs~=1.6->mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached pathspec-0.12.1-py3-none-any.whl.metadata (21 kB)
Collecting pyyaml-env-tag>=0.1 (from mkdocs~=1.6->mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached pyyaml_env_tag-0.1-py3-none-any.whl.metadata (4.1 kB)
Collecting watchdog>=2.0 (from mkdocs~=1.6->mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached watchdog-6.0.0-py3-none-manylinux2014_x86_64.whl.metadata (44 kB)
Collecting griffe>=1.6.2 (from mkdocstrings-python>=1.16.2->mkdocstrings[python]==0.29.1->-r requirements.txt (line 26))
  Using cached griffe-1.7.2-py3-none-any.whl.metadata (5.0 kB)
Collecting markdown-it-py>=2.2.0 (from rich>=10->django-rich==1.14.0->-r requirements.txt (line 11))
  Using cached markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pycparser (from cffi>=1.12->cryptography>=1.4->social-auth-core==4.5.6->-r requirements.txt (line 35))
  Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich>=10->django-rich==1.14.0->-r requirements.txt (line 11))
  Using cached mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Collecting platformdirs>=2.2.0 (from mkdocs-get-deps>=0.2.0->mkdocs~=1.6->mkdocs-material==9.6.11->-r requirements.txt (line 25))
  Using cached platformdirs-4.3.7-py3-none-any.whl.metadata (11 kB)
Downloading Django-5.2-py3-none-any.whl (8.3 MB)
   ���������������������������������������� 0.0/8.3 MB ? eta -:-   ���������������������������������������� 8.3/8.3 MB 47.8 MB/s eta 0:00:00
Using cached django_cors_headers-4.7.0-py3-none-any.whl (12 kB)
Downloading django_debug_toolbar-5.1.0-py3-none-any.whl (261 kB)
Using cached django_filter-25.1-py3-none-any.whl (94 kB)
Using cached django_htmx-1.23.0-py3-none-any.whl (60 kB)
Using cached django_graphiql_debug_toolbar-0.2.0-py3-none-any.whl (7.3 kB)
Using cached django_mptt-0.17.0-py3-none-any.whl (120 kB)
Using cached django_prometheus-2.3.1-py2.py3-none-any.whl (29 kB)
Using cached django_redis-5.4.0-py3-none-any.whl (31 kB)
Using cached django_rich-1.14.0-py3-none-any.whl (8.9 kB)
Using cached django_rq-3.0.0-py2.py3-none-any.whl (64 kB)
Downloading django_storages-1.14.6-py3-none-any.whl (33 kB)
Using cached django_taggit-6.1.0-py3-none-any.whl (75 kB)
Using cached django_tables2-2.7.5-py3-none-any.whl (95 kB)
Using cached django_timezone_field-7.1-py3-none-any.whl (13 kB)
Using cached djangorestframework-3.16.0-py3-none-any.whl (1.1 MB)
Using cached drf_spectacular-0.28.0-py3-none-any.whl (103 kB)
Using cached drf_spectacular_sidecar-2025.4.1-py3-none-any.whl (2.4 MB)
Using cached feedparser-6.0.11-py3-none-any.whl (81 kB)
Using cached gunicorn-23.0.0-py3-none-any.whl (85 kB)
Using cached jinja2-3.1.6-py3-none-any.whl (134 kB)
Using cached jsonschema-4.23.0-py3-none-any.whl (88 kB)
Downloading markdown-3.8-py3-none-any.whl (106 kB)
Using cached mkdocs_material-9.6.11-py3-none-any.whl (8.7 MB)
Using cached mkdocstrings-0.29.1-py3-none-any.whl (1.6 MB)
Using cached netaddr-1.3.0-py3-none-any.whl (2.3 MB)
Using cached nh3-0.2.21-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (739 kB)
Downloading pillow-11.2.1-cp312-cp312-manylinux_2_28_x86_64.whl (4.6 MB)
   ���������������������������������������� 0.0/4.6 MB ? eta -:-   ���������������������������������������� 4.6/4.6 MB 65.5 MB/s eta 0:00:00
Using cached psycopg-3.2.6-py3-none-any.whl (199 kB)
Using cached PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (767 kB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Downloading rq-2.3.2-py3-none-any.whl (100 kB)
Using cached social_auth_app_django-5.4.3-py3-none-any.whl (26 kB)
Using cached social_auth_core-4.5.6-py3-none-any.whl (415 kB)
Downloading strawberry_graphql-0.264.0-py3-none-any.whl (296 kB)
Downloading strawberry_graphql_django-0.58.0-py3-none-any.whl (97 kB)
Using cached svgwrite-1.4.3-py3-none-any.whl (67 kB)
Using cached tablib-3.8.0-py3-none-any.whl (47 kB)
Using cached tzdata-2025.2-py2.py3-none-any.whl (347 kB)
Using cached asgiref-3.8.1-py3-none-any.whl (23 kB)
Using cached attrs-25.3.0-py3-none-any.whl (63 kB)
Using cached babel-2.17.0-py3-none-any.whl (10.2 MB)
Using cached backrefs-5.8-py312-none-any.whl (398 kB)
Using cached certifi-2025.1.31-py3-none-any.whl (166 kB)
Using cached charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (145 kB)
Using cached click-8.1.8-py3-none-any.whl (98 kB)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Using cached cryptography-44.0.2-cp39-abi3-manylinux_2_34_x86_64.whl (4.2 MB)
Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Using cached graphene_django-3.2.3-py2.py3-none-any.whl (114 kB)
Using cached graphql_core-3.2.6-py3-none-any.whl (203 kB)
Using cached idna-3.10-py3-none-any.whl (70 kB)
Using cached inflection-0.5.1-py2.py3-none-any.whl (9.5 kB)
Using cached jsonschema_specifications-2024.10.1-py3-none-any.whl (18 kB)
Using cached MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (23 kB)
Using cached mkdocs-1.6.1-py3-none-any.whl (3.9 MB)
Using cached mkdocs_autorefs-1.4.1-py3-none-any.whl (5.8 MB)
Using cached mkdocs_material_extensions-1.3.1-py3-none-any.whl (8.7 kB)
Using cached mkdocstrings_python-1.16.10-py3-none-any.whl (124 kB)
Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB)
Using cached packaging-24.2-py3-none-any.whl (65 kB)
Using cached paginate-0.5.7-py2.py3-none-any.whl (13 kB)
Using cached prometheus_client-0.21.1-py3-none-any.whl (54 kB)
Using cached pygments-2.19.1-py3-none-any.whl (1.2 MB)
Using cached PyJWT-2.10.1-py3-none-any.whl (22 kB)
Using cached pymdown_extensions-10.14.3-py3-none-any.whl (264 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached python3_openid-3.2.0-py3-none-any.whl (133 kB)
Using cached redis-5.2.1-py3-none-any.whl (261 kB)
Using cached referencing-0.36.2-py3-none-any.whl (26 kB)
Using cached requests_oauthlib-2.0.0-py2.py3-none-any.whl (24 kB)
Using cached rich-14.0.0-py3-none-any.whl (243 kB)
Using cached rpds_py-0.24.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (393 kB)
Using cached six-1.17.0-py2.py3-none-any.whl (11 kB)
Using cached sqlparse-0.5.3-py3-none-any.whl (44 kB)
Using cached typing_extensions-4.13.2-py3-none-any.whl (45 kB)
Using cached uritemplate-4.1.1-py2.py3-none-any.whl (10 kB)
Using cached urllib3-2.4.0-py3-none-any.whl (128 kB)
Using cached django_js_asset-3.1.2-py3-none-any.whl (5.9 kB)
Using cached psycopg_pool-3.2.6-py3-none-any.whl (38 kB)
Using cached cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB)
Using cached ghp_import-2.1.0-py3-none-any.whl (11 kB)
Using cached graphene-3.4.3-py2.py3-none-any.whl (114 kB)
Using cached graphql_relay-3.2.0-py3-none-any.whl (16 kB)
Using cached griffe-1.7.2-py3-none-any.whl (129 kB)
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Using cached mergedeep-1.3.4-py3-none-any.whl (6.4 kB)
Using cached mkdocs_get_deps-0.2.0-py3-none-any.whl (9.5 kB)
Using cached pathspec-0.12.1-py3-none-any.whl (31 kB)
Using cached pyyaml_env_tag-0.1-py3-none-any.whl (3.9 kB)
Using cached watchdog-6.0.0-py3-none-manylinux2014_x86_64.whl (79 kB)
Using cached text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Using cached platformdirs-4.3.7-py3-none-any.whl (18 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Installing collected packages: text-unidecode, sgmllib3k, paginate, watchdog, urllib3, uritemplate, tzdata, typing-extensions, tablib, svgwrite, sqlparse, six, rpds-py, redis, PyYAML, PyJWT, pygments, pycparser, psycopg-c, prometheus-client, platformdirs, Pillow, pathspec, packaging, oauthlib, nh3, netaddr, mkdocs-material-extensions, mergedeep, mdurl, MarkupSafe, Markdown, inflection, idna, graphql-core, feedparser, defusedxml, colorama, click, charset-normalizer, certifi, backrefs, babel, attrs, asgiref, rq, requests, referencing, pyyaml-env-tag, python3-openid, python-dateutil, pymdown-extensions, psycopg-pool, psycopg, promise, mkdocs-get-deps, markdown-it-py, Jinja2, gunicorn, griffe, graphql-relay, django-prometheus, django-pglocks, Django, cffi, strawberry-graphql, rich, requests-oauthlib, jsonschema-specifications, graphene, ghp-import, drf-spectacular-sidecar, djangorestframework, django-timezone-field, django-taggit, django-tables2, django-storages, django-rq, django-redis, django-js-asset, django-htmx, django-filter, django-debug-toolbar, django-cors-headers, cryptography, strawberry-graphql-django, social-auth-core, mkdocs, jsonschema, graphene-django, django-rich, django-mptt, social-auth-app-django, mkdocs-material, mkdocs-autorefs, drf-spectacular, django-graphiql-debug-toolbar, mkdocstrings, mkdocstrings-python
Successfully installed Django-5.2 Jinja2-3.1.6 Markdown-3.8 MarkupSafe-3.0.2 Pillow-11.2.1 PyJWT-2.10.1 PyYAML-6.0.2 asgiref-3.8.1 attrs-25.3.0 babel-2.17.0 backrefs-5.8 certifi-2025.1.31 cffi-1.17.1 charset-normalizer-3.4.1 click-8.1.8 colorama-0.4.6 cryptography-44.0.2 defusedxml-0.7.1 django-cors-headers-4.7.0 django-debug-toolbar-5.1.0 django-filter-25.1 django-graphiql-debug-toolbar-0.2.0 django-htmx-1.23.0 django-js-asset-3.1.2 django-mptt-0.17.0 django-pglocks-1.0.4 django-prometheus-2.3.1 django-redis-5.4.0 django-rich-1.14.0 django-rq-3.0.0 django-storages-1.14.6 django-tables2-2.7.5 django-taggit-6.1.0 django-timezone-field-7.1 djangorestframework-3.16.0 drf-spectacular-0.28.0 drf-spectacular-sidecar-2025.4.1 feedparser-6.0.11 ghp-import-2.1.0 graphene-3.4.3 graphene-django-3.2.3 graphql-core-3.2.6 graphql-relay-3.2.0 griffe-1.7.2 gunicorn-23.0.0 idna-3.10 inflection-0.5.1 jsonschema-4.23.0 jsonschema-specifications-2024.10.1 markdown-it-py-3.0.0 mdurl-0.1.2 mergedeep-1.3.4 mkdocs-1.6.1 mkdocs-autorefs-1.4.1 mkdocs-get-deps-0.2.0 mkdocs-material-9.6.11 mkdocs-material-extensions-1.3.1 mkdocstrings-0.29.1 mkdocstrings-python-1.16.10 netaddr-1.3.0 nh3-0.2.21 oauthlib-3.2.2 packaging-24.2 paginate-0.5.7 pathspec-0.12.1 platformdirs-4.3.7 prometheus-client-0.21.1 promise-2.3 psycopg-3.2.6 psycopg-c-3.2.6 psycopg-pool-3.2.6 pycparser-2.22 pygments-2.19.1 pymdown-extensions-10.14.3 python-dateutil-2.9.0.post0 python3-openid-3.2.0 pyyaml-env-tag-0.1 redis-5.2.1 referencing-0.36.2 requests-2.32.3 requests-oauthlib-2.0.0 rich-14.0.0 rpds-py-0.24.0 rq-2.3.2 sgmllib3k-1.0.0 six-1.17.0 social-auth-app-django-5.4.3 social-auth-core-4.5.6 sqlparse-0.5.3 strawberry-graphql-0.264.0 strawberry-graphql-django-0.58.0 svgwrite-1.4.3 tablib-3.8.0 text-unidecode-1.3 typing-extensions-4.13.2 tzdata-2025.2 uritemplate-4.1.1 urllib3-2.4.0 watchdog-6.0.0
Installing local dependencies (pip install -r local_requirements.txt)...
Collecting django-auth-ldap (from -r local_requirements.txt (line 1))
  Using cached django_auth_ldap-5.1.0-py3-none-any.whl.metadata (7.2 kB)
Requirement already satisfied: Django>=4.2 in ./venv/lib/python3.12/site-packages (from django-auth-ldap->-r local_requirements.txt (line 1)) (5.2)
Collecting python-ldap>=3.1 (from django-auth-ldap->-r local_requirements.txt (line 1))
  Using cached python_ldap-3.4.4-cp312-cp312-linux_x86_64.whl
Requirement already satisfied: asgiref>=3.8.1 in ./venv/lib/python3.12/site-packages (from Django>=4.2->django-auth-ldap->-r local_requirements.txt (line 1)) (3.8.1)
Requirement already satisfied: sqlparse>=0.3.1 in ./venv/lib/python3.12/site-packages (from Django>=4.2->django-auth-ldap->-r local_requirements.txt (line 1)) (0.5.3)
Collecting pyasn1>=0.3.7 (from python-ldap>=3.1->django-auth-ldap->-r local_requirements.txt (line 1))
  Using cached pyasn1-0.6.1-py3-none-any.whl.metadata (8.4 kB)
Collecting pyasn1-modules>=0.1.5 (from python-ldap>=3.1->django-auth-ldap->-r local_requirements.txt (line 1))
  Using cached pyasn1_modules-0.4.2-py3-none-any.whl.metadata (3.5 kB)
Using cached django_auth_ldap-5.1.0-py3-none-any.whl (20 kB)
Using cached pyasn1-0.6.1-py3-none-any.whl (83 kB)
Using cached pyasn1_modules-0.4.2-py3-none-any.whl (181 kB)
Installing collected packages: pyasn1, pyasn1-modules, python-ldap, django-auth-ldap
Successfully installed django-auth-ldap-5.1.0 pyasn1-0.6.1 pyasn1-modules-0.4.2 python-ldap-3.4.4
Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
  File "/opt/netbox/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 416, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 457, in execute
    self.check(**check_kwargs)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 492, in check
    all_issues = checks.run_checks(
                 ^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/registry.py", line 89, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 44, in check_url_namespaces_unique
    all_namespaces = _load_all_namespaces(resolver)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 63, in _load_all_namespaces
    url_patterns = getattr(resolver, "url_patterns", [])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/functional.py", line 47, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 718, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
                       ^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/functional.py", line 47, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 711, in urlconf_module
    return import_module(self.urlconf_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/opt/netbox/netbox/netbox/urls.py", line 9, in <module>
    from netbox.graphql.schema import schema
  File "/opt/netbox/netbox/netbox/graphql/schema.py", line 37, in <module>
    schema = strawberry.Schema(
             ^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/strawberry/schema/schema.py", line 300, in __init__
    raise ValueError(f"Invalid Schema. Errors:\n\n{formatted_errors}")
ValueError: Invalid Schema. Errors:

� Enum type CircuitStatusEnum must define one or more values.

� Enum type RackStatusEnum must define one or more values.

� Enum type DeviceStatusEnum must define one or more values.
netbox@netbox:/opt/netbox$
@opericgithub opericgithub added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Apr 16, 2025
@ross-cello
Copy link

ross-cello commented Apr 17, 2025

It could potentially be a subset of your choices. We're using various status choices for Circuit/Device/Prefix/Site/etc. The only other non-status is Journal kind choices.

Full and explicit substitution of choices, e.g. below

...
    # CIRCUIT add: installed
    # CIRCUIT del: planned, offline
    'circuits.Circuit.status': (
        ('provisioning', 'Provisioning', 'blue'),
        ('installed', 'Installed', 'blue'),
        ('active', 'Active', 'green'),
        ('deprovisioning', 'Deprovisioning', 'yellow'),
        # ('planned', 'Planned (DoNotUse)', 'cyan'),
        # ('offline', 'Offline (DoNotUse)', 'gray'),
        ('decommissioned', 'Decommissioned', 'gray')
    ),
...

Migrations okay from v4.2.7. Only other notable possibly is Python3.11

@opericgithub
Copy link
Author

here is our section:

FIELD_CHOICES = {            
    'ipam.Prefix.status': (
        ('slobodan', 'Slobodan', 'cyan'),
        ('u_upotrebi', 'U upotrebi', 'green'),
        ('rezervisan', 'Rezervisan', 'blue'),
        ('van_upotrebe', 'Van upotrebe', 'red'),
        ('container', 'Kontejner', 'yellow'),
    ),               
    'dcim.Rack.status': (     
        ('u_upotrebi', 'U upotrebi', 'green'),
        ('planiran', 'Planiran', 'cyan'),   
        ('van_upotrebe', 'Van upotrebe', 'gray'),
    ),
    'circuits.Circuit.status': (
        ('aktivna', 'Aktivna', 'green'),
        ('nepotrebna', 'Nepotrebna', 'yellow'),
        ('ukinuta', 'Ukinuta', 'gray'),
        ('planirana', 'Planirana', 'cyan'),
    ),          
    'dcim.Device.status': ( 
        ('ok_u_funkciji', 'U funkciji', 'green'),      
        ('raspolozivo', 'Raspolo\u017eivo', 'cyan'),
        ('neispravno_servis', 'Neispravno', 'red'),
        ('neupotrebljivo', 'Neupotrebljivo', 'purple'),
        ('arhivirano', 'Arhivirano', 'gray'),
        ('nepoznato_ostalo', 'Nepoznato i ostalo', 'orange'),
    ),
}

@jeremystretch jeremystretch added the beta Concerns a bug/feature in a beta release label Apr 17, 2025
@jeremystretch jeremystretch self-assigned this Apr 17, 2025
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows and removed status: needs triage This issue is awaiting triage by a maintainer labels Apr 17, 2025
@ross-cello
Copy link

ross-cello commented Apr 21, 2025

I can't exhaustively test it, but it might be something in dcim.Rack.status.

When I added those choices to mine, I ran in to the same exception. I'm not using Rack status.

    'dcim.Rack.status': (     
        ('u_upotrebi', 'U upotrebi', 'green'),
        ('planiran', 'Planiran', 'cyan'),   
        ('van_upotrebe', 'Van upotrebe', 'gray'),
    ),
  File "/opt/netbox/netbox/netbox/graphql/schema.py", line 37, in <module>
    schema = strawberry.Schema(
             ^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/strawberry/schema/schema.py", line 300, in __init__
    raise ValueError(f"Invalid Schema. Errors:\n\n{formatted_errors}")
ValueError: Invalid Schema. Errors:

❌ Enum type RackStatusEnum must define one or more values.

If I add a native status, upgrade.sh seems to run okay.

I used Planned and Active. 3 tests; using Active+Planned, then just Active and finally just Planned. All three of those ran successfully.

    'dcim.Rack.status': (     
        ('u_upotrebi', 'U upotrebi', 'green'),
        ('planiran', 'Planiran', 'cyan'),   
        ('van_upotrebe', 'Van upotrebe', 'gray'),
#        ('planned', 'Planned', 'cyan'),
#        ('active', 'Active', 'green'),
    ),

My choices include native statuses. Perhaps you can try the same?
Hope that helps

@opericgithub
Copy link
Author

I reverted Rack statuses to default ones, deleted my custom statuses from configuration.py, but it still reports the same errors (this time without message "� Enum type RackStatusEnum must define one or more values." ).

@ross-cello
Copy link

So you get some other *StatusEnum error now? I don't quite follow where you're at with configuration.
As you mentioned prior that removing FIELD_CHOICES resolves your issue, they're still defined?

If so, perhaps if you have any choices in use, they still require at least one native choice. Maybe not limited to dcim.rack specifically.

Regardless, this issue is assigned and problem could possibly already identified. Not sure if my contribution is just noise at this stage.

@opericgithub
Copy link
Author

opericgithub commented Apr 22, 2025

Regarding your first message in this topic, you might be right. Now I've added this line:

('active', 'Active', 'green'),
to all of my Field_choices sections, and the upgrade process completes successfully. However, I'm now encountering an error in the web gui:

There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

<class 'TypeError'>

Value after * must be an iterable, not NoneType

Python version: 3.12.3
NetBox version: 4.3.0-beta1
Plugins: None installed

whenever I try to access any section of the main menu that is not related to the Field_choices sections. For example, I get an error when going to Racks → Rack Roles, but I don’t get an error when navigating to Racks → Racks (since I have an entry for racks in the Field_choices).

bctiemann added a commit that referenced this issue Apr 22, 2025
Fixes #19224: Fix GraphQL API support for custom field choices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Concerns a bug/feature in a beta release severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

4 participants