View Issue Details

IDProjectCategoryView StatusLast Update
2107RackTablesIPv4/IPv6/SLBpublic2025-01-14 15:21
Reporterntavares Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version0.22.0 
Summary2107: Deleting an IPv4Network with VLANIPv4 assigned results in error: FK violation
DescriptionAfter assigning a VLAN to an IPv4 network (probably IPv6 too?), we can't simply delete the network - without first unlinking it from the VLAN.
The error returned is a FK violation, which is not very user-friendly, but what I'd expect is the resource to be deleted along with all related entity links, as it happens with other resources.
Steps To Reproduce1. Create a VLAN
2. Create an IPv4 network
3. Assign the VLAN to the IPv4 network

Now, when you try to delete the IPv4 network, you're presented with a FK error, record should not be deleted.
Additional InformationIntercepted queries are:
DELETE FROM `FileLink` WHERE `entity_type` = 'ipv4net' AND `entity_id` = '234'
DELETE FROM `IPv4Network` WHERE `id` = '234'

I suppose we're missing a:
DELETE FROM VLANIPv4 WHERE ipv4net_id = 234;

TagsNo tags attached.

Activities

infrastation

infrastation

2025-01-14 01:12

administrator   ~0004597

This is exactly the intended behaviour and follows the same logic that does not allow deleting a row with racks etc. Some high-level operations imply auto-cascading and some do not.
ntavares

ntavares

2025-01-14 15:21

reporter   ~0004599

Hi @infrastation, I was afraid you were going to reply that :-) However, at least, shouldn't the software provide a more user-friendly error? "FK error" says absolutely nothing about what the problem is, the user is left at a loss. I know it was the VLANIPv4 because I've checked MySQL logs, a less tech-savy user will simply consider the software "broken".

However, without being too familiar with the schema, I can't think of a good reason why wouldn't racktables simply remove the link with the VLAN (therefore, be one of those auto-cascading operations, just like what seems to happen with FileLink (above)). It can easily be recreated....

Issue History

Date Modified Username Field Change
2025-01-13 15:30 ntavares New Issue
2025-01-14 01:12 infrastation Note Added: 0004597
2025-01-14 15:21 ntavares Note Added: 0004599