Description
Deployment Type
Self-hosted
NetBox Version
v3.7.4 and v3.6.9
Python Version
3.10
Steps to Reproduce
I'm not sure whether this is the right place, but please correct me if I should post this issue in some other place.
I tried to do the upgrade from v3.7.4 as well as from v3.6.9, to the new v4.0.x (x = either feature, or beta).
First I tried upgrading to feature branch few days ago, and now I tried upgrading to v4.0-beta1.
I was using the following commands:
cd /opt/netbox
sudo git pull origin v4.0-beta1
sudo ./upgrade.sh
Then I get the following error messages:
Installing collected packages: pyasn1, pyasn1-modules, python-ldap, django-auth-ldap
Successfully installed django-auth-ldap-4.7.0 pyasn1-0.6.0 pyasn1-modules-0.4.0 python-ldap-3.4.4
Applying database migrations (python3 netbox/manage.py migrate)...
Operations to perform:
Apply all migrations: account, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization, vpn, wireless
Running migrations:
Applying circuits.0043_circuittype_color... OK
Applying core.0006_datasource_type_remove_choices... OK
Applying core.0007_job_add_error_field... OK
Applying core.0008_contenttype_proxy... OK
Applying core.0009_configrevision... OK
Applying core.0010_gfk_indexes... OK
Applying dcim.0183_devicetype_exclude_from_utilization... OK
Applying dcim.0184_protect_child_interfaces... OK
Applying dcim.0185_gfk_indexes... OK
Applying dcim.0186_location_facility... OK
Applying extras.0099_cachedvalue_ordering... OK
Applying extras.0100_customfield_ui_attrs... OK
Applying extras.0101_eventrule... OK
Applying extras.0102_move_configrevision... OK
Applying extras.0103_gfk_indexes... OK
Applying extras.0104_stagedchange_remove_change_logging... OK
Applying extras.0105_customfield_min_max_values... OK
Applying extras.0106_bookmark_user_cascade_deletion... OK
Applying extras.0107_cachedvalue_extras_cachedvalue_object... OK
Applying extras.0108_convert_reports_to_scripts... OK
Applying extras.0109_script_model... OK
Applying extras.0110_remove_eventrule_action_parameters... OK
Applying extras.0111_rename_content_types...Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 103, in _execute
return self.cursor.execute(sql)
File "/opt/netbox/venv/lib/python3.10/site-packages/psycopg/cursor.py", line 732, in execute
raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "extras_customfield_content_types_id_seq" does not exist
The above exception was the direct cause of the following exception:
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.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib/python3.10/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.10/site-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 356, in handle
post_migrate_state = executor.migrate(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/operations/special.py", line 106, in database_forwards
self._run_sql(schema_editor, self.sql)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/operations/special.py", line 133, in _run_sql
schema_editor.execute(statement, params=None)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/postgresql/schema.py", line 45, in execute
return super().execute(sql, params)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 201, in execute
cursor.execute(sql, params)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 100, in _execute
with self.db.wrap_database_errors:
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 103, in _execute
return self.cursor.execute(sql)
File "/opt/netbox/venv/lib/python3.10/site-packages/psycopg/cursor.py", line 732, in execute
raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "extras_customfield_content_types_id_seq" does not exist
Am I doing something wrong? Is there anything else I should check for?
I am also afraid that I won't be able to do the upgrade to the final version v4.0 in few weeks.
Expected Behavior
I expect to upgrade to the new (beta) version, as I was able to do this in the past using the same commands.
Observed Behavior
I get the error:
django.db.utils.ProgrammingError: relation "extras_customfield_content_types_id_seq" does not exist
Detailed log messages are given above.