View Issue Details

IDProjectCategoryView StatusLast Update
1787RackTablesdefaultpublic2018-10-23 04:54
ReporterrdinoffAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformCentOS release 6.9 (Final)OSOS Version
Product Version0.20.14 
Target VersionFixed in Version 
Summary1787: Argument 'bypass' of value '(NULL)' is invalid
DescriptionWe have upgraded from 0.20.11 to 0.20.14 hoping that this would fix the "Argument 'bypass' of value '(NULL)' is invalid" error but it has not.
Clicking on Objects gives the following error:
 
 https://racktables/index.php?page=depot
 Internal error
 Argument 'bypass' of value '(NULL)' is invalid (must be specified for the given page name).

 Looks like a similar issues was reported in 2013 and resolution was fixed (http://bugs.racktables.org/view.php?id=823)
Steps To ReproduceClicking on Objects
TagsNo tags attached.

Activities

infrastation

infrastation

2017-10-23 16:22

administrator   ~0003747

Does this installation of RackTables list any issues under reports/data integrity?
rdinoff

rdinoff

2017-10-23 16:35

reporter   ~0003749

no issues listed .... "No integrity violations found"
infrastation

infrastation

2017-10-23 16:45

administrator   ~0003751

Could you add the following to the secret.php file and if it prints a stack trace instead of the original error message, copy it here?

$debug_mode = TRUE;
rdinoff

rdinoff

2017-10-23 17:34

reporter   ~0003753

Uncaught exception: InvalidArgException

Argument 'bypass' of value '(NULL)' is invalid (must be specified for the given page name). (0)
at file /var/www/RackTables-0.20.14/wwwroot/inc/functions.php, line 2961

/var/www/RackTables-0.20.14/wwwroot/inc/interface.php:2422 mkA('row#', 'row', NULL)
renderDepot(NULL)
/var/www/RackTables-0.20.14/wwwroot/index.php:35 call_user_func('renderDepot', NULL)
Parameters:

GET

page depot
POST

COOKIE

PHPSESSID 28nsg83p844f1027lj5r1jb576
infrastation

infrastation

2017-10-23 22:47

administrator   ~0003755

Thank you for the update. This issue is not a duplicate as far as I can tell. Looks like it is caused by invalid data coming from the function getMountInfo(); that function has not changed for at least 5 years but I don't remember any similar reports.

If the root cause is discrepancies in the database, the fact the integrity report does not detect them is a bug itself. If I have the time to look into this, I will request more debugging information and provide means to retrieve it.
rdinoff

rdinoff

2018-04-09 04:52

reporter   ~0003775

Some objects were listed as being in two racks. I am not sure how this happened (bad csv import?) but I have deleted the incorrect rows (rack_id 29) from the database and now the object view works.

mysql> select * from RackSpace where object_id=2197;
+---------+---------+----------+-------+-----------+
| rack_id | unit_no | atom | state | object_id |
+---------+---------+----------+-------+-----------+
| 29 | 43 | interior | T | 2197 |
| 29 | 43 | rear | T | 2197 |
| 946 | 43 | interior | T | 2197 |
| 946 | 43 | rear | T | 2197 |

I do not think this case should ever happen so a new data integrity check can be created. If the following query returns any rows it means the object is in more then one rack

select object_id, count(*) racks from (select distinct rack_id, object_id from RackSpace) rs group by object_id having racks > 1;
neuro42

neuro42

2018-10-23 04:54

reporter   ~0003827

The case of objects being in two racks is useful for planning out migrations between two locations, but it isn't the actual cause of the problem, as this alone doesn't cause the error.

I was mass deleting some objects with commitDeleteObject() on the output of various SQL queries, and ran into the same error message. I've traced it to the case where commitDeleteObject() is passed a rack objectID before every object in that rack might be removed from RackSpace. commitResetObject only removes the objectID from the rack; it doesn't deal with the case where the objectID is the rack. This causes the rack object removal to fail, but the entities linking it to the row do get removed. After the entity links for the row have been removed, mkA() ends up being passed NULL for the row_id, which causes the exception.

When commitResetObject is passed a rack, the delete for RackSpace should probably use array( 'rack_id' => $object_id ) instead of array('object_id' => $object_id). This will let the rack removal complete properly, and not leave the DB in a bad state.

An integrity check to catch this would ensure that every rack_id in RackSpace has a matching EntityLink for row, so that mkA won't later fail.

Issue History

Date Modified Username Field Change
2017-09-15 00:24 rdinoff New Issue
2017-10-23 16:22 infrastation Note Added: 0003747
2017-10-23 16:35 rdinoff Note Added: 0003749
2017-10-23 16:45 infrastation Note Added: 0003751
2017-10-23 17:34 rdinoff Note Added: 0003753
2017-10-23 22:47 infrastation Note Added: 0003755
2018-04-09 04:52 rdinoff Note Added: 0003775
2018-10-23 04:54 neuro42 Note Added: 0003827