View Issue Details

IDProjectCategoryView StatusLast Update
757RackTablesdefaultpublic2013-03-02 22:19
Reporterinfrastation Assigned Toadoom42  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.20.3 
Target Version0.20.4Fixed in Version0.20.4 
Summary757: cannot delete rack without units
DescriptionA particular way of deleting a rack always results in a FK exception.
Steps To Reproduce1. create a rack
2. on Design tab unset all units
3. on Properties try to delete
Additional Informationforeign key violation (0)

at file /path/to/racktables/wwwroot/inc/database.php, line 3482

/path/to/racktables/wwwroot/inc/database.php:3529 convertPDOException(exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`rackdemo`.`RackSpace`, CONSTRAINT `RackSpace-FK-rack_id` FOREIGN KEY (`rack_id`) REFERENCES `Object` (`id`))' in /path/to/racktables/wwwroot/inc/database.php:3524
Stack trace:
#0 /path/to/racktables/wwwroot/inc/database.php(3524): PDOStatement->execute(Array)
#1 /path/to/racktables/wwwroot/inc/database.php(1168): usePreparedDeleteBlade('Object', Array)
#2 /path/to/racktables/wwwroot/inc/ophandlers.php(2066): commitDeleteObject('1029')
#3 [internal function]: deleteRack()
#4 /path/to/racktables/wwwroot/index.php(225): call_user_func('deleteRack')
#5 {main})
/path/to/racktables/wwwroot/inc/database.php:1168 usePreparedDeleteBlade('Object', Array
(
    [id] => 1029
)
)
/path/to/racktables/wwwroot/inc/ophandlers.php:2066 commitDeleteObject('1029')
deleteRack()
/path/to/racktables/wwwroot/index.php:225 call_user_func('deleteRack')
TagsNo tags attached.

Activities

infrastation

infrastation

2013-02-27 06:44

administrator   ~0001169

One part of the problem is addressed with commit d9f58ee, the other is under Aaron's review.
adoom42

adoom42

2013-03-02 22:19

administrator   ~0001181

A rack cannot be deleted if
a) any objects are mounted
b) any units have been marked as non-existent (Design tab)
c) any units have been marked as having problems (Problems tab)

Previously, the icon and link to delete the rack was displayed even if conditions b or c were true. Starting with 0.20.4, it will be hidden in those cases.

Issue History

Date Modified Username Field Change
2013-02-21 14:11 infrastation New Issue
2013-02-23 21:36 infrastation Target Version => 0.20.4
2013-02-27 06:44 infrastation Note Added: 0001169
2013-02-27 06:44 infrastation Assigned To => adoom42
2013-02-27 06:44 infrastation Status new => assigned
2013-03-02 22:19 adoom42 Note Added: 0001181
2013-03-02 22:19 adoom42 Status assigned => closed
2013-03-02 22:19 adoom42 Resolution open => fixed
2013-03-02 22:19 adoom42 Fixed in Version => 0.20.4