Skip to content

Upgrade from v3.7.8 to v4.4.0 fails on migration users.0005_alter_user_table (core_objecttype missing) #20290

@pheus

Description

@pheus

Deployment Type

Self-hosted

NetBox Version

v4.4.0

Python Version

3.10

Steps to Reproduce

  1. Start with a fresh PostgreSQL database (no existing NetBox tables).
  2. Clone the NetBox repository and check out v3.7.8:
    git clone https://github.com/netbox-community/netbox.git /opt/netbox
    cd /opt/netbox
    git checkout v3.7.8
  3. Configure NetBox per the installation guide (minimal config with DB/Redis and ALLOWED_HOSTS) and initialize using the provided script:
    ./upgrade.sh
  4. Upgrade the working tree to v4.4.0:
    git checkout v4.4.0
  5. Run the upgrade script again to apply migrations for v4.4.0:
    ./upgrade.sh

Expected Behavior

The upgrade should complete successfully. All migrations should apply without errors and NetBox should start normally on v4.4.0.

Observed Behavior

The migration fails while applying users.0005_alter_user_table with an error indicating that core_objecttype does not exist:

Applying users.0005_alter_user_table...Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 105, in _execute
    return self.cursor.execute(sql, params)
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-/venv/lib/python3.10/site-packages/psycopg/cursor.py", line 97, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "core_objecttype" does not exist
LINE 1: ...type"."public", "core_objecttype"."features" FROM "core_obje...
                                            ^

After this exception, the upgrade process aborts.

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtopic: migrationsFor issues related specifically to migrations, not those that just contain migrations.type: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions