Upgrade 2.9.11 - 2.10.2 - upgrade.sh throws ""dcim_cablepath" already exists"

55 views
Skip to first unread message

Pieter Lambrecht

unread,
Dec 29, 2020, 11:00:07 AM12/29/20
to NetBox
Hey,

I have a 2.9.11 that I want to upgrade to 2.10.2.
I used git to checkout the latest version, and when I run the upgrade.sh, I get this error :

Running migrations:
  Applying dcim.0121_cablepath...Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 82, in _execute
    return self.cursor.execute(sql)
psycopg2.errors.DuplicateTable: relation "dcim_cablepath" already exists

Any idea what is causing this ? I have nog cables in my netbox, only IPAM stuff..

Pieter

Pieter Lambrecht

unread,
Dec 29, 2020, 11:36:33 AM12/29/20
to NetBox
I dropped that table 'dcim_cablepath", and the upgrade.sh got passed this error..

but now it is throwing errors like 
   django.db.utils.ProgrammingError: column "custom_field_data" of relation "tenancy_tenant" already exists
   psycopg2.errors.DuplicateColumn: column "custom_field_data" of relation "ipam_vrf" already exists

Feels like the process is somehow not overwriting existing things, or not deleting old things...

please advise

Pieter

Op dinsdag 29 december 2020 om 17:00:07 UTC+1 schreef Pieter Lambrecht:

Brian Candler

unread,
Dec 30, 2020, 5:32:49 AM12/30/20
to NetBox
Please can you revert to a backup of your postgres database which you took prior to the upgrade, and then start again, so we can see the exact error from the first attempt?

There's no way that a "dcim_cablepath" table could exist in a Netbox 2.9.x installation - it simply didn't exist then.  That implies that either:
1. you already attempted an upgrade to 2.10 which failed for some other reason, and you've shown the result from the second attempt; or
2. you previously upgraded to a beta version or the git "develop" branch (which is not supported for production use)

Reverting the database to a known good 2.9.x state is the first step in resolving this.

Pieter Lambrecht

unread,
Dec 30, 2020, 6:49:47 AM12/30/20
to NetBox
Brian,

you were totally right... I had some runs on trying the upgrade, and that probably caused the DB to be corrupt..
I also noticed that the pg_dump gave me 40 errors when importing..
So: I reinstalled the netbox server totally, and installed  a clean 2.9.11 netbox.
Then I took another dump from the original netbox instance (postgres12), but in cleartext, and then imported it into the new netbox instance (postgress11), 
That gave me a nice 2.9.11..

then I ran the git based upgrade and all turned out nice !

Sorry to bother you all with my problems, but thank you for your advice !

Pieter




Op woensdag 30 december 2020 om 11:32:49 UTC+1 schreef Brian Candler:
Reply all
Reply to author
Forward
0 new messages