You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running NetBox on Python 3, applying database migrations will report a warning about unreflected migrations and prompt the user to create new migrations:
root@netbox-test:/opt/netbox/netbox# ./manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, tenancy, users
Running migrations:
No migrations to apply.
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
This is due to a semantic difference in how Python 2 and Python 3 treat strings differently. This warning can be safely ignored, however a user might understandably proceed with creating new migrations as instructed.
The new migrations will not cause data corruption, however their presence may introduce errors. For example:
$ sudo python3 manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, tenancy, users
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.4/dist-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.4/dist-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.4/dist-packages/django/core/management/commands/migrate.py", line 163, in handle
pre_migrate_state = executor._create_project_state(with_applied_migrations=True)
File "/usr/local/lib/python3.4/dist-packages/django/db/migrations/executor.py", line 81, in _create_project_state
migration.mutate_state(state, preserve=False)
File "/usr/local/lib/python3.4/dist-packages/django/db/migrations/migration.py", line 92, in mutate_state
operation.state_forwards(self.app_label, new_state)
File "/usr/local/lib/python3.4/dist-packages/django/db/migrations/operations/fields.py", line 199, in state_forwards
state.models[app_label, self.model_name_lower].fields
KeyError: ('dcim', 'module')
Users are advised to simply delete any migrations they have created (those which are not present in the master branch of the NetBox repository), after which an upgrade can be performed successfully. The next release will include a set of migrations converting all model Python 2 bytestrings to Unicode to ensure users are no longer prompted to create migrations.
The text was updated successfully, but these errors were encountered:
This issue was addressed in f21c6bc and 138cbf9. Once the new set of migrations has been applied, the warning should no longer appear after future migrations.
Issue type: Bug report
Python version: 3.x
NetBox version: 2.0.3
When running NetBox on Python 3, applying database migrations will report a warning about unreflected migrations and prompt the user to create new migrations:
This is due to a semantic difference in how Python 2 and Python 3 treat strings differently. This warning can be safely ignored, however a user might understandably proceed with creating new migrations as instructed.
The new migrations will not cause data corruption, however their presence may introduce errors. For example:
Users are advised to simply delete any migrations they have created (those which are not present in the
master
branch of the NetBox repository), after which an upgrade can be performed successfully. The next release will include a set of migrations converting all model Python 2 bytestrings to Unicode to ensure users are no longer prompted to create migrations.The text was updated successfully, but these errors were encountered: