Can't delete IP address from upgraded netbox 2.10.x to netbox 2.11.x instance.. #5002

Closed
opened 2025-12-29 19:23:04 +01:00 by adam · 6 comments
Owner

Originally created by @ThomasADavis on GitHub (Jun 16, 2021).

NetBox version

v2.11.4

Python version

3.6

Steps to Reproduce

  1. I dumped a netbox 2.10.8 instance, copied over the sql file to a 2.11.6 instance, and imported it.
  2. I then ran the upgrade.sh script.
  3. no errors.
  4. trying to delete a node, gives no errors, claims success but the device/interface/IP address is still there.

Expected Behavior

IPv4 address gets deleted, the interface gets deleted, and the device gets deleted.

Observed Behavior

No errors, but the IP address is not deleted. This occurs on both v2.11.4 and v2.11.6

Screenshot_2021-06-15_20-37-32

Originally created by @ThomasADavis on GitHub (Jun 16, 2021). ### NetBox version v2.11.4 ### Python version 3.6 ### Steps to Reproduce 1) I dumped a netbox 2.10.8 instance, copied over the sql file to a 2.11.6 instance, and imported it. 2) I then ran the upgrade.sh script. 3) no errors. 4) trying to delete a node, gives no errors, claims success but the device/interface/IP address is still there. ### Expected Behavior IPv4 address gets deleted, the interface gets deleted, and the device gets deleted. ### Observed Behavior No errors, but the IP address is not deleted. This occurs on both v2.11.4 and v2.11.6 ![Screenshot_2021-06-15_20-37-32](https://user-images.githubusercontent.com/12158973/122154438-dcde6a00-ce19-11eb-9e40-b1e51ab8e046.png)
adam added the status: under review label 2025-12-29 19:23:04 +01:00
adam closed this issue 2025-12-29 19:23:04 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 16, 2021):

It's not clear from your description above exactly what steps you're taking. Please edit your original post to detail exactly what steps someone else can take to replicate the reported issue.

@jeremystretch commented on GitHub (Jun 16, 2021): It's not clear from your description above exactly what steps you're taking. Please edit your original post to detail _exactly_ what steps someone else can take to replicate the reported issue.
Author
Owner

@ThomasADavis commented on GitHub (Jun 16, 2021):

It's really that simple. Take the existing db from our netbox 2.10.8 instance, upgraded that copy to the netbox 2.11.4 (or 2.11.6) instance, which gives zero errors on running upgrade.sh Go into the v2.11.4 instance and try to delete an IPv4 address from the 2.10.8 instance converted to the 2.11.4 instance, and it gives no errors and does not delete the IPv4 address.

No errors are generated anywhere and no deletion of the IPv4 address occurs.

The screen shot shows the claim that the IPv4 address was deleted, but it's still there.

