DB netbox broken after upgrade 3.4 #7395

Closed
opened 2025-12-29 20:22:54 +01:00 by adam · 4 comments
Owner

Originally created by @marcucci-DAE on GitHub (Dec 20, 2022).

NetBox version

v3.4.1

Python version

3.9

Steps to Reproduce

After running the ./upgrade.sh (as usually I do..) In the phase the manage.py migrate I receive this error .

django.db.utils.IntegrityError: could not create unique index "dcim_device_unique_name_site_tenant"
DETAIL: Key (lower(name::text), site_id, tenant_id)=(ap--n, 1, 1) is duplicated.

And the DB is not accessible from netbox...

Please help me

Expected Behavior

django.db.utils.IntegrityError: could not create unique index "dcim_device_unique_name_site_tenant"
DETAIL: Key (lower(name::text), site_id, tenant_id)=(ap--n, 1, 1) is duplicated.

Observed Behavior

django.db.utils.IntegrityError: could not create unique index "dcim_device_unique_name_site_tenant"
DETAIL: Key (lower(name::text), site_id, tenant_id)=(ap--n, 1, 1) is duplicated.

Originally created by @marcucci-DAE on GitHub (Dec 20, 2022). ### NetBox version v3.4.1 ### Python version 3.9 ### Steps to Reproduce After running the ./upgrade.sh (as usually I do..) In the phase the manage.py migrate I receive this error . django.db.utils.IntegrityError: could not create unique index "dcim_device_unique_name_site_tenant" DETAIL: Key (lower(name::text), site_id, tenant_id)=(ap-**-n**, 1, 1) is duplicated. And the DB is not accessible from netbox... Please help me ### Expected Behavior django.db.utils.IntegrityError: could not create unique index "dcim_device_unique_name_site_tenant" DETAIL: Key (lower(name::text), site_id, tenant_id)=(ap-**-n**, 1, 1) is duplicated. ### Observed Behavior django.db.utils.IntegrityError: could not create unique index "dcim_device_unique_name_site_tenant" DETAIL: Key (lower(name::text), site_id, tenant_id)=(ap-**-n**, 1, 1) is duplicated.
adam closed this issue 2025-12-29 20:22:54 +01:00
Author
Owner

@renatoalmeidaoliveira commented on GitHub (Dec 20, 2022):

It seems that you might have devices with the same name in some site, in version 3.4 the name is case unsensitive so:
Device == device.
Are you able to run nbshell to change the devices name, or rollback to 3.3 change the names and upgrade again?

@renatoalmeidaoliveira commented on GitHub (Dec 20, 2022): It seems that you might have devices with the same name in some site, in version 3.4 the name is case unsensitive so: Device == device. Are you able to run nbshell to change the devices name, or rollback to 3.3 change the names and upgrade again?
Author
Owner

@marcucci-DAE commented on GitHub (Dec 20, 2022):

Thanks for your reply . How I can modify thesw device into db?

Thanks

Inviato da Outlook per Androidhttps://aka.ms/AAb9ysg


