Issue with upgrading netbox from 2.10.10 to 2.11.0

509 views
Skip to first unread message

Vinita Shah

unread,
Jun 9, 2021, 2:13:43 PM6/9/21
to NetBox

Current version 2.10.10


Steps taken for upgrade 

```

cd /opt/netbox

sudo git fetch

sudo git checkout v2.11.0

sudo ./upgrade.sh 

```


File requirements.txt

```

Django==3.2

django-cacheops==5.1

django-cors-headers==3.7.0

django-debug-toolbar==3.2.1

django-filter==2.4.0

django-mptt==0.12.0

django-pglocks==1.0.4

django-prometheus==2.1.0

django-rq==2.4.1

django-tables2==2.3.4

django-taggit==1.3.0

django-timezone-field==4.1.2

djangorestframework==3.12.4

drf-yasg[validation]==1.20.0

gunicorn==20.1.0

Jinja2==2.11.3

Markdown==3.3.4

netaddr==0.8.0

Pillow==8.2.0

psycopg2-binary==2.8.6

pycryptodome==3.10.1

PyYAML==5.4.1

svgwrite==1.4.1

tablib==3.0.0

```


File local_requirements.txt

```

netbox-plugin-auth-saml2

django3_auth_saml2

```


Issue after running ./upgrade.sh


```

Operations to perform:

  Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization

Running migrations:

  Applying extras.0054_standardize_models...Traceback (most recent call last):

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute

    return self.cursor.execute(sql, params)

psycopg2.errors.ObjectNotInPrerequisiteState: sequence must have same owner as table it is linked to



The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "netbox/manage.py", line 10, in <module>

    execute_from_command_line(sys.argv)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line

    utility.execute()

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 413, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/base.py", line 354, in run_from_argv

    self.execute(*args, **cmd_options)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/base.py", line 398, in execute

    output = self.handle(*args, **options)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/base.py", line 89, in wrapped

    res = handle_func(*args, **kwargs)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 246, in handle

    fake_initial=fake_initial,

  File "/opt/netbox/venv/lib/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/venv/lib/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/venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 227, in apply_migration

    state = migration.apply(state, schema_editor)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/migrations/migration.py", line 126, in apply

    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/migrations/operations/fields.py", line 244, in database_forwards

    schema_editor.alter_field(from_model, from_field, to_field)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 595, in alter_field

    old_db_params, new_db_params, strict)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/postgresql/schema.py", line 198, in _alter_field

    new_db_params, strict,

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 780, in _alter_field

    self.execute(sql, params)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 145, in execute

    cursor.execute(sql, params)

  File "/opt/netbox/venv/lib/python3.6/site-packages/cacheops/transaction.py", line 93, in execute

    result = self._no_monkey.execute(self, sql, params)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 66, in execute

    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers

    return executor(sql, params, many, context)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute

    return self.cursor.execute(sql, params)

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/utils.py", line 90, in __exit__

    raise dj_exc_value.with_traceback(traceback) from exc_value

  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute

    return self.cursor.execute(sql, params)

django.db.utils.OperationalError: sequence must have same owner as table it is linked to

```

Jeremy Stretch

unread,
Jun 9, 2021, 4:01:34 PM6/9/21
to Vinita Shah, NetBox
> django.db.utils.OperationalError: sequence must have same owner as table it is linked to

Looks like a PostgreSQL permissions issue. Did you rebuild the database for this upgrade? Check that all tables and sequences are owned by the role/user you use to connect to the database.
Jeremy Stretch
Distinguished Engineer, NS1
Office of the CTO
 
website: ns1.com
email: jstretch@ns1.com
 
twitterlinkedin
 
banner


--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/f18870d0-e25d-4a81-a116-ebd8ba951326n%40googlegroups.com.

Vinita Shah

unread,
Jun 9, 2021, 11:40:32 PM6/9/21
to Jeremy Stretch, NetBox
The DB was not updated/changed. 

In fact DB is a separate instance on AWS. 

I used the same methodology from going from 2.10.5 to 2.10.10. But it didn’t work for 2.10.10 to 2.11.0. 



From: Jeremy Stretch <jstr...@ns1.com>
Sent: Wednesday, June 9, 2021 1:01:04 PM
To: Vinita Shah <Vinit...@docusign.com>
Cc: NetBox <netbox-...@googlegroups.com>
Subject: [EXTERNAL] Re: [netbox-discuss] Issue with upgrading netbox from 2.10.10 to 2.11.0
 

Brian Candler

unread,
Jun 10, 2021, 2:14:14 AM6/10/21
to NetBox
shows someone else with exactly the same issue:

The solution is in there - make sure you click "View more" to see the rest of the thread.

Reply all
Reply to author
Forward
0 new messages