Created
January 3, 2019 04:02
-
-
Save hkdanalyser/1851b2b694fd3792d14cf2a900d47314 to your computer and use it in GitHub Desktop.
Django migration task Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TASK [lae.netbox : Run database migrations for NetBox] ******************************************************** | |
fatal: [machinename]: FAILED! => { | |
"changed": false, | |
"cmd": "./manage.py migrate --noinput", | |
"path": "/opt/netbox/current/venv-py3/bin:/sbin:/bin:/usr/sbin:/usr/bin", | |
"state": "absent", | |
"syspath": [ | |
"/tmp/ansible_django_manage_payload_zl50_9at/ansible_django_manage_payload.zip", | |
"", | |
"/usr/lib64/python36.zip", | |
"/usr/lib64/python3.6", | |
"/usr/lib64/python3.6/lib-dynload", | |
"/usr/local/lib64/python3.6/site-packages", | |
"/usr/local/lib/python3.6/site-packages", | |
"/usr/lib64/python3.6/site-packages", | |
"/usr/lib/python3.6/site-packages" | |
] | |
} | |
MSG: | |
stdout: Operations to perform: | |
Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization | |
Running migrations: | |
Applying tenancy.0002_tenant_group_optional_squashed_0003_unicode_literals... | |
:stderr: Traceback (most recent call last): | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute | |
return self.cursor.execute(sql, params) | |
psycopg2.ProgrammingError: syntax error at or near "WITH ORDINALITY" | |
LINE 6: FROM unnest(c.conkey) WITH ORDINALITY co... | |
^ | |
The above exception was the direct cause of the following exception: | |
Traceback (most recent call last): | |
File "./manage.py", line 10, in <module> | |
execute_from_command_line(sys.argv) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line | |
utility.execute() | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute | |
self.fetch_command(subcommand).run_from_argv(self.argv) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv | |
self.execute(*args, **cmd_options) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/core/management/base.py", line 353, in execute | |
output = self.handle(*args, **options) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped | |
res = handle_func(*args, **kwargs) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/core/management/commands/migrate.py", line 203, in handle | |
fake_initial=fake_initial, | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate | |
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards | |
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration | |
state = migration.apply(state, schema_editor) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/migrations/migration.py", line 124, in apply | |
operation.database_forwards(self.app_label, schema_editor, old_state, project_state) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/migrations/operations/fields.py", line 216, in database_forwards | |
schema_editor.alter_field(from_model, from_field, to_field) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 523, in alter_field | |
old_db_params, new_db_params, strict) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/postgresql/schema.py", line 122, in _alter_field | |
new_db_params, strict, | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 531, in _alter_field | |
fk_names = self._constraint_names(model, [old_field.column], foreign_key=True) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/base/schema.py", line 1029, in _constraint_names | |
constraints = self.connection.introspection.get_constraints(cursor, model._meta.db_table) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/postgresql/introspection.py", line 158, in get_constraints | |
""", ["public", table_name]) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute | |
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers | |
return executor(sql, params, many, context) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute | |
return self.cursor.execute(sql, params) | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__ | |
raise dj_exc_value.with_traceback(traceback) from exc_value | |
File "/opt/netbox/current/venv-py3/lib64/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute | |
return self.cursor.execute(sql, params) | |
django.db.utils.ProgrammingError: syntax error at or near "WITH ORDINALITY" | |
LINE 6: FROM unnest(c.conkey) WITH ORDINALITY co... | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment