Cannot upgrade netbox from 2.10.5 to 2.10.10

152 visningar
Hoppa till det första olästa meddelandet

Vinita Shah

oläst,
25 maj 2021 13:09:472021-05-25
till NetBox
I followed these setps on a different instance, but its not upgrading to 2.10.10

```
wget https://github.com/netbox-community/netbox/archive/v2.10.10.tar.gz
sudo tar -xzf v2.10.10.tar.gz -C /opt
sudo ln -sfn /opt/netbox-2.10.10/ /opt/netboxsudo ./upgrade.shsudo systemctl restart netbox netbox-rq
```

Partial output after running upgrade.sh

```
Applying database migrations (python3 netbox/manage.py migrate)...
Operations to perform:
Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization
Running migrations:
No migrations to apply.
Checking for missing cable paths (python3 netbox/manage.py trace_paths --no-input)...
Found no missing circuit termination paths; skipping
Found no missing console port paths; skipping
Found no missing console server port paths; skipping
Found no missing interface paths; skipping
Found no missing power feed paths; skipping
Found no missing power outlet paths; skipping
Found no missing power port paths; skipping
Finished.
Collecting static files (python3 netbox/manage.py collectstatic --no-input)...206 static files copied to '/opt/netbox/netbox/static', 755 unmodified.
Removing stale content types (python3 netbox/manage.py remove_stale_contenttypes --no-input)...
Removing expired user sessions (python3 netbox/manage.py clearsessions)...
Clearing cache data (python3 netbox/manage.py invalidate all)...
Upgrade complete! Don't forget to restart the NetBox services:
> sudo systemctl restart netbox netbox-rq
```

I did a restart on netbox and netbox-rq. 
What am I missing ?I already have configuration.py and local_re.txt in my /opt/netbox dir

It is not upgrading to 2.10.10. 

Brian Candler

oläst,
25 maj 2021 15:28:582021-05-25
till NetBox
Please explain what you mean by "It is not upgrading to 2.10.10".

I don't see any error in the output.  Does the web interface give an error? If so, what does it show.  Or does the web interface say it's still v2.10.5 ??

What do you see if you do:

ls -ld /opt/netbox
ls -l /opt/netbox

Vinita Shah

oläst,
25 maj 2021 15:42:282021-05-25
till Brian Candler, NetBox

Sorry I should have specified. The Web UI still shows 2.10.5.

 

Here is the output

 

xx@xxx:~$ ls -ld /opt/netbox

drwxr-xr-x 10 root root 4096 May 18 20:08 /opt/netbox

xx@xxx:~$ ls -l /opt/netbox

total 6992

-rw-r--r--  1 root root     117 Mar  5 02:56 CHANGELOG.md

-rw-r--r--  1 root root    9278 Mar  5 02:56 CONTRIBUTING.md

-rw-r--r--  1 root root   10174 Mar  5 02:56 LICENSE.txt

-rw-r--r--  1 root root      72 Mar  5 02:56 NOTICE

-rw-r--r--  1 root root    2480 Mar  5 02:56 README.md

drwxr-xr-x  2 root root    4096 Mar 17 22:24 __pycache__

-rw-r--r--  1 root root    2438 Mar  5 02:56 base_requirements.txt

drwxr-xr-x  2 root root    4096 Mar  5 02:56 contrib

drwxr-xr-x 13 root root    4096 Mar  5 02:56 docs

-rw-r--r--  1 root root     486 Mar 17 22:17 gunicorn.py

-rw-r--r--  1 root root      44 Mar 18 00:39 local_requirements.txt

-rw-r--r--  1 root root    4129 Mar  5 02:56 mkdocs.yml

drwxr-xr-x 18 root root    4096 Mar  5 03:34 netbox

lrwxrwxrwx  1 root root      20 May 18 19:36 netbox-2.10.10 -> /opt/netbox-2.10.10/

-rw-r--r--  1 root root     496 Mar 17 22:48 requirements.txt

drwxr-xr-x  3 root root    4096 Mar  5 02:56 scripts

-rwxr-xr-x  1 root root    3616 Mar  5 02:56 upgrade.sh

-rw-r--r--  1 root root 7066062 May 18 19:36 v2.10.10.tar.gz

drwxr-xr-x  6 root root    4096 May 18 20:08 venv

xx@xxxx:~$ 

--
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/8feee8a8-87a7-4ab4-9397-b7dfd1cc845fn%40googlegroups.com.

Brian Candler

oläst,
25 maj 2021 15:47:212021-05-25
till NetBox
The problem is there in your directory listing.

Instead of creating a new /opt/netbox-2.10.10 directory, and symlinking /opt/netbox to /opt/netbox-2.10.10, you have created /opt/netbox/netbox-2.10.10 (i.e. you have untarred it *inside* your /opt/netbox directory), and then created a symlink from /opt/netbox/netbox-2.10.10 to /opt/netbox-2.10.10.

Note that there are two different upgrade paths.  If you originally installed netbox using a tarball, then follow the tarball instructions; the original netbox should be sitting in /opt/netbox-2.10.5 with a symlink from /opt/netbox to /opt/netbox-2.10.5  (which will be replaced, when you do the upgrade properly).  The new netbox will be in /opt/netbox-2.10.10

However if you originally installed netbox using a git checkout, then you should follow the git upgrade instructions (basically "git pull" on the master branch).  Everything will be in a top-level /opt/netbox directory.

Vinita Shah

oläst,
1 juni 2021 18:58:042021-06-01
till Brian Candler, NetBox

Hello Brian,

 

I don’t have the initial install via git, but the upgrade needs to happen via tar as I don’t want the most recent version of netbox.

 

Any ideas on workarounds ? Thank you.

Vinita Shah

oläst,
1 juni 2021 19:16:232021-06-01
till Brian Candler, NetBox

If I were to follow the git pull method,

 

```

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 97, 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

 

xxxx:/opt/netbox

 

```

Brian Candler

oläst,
2 juni 2021 02:33:072021-06-02
till NetBox
On Tuesday, 1 June 2021 at 23:58:04 UTC+1 vinit...@docusign.com wrote:

I don’t have the initial install via git, but the upgrade needs to happen via tar as I don’t want the most recent version of netbox.


If you *did* make the initial install via git, then you could jump to any version by checking out a particular tag instead of the master branch.

git fetch
git checkout v2.11.0  # for example
./upgrade.sh

Remember that you can't go backwards through any version which applied a database migration, without reverting the database to a backup taken with an earlier version.

Brian Candler

oläst,
2 juni 2021 02:50:212021-06-02
till NetBox
On Wednesday, 2 June 2021 at 00:16:23 UTC+1 vinit...@docusign.com wrote:

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

 

Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden