Netbox Upgrade Failing with psycopg2.errors.UniqueViolation errors. #12793
-
I am attempting to upgrade Netbox from version 3.3.9 to the latest version and it continues to fail during the "Running migrations" stage. Here is the exact error: Applying dcim.0162_unique_constraints...Traceback (most recent call last): These are the steps that I'm running:
Below is the full output of the error and a screenshot of the error in the Netbox UI is attached. Operations to perform: The above exception was the direct cause of the following exception: Traceback (most recent call last): Any help would be appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When upgrading from 3.3.x to 3.5.x, you first need to check the release notes for v3.4.0 and v3.5.0 for breaking changes. In this case, you've been caught by the following change in v3.4: * Device and virtual machine names are no longer case-sensitive. Attempting to create e.g. "device1" and "DEVICE1" within the same site will raise a validation error. The Postgres error message is saying that the combination of (lowercased device name, site, tenant) must be unique, and it can't create the index if that condition is violated. It looks like you have two devices with names that differ only in case, such as "Nexus 3048 tp" and "nexus 3048 tp", both in site id 21 with tenant id 12. The solution will be to rename one of those devices. Then you should be able to run your migrations (unless there are other cases like this that you need to fix, of course) |
Beta Was this translation helpful? Give feedback.
When upgrading from 3.3.x to 3.5.x, you first need to check the release notes for v3.4.0 and v3.5.0 for breaking changes.
In this case, you've been caught by the following change in v3.4:
* Device and virtual machine names are no longer case-sensitive. Attempting to create e.g. "device1" and "DEVICE1" within the same site will raise a validation error.
The Postgres error message is saying that the combination of (lowercased device name, site, tenant) must be unique, and it can't create the index if…