From: Renato Almeida de Oliveira @.>
Sent: Tuesday, December 20, 2022 7:54:30 PM
To: netbox-community/netbox @.
>
Cc: Tiziana Marcucci @.>; Author @.>
Subject: [EXT] Re: [netbox-community/netbox] DB netbox broken after upgrade 3.4 (Issue #11266)

ATTENZIONE: Questa email ha origine esterna all’organizzazione. Non aprire i link e MAI scaricare gli allegati, a meno di conoscere il mittente e di sapere che il contenuto sia attendibile.
WARNING: This mail source is external to the organization. Do not open any link and NEVER download attachments, unless you trust the sender and its contents.

It seems that you might have devices with the same name in some site, in version 3.4 the name is case unsensitive so:
Device == device.


Reply to this email directly, view it on GitHubhttps://github.com/netbox-community/netbox/issues/11266#issuecomment-1360000186, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWUSFH2JEPNMUGF3UZR5SA3WOH6GNANCNFSM6AAAAAATETRIKU.
You are receiving this because you authored the thread.Message ID: @.***>

@marcucci-DAE commented on GitHub (Dec 20, 2022): Thanks for your reply . How I can modify thesw device into db? Thanks Inviato da Outlook per Android<https://aka.ms/AAb9ysg> ________________________________ From: Renato Almeida de Oliveira ***@***.***> Sent: Tuesday, December 20, 2022 7:54:30 PM To: netbox-community/netbox ***@***.***> Cc: Tiziana Marcucci ***@***.***>; Author ***@***.***> Subject: [EXT] Re: [netbox-community/netbox] DB netbox broken after upgrade 3.4 (Issue #11266) ATTENZIONE: Questa email ha origine esterna all’organizzazione. Non aprire i link e MAI scaricare gli allegati, a meno di conoscere il mittente e di sapere che il contenuto sia attendibile. WARNING: This mail source is external to the organization. Do not open any link and NEVER download attachments, unless you trust the sender and its contents. It seems that you might have devices with the same name in some site, in version 3.4 the name is case unsensitive so: Device == device. — Reply to this email directly, view it on GitHub<https://github.com/netbox-community/netbox/issues/11266#issuecomment-1360000186>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWUSFH2JEPNMUGF3UZR5SA3WOH6GNANCNFSM6AAAAAATETRIKU>. You are receiving this because you authored the thread.Message ID: ***@***.***>
Author
Owner

@renatoalmeidaoliveira commented on GitHub (Dec 20, 2022):

Are you able to access nbshell?

@renatoalmeidaoliveira commented on GitHub (Dec 20, 2022): Are you able to access nbshell?
Author
Owner

@marcucci-DAE commented on GitHub (Dec 22, 2022):

Yes of course.

Da: Renato Almeida de Oliveira @.>
Inviato: martedì 20 dicembre 2022 20:08
A: netbox-community/netbox @.
>
Cc: Tiziana Marcucci @.>; Author @.>
Oggetto: [EXT] Re: [netbox-community/netbox] DB netbox broken after upgrade 3.4 (Issue #11266)

ATTENZIONE: Questa email ha origine esterna all’organizzazione. Non aprire i link e MAI scaricare gli allegati, a meno di conoscere il mittente e di sapere che il contenuto sia attendibile.
WARNING: This mail source is external to the organization. Do not open any link and NEVER download attachments, unless you trust the sender and its contents.

Are you able to access nbshell?


Reply to this email directly, view it on GitHubhttps://github.com/netbox-community/netbox/issues/11266#issuecomment-1360033074, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWUSFH7VHQ3KT6I3WJFF47LWOH723ANCNFSM6AAAAAATETRIKU.
You are receiving this because you authored the thread.Message ID: @.***>

@marcucci-DAE commented on GitHub (Dec 22, 2022): Yes of course. Da: Renato Almeida de Oliveira ***@***.***> Inviato: martedì 20 dicembre 2022 20:08 A: netbox-community/netbox ***@***.***> Cc: Tiziana Marcucci ***@***.***>; Author ***@***.***> Oggetto: [EXT] Re: [netbox-community/netbox] DB netbox broken after upgrade 3.4 (Issue #11266) ATTENZIONE: Questa email ha origine esterna all’organizzazione. Non aprire i link e MAI scaricare gli allegati, a meno di conoscere il mittente e di sapere che il contenuto sia attendibile. WARNING: This mail source is external to the organization. Do not open any link and NEVER download attachments, unless you trust the sender and its contents. Are you able to access nbshell? — Reply to this email directly, view it on GitHub<https://github.com/netbox-community/netbox/issues/11266#issuecomment-1360033074>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWUSFH7VHQ3KT6I3WJFF47LWOH723ANCNFSM6AAAAAATETRIKU>. You are receiving this because you authored the thread.Message ID: ***@***.***>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7395