In the original v2.10.8 instance, you can delete the exact same IPv4 address (since both db's are the same), and it works.

@ThomasADavis commented on GitHub (Jun 16, 2021): It's really that simple. Take the existing db from our netbox 2.10.8 instance, upgraded that copy to the netbox 2.11.4 (or 2.11.6) instance, which gives zero errors on running upgrade.sh Go into the v2.11.4 instance and try to delete an IPv4 address from the 2.10.8 instance converted to the 2.11.4 instance, and it gives no errors and does not delete the IPv4 address. No errors are generated anywhere and no deletion of the IPv4 address occurs. The screen shot shows the claim that the IPv4 address was deleted, but it's still there. In the original v2.10.8 instance, you can delete the exact same IPv4 address (since both db's are the same), and it works.
Author
Owner

@jeremystretch commented on GitHub (Jun 16, 2021):

Take the existing db from our netbox 2.10.8 instance

Is this something you're willing to publish so that someone else can attempt to replicate the behavior? The key is that we need enough information about your environment and data for someone else to be able to replicate the behavior.

@jeremystretch commented on GitHub (Jun 16, 2021): > Take the existing db from our netbox 2.10.8 instance Is this something you're willing to publish so that someone else can attempt to replicate the behavior? The key is that we need enough information about your environment and data for someone else to be able to replicate the behavior.
Author
Owner

@ThomasADavis commented on GitHub (Jun 16, 2021):

I can send a PostgreSQL dump, there is zero sensitive information in it other than API keys and the netbox account.. which I can find and nuke.

@ThomasADavis commented on GitHub (Jun 16, 2021): I can send a PostgreSQL dump, there is zero sensitive information in it other than API keys and the netbox account.. which I can find and nuke.
Author
Owner

@ThomasADavis commented on GitHub (Jun 16, 2021):

Wait, I think I know what's wrong.. now to figure how to remove it. At one point in, I had installed a plugin called 'netbox_ddns', from here: https://github.com/sjm-steffann/netbox-ddns

I'm getting these postgresql errors:

2021-06-15 20:30:39.951 PDT [1313272] ERROR:  update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab
le "netbox_ddns_dnsstatus"
2021-06-15 20:30:39.951 PDT [1313272] DETAIL:  Key (id)=(2166) is still referenced from table "netbox_ddns_dnsstatus".
2021-06-15 20:30:39.951 PDT [1313272] STATEMENT:  COMMIT
2021-06-15 20:30:40.271 PDT [1313272] ERROR:  update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab
le "netbox_ddns_dnsstatus"
2021-06-15 20:30:40.271 PDT [1313272] DETAIL:  Key (id)=(2167) is still referenced from table "netbox_ddns_dnsstatus".
2021-06-15 20:30:40.271 PDT [1313272] STATEMENT:  COMMIT
2021-06-15 20:30:47.414 PDT [1313272] ERROR:  update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab
le "netbox_ddns_dnsstatus"
2021-06-15 20:30:47.414 PDT [1313272] DETAIL:  Key (id)=(2167) is still referenced from table "netbox_ddns_dnsstatus".
2021-06-15 20:30:47.414 PDT [1313272] STATEMENT:  COMMIT
2021-06-15 20:33:02.260 PDT [1313289] ERROR:  update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab
le "netbox_ddns_dnsstatus"
2021-06-15 20:33:02.260 PDT [1313289] DETAIL:  Key (id)=(2166) is still referenced from table "netbox_ddns_dnsstatus".
2021-06-15 20:33:02.260 PDT [1313289] STATEMENT:  COMMIT
2021-06-15 20:37:08.107 PDT [1313366] ERROR:  update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab
le "netbox_ddns_dnsstatus"
2021-06-15 20:37:08.107 PDT [1313366] DETAIL:  Key (id)=(2166) is still referenced from table "netbox_ddns_dnsstatus".
2021-06-15 20:37:08.107 PDT [1313366] STATEMENT:  COMMIT

I turned off that plugin, but I have no idea how to undo what it did. Guess it's time to hand edit the db..

@ThomasADavis commented on GitHub (Jun 16, 2021): Wait, I think I know what's wrong.. now to figure how to remove it. At one point in, I had installed a plugin called 'netbox_ddns', from here: https://github.com/sjm-steffann/netbox-ddns I'm getting these postgresql errors: ``` 2021-06-15 20:30:39.951 PDT [1313272] ERROR: update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab le "netbox_ddns_dnsstatus" 2021-06-15 20:30:39.951 PDT [1313272] DETAIL: Key (id)=(2166) is still referenced from table "netbox_ddns_dnsstatus". 2021-06-15 20:30:39.951 PDT [1313272] STATEMENT: COMMIT 2021-06-15 20:30:40.271 PDT [1313272] ERROR: update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab le "netbox_ddns_dnsstatus" 2021-06-15 20:30:40.271 PDT [1313272] DETAIL: Key (id)=(2167) is still referenced from table "netbox_ddns_dnsstatus". 2021-06-15 20:30:40.271 PDT [1313272] STATEMENT: COMMIT 2021-06-15 20:30:47.414 PDT [1313272] ERROR: update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab le "netbox_ddns_dnsstatus" 2021-06-15 20:30:47.414 PDT [1313272] DETAIL: Key (id)=(2167) is still referenced from table "netbox_ddns_dnsstatus". 2021-06-15 20:30:47.414 PDT [1313272] STATEMENT: COMMIT 2021-06-15 20:33:02.260 PDT [1313289] ERROR: update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab le "netbox_ddns_dnsstatus" 2021-06-15 20:33:02.260 PDT [1313289] DETAIL: Key (id)=(2166) is still referenced from table "netbox_ddns_dnsstatus". 2021-06-15 20:33:02.260 PDT [1313289] STATEMENT: COMMIT 2021-06-15 20:37:08.107 PDT [1313366] ERROR: update or delete on table "ipam_ipaddress" violates foreign key constraint "netbox_ddns_dnsstatu_ip_address_id_b2a2168d_fk_ipam_ipad" on tab le "netbox_ddns_dnsstatus" 2021-06-15 20:37:08.107 PDT [1313366] DETAIL: Key (id)=(2166) is still referenced from table "netbox_ddns_dnsstatus". 2021-06-15 20:37:08.107 PDT [1313366] STATEMENT: COMMIT ``` I turned off that plugin, but I have no idea how to undo what it did. Guess it's time to hand edit the db..
Author
Owner

@ThomasADavis commented on GitHub (Jun 17, 2021):

Force removal of the plugin's added tables (using 'drop table ... cascade' on one of them) makes it work again. However, not sure how much other stuff was left behind.

So it was a set of db changes that a plugin created, that I had disabled long ago, causing this.

@ThomasADavis commented on GitHub (Jun 17, 2021): Force removal of the plugin's added tables (using 'drop table ... cascade' on one of them) makes it work again. However, not sure how much other stuff was left behind. So it was a set of db changes that a plugin created, that I had disabled long ago, causing this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5002