With the advent of Director administrators can name custom Data Fields with a variety of characters.
Users cannot use the entire variety of custom data field names that can be created as dimensions to slice Cubes.
Several unwritten rules must be followed in v1.1.1 for a Cube slicing operation to succeed and not cause a stack trace.
The rules are:
A custom data field name must start with a lower-case letter.
A custom data field name cannot contain spaces.
A custom data field name cannot contain any punctuation besides underscores.
A custom data field name cannot contain upper-case letters.
A custom data field name must be 31 characters or less.
The regex that matches a name with the characteristics is: [a-z]([a-z0-9_])*.
Several different failures or stacktraces will result based on violation of these rules:
Test Cases
All test cases begin with Reporting -> Cube -> + Add a dimension.
Test case
Field name
Workflow
Result
F
stringf
Click cube name -> Click Modify
Success
G
string g
Click cube name
Failure: Got no such dimension
H
string-h
Click cube name -> Click Modify
Success
I
StringI
Click cube name -> Click Modify
Failure: Modify 0 hosts
J
string_j
Click cube name -> Click Modify
Success
Result explanations
Success
Success of this test means that the Modify link was clicked and the Director Host modification form was presented.
Failure: Got no such dimension
This is an invalid error message in the test case (G), because the field does exist.
When the title of the cube is clicked, the following is given in the right panel:
Note that the error message is URL-encoded, perhaps this is why the comparsion to find the dimension failed.
Also please note that a better error message for a failed search would be "Dimension not found."
Failure: Modify 0 hosts
This is also a problem with the comparison in the search.
Apparently the string to look for in the list of dimensions is lowercased before the search.
When the title of the cube is clicked, the following is given in the right panel:
stringi = Igloodly Doodly Doo
Show hosts status Modify 0 hosts
This shows all This allows you to
matching hosts and modify properties for
their current state in all chosen hosts at
the monitoring module once
Clearly the search string was lowercased before the search, since it was displayed that way.
And yet the code believes the search succeeded, because it wants to let you modify the Hosts.
But there are zero (0) of them.
If the Modify 0 hosts link is clicked:
Uncaught Error: Call to a member function hasConnection() on boolean in /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php:132
Stack trace:
#0 /usr/share/icingaweb2/modules/director/application/forms/IcingaMultiEditForm.php(28): Icinga\Module\Director\Web\Form\DirectorObjectForm->object()
#1 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectsController.php(182): Icinga\Module\Director\Forms\IcingaMultiEditForm->setObjects(Array)
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectsController.php(165): Icinga\Module\Director\Web\Controller\ObjectsController->commonForEdit()
#3 /usr/share/icingaweb2/modules/director/application/controllers/HostsController.php(37): Icinga\Module\Director\Web\Controller\ObjectsController->editAction()
#4 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Controllers\HostsController->editAction()
#5 /usr/share/php/Icinga/Web/Controller/Dispatcher.ph
#0 [internal function]: Icinga\Application\Web->Icinga\Application\{closure}()
#1 {main}
Recent fixes
These tests were previously conducted on v1.1.0 and there were stacktraces produced for
test cases G and H.
v1.1.1 fixed test case H, and produces an invalid error message for case G.
To Reproduce
In Director, add the following Data Fields of Data Type String:
stringf (all lowercase)
string g (with a space)
string-h (with a dash)
StringI (mixed case)
string_j (all lowercase with an underscore)
In Director, create a Host Template and add all fields created above.
In Director, Create a Host using that template, setting values for the fields. (The exact value is not significant.)
In Director, Deploy.
Use the workflows above to reproduce the test cases.
Expected behavior
All given examples should work.
All cases should present the correct list of Hosts for Director Modification.
Screenshots
Setup
Success
Failure: Got no such dimension
Failure: Failure: Modify 0 hosts
Your Environment
Icinga 2.10.5
Icinga Web 2.7.3
Director 1.7.2
Cube 1.1.1
Additional context
There may be additional test cases I have not thought of.
Also, based on the limitations of column naming in MySQL, MariaDB and PostgreSQL,
the maximum length of a custom data field that will succeed is 31 characters.
Describe the bug
With the advent of Director administrators can name custom Data Fields with a variety of characters. Users cannot use the entire variety of custom data field names that can be created as dimensions to slice Cubes.
Several unwritten rules must be followed in v1.1.1 for a Cube slicing operation to succeed and not cause a stack trace. The rules are:
The regex that matches a name with the characteristics is:
[a-z]([a-z0-9_])*
.Several different failures or stacktraces will result based on violation of these rules:
Test Cases
All test cases begin with Reporting -> Cube -> + Add a dimension.
stringf
string g
string-h
StringI
string_j
Result explanations
Success
Success of this test means that the Modify link was clicked and the Director Host modification form was presented.
Failure: Got no such dimension
This is an invalid error message in the test case (G), because the field does exist. When the title of the cube is clicked, the following is given in the right panel:
Note that the error message is URL-encoded, perhaps this is why the comparsion to find the dimension failed.
Also please note that a better error message for a failed search would be "Dimension not found."
Failure: Modify 0 hosts
This is also a problem with the comparison in the search. Apparently the string to look for in the list of dimensions is lowercased before the search. When the title of the cube is clicked, the following is given in the right panel:
Clearly the search string was lowercased before the search, since it was displayed that way. And yet the code believes the search succeeded, because it wants to let you modify the Hosts. But there are zero (0) of them.
If the
Modify 0 hosts
link is clicked:Recent fixes
These tests were previously conducted on v1.1.0 and there were stacktraces produced for test cases G and H. v1.1.1 fixed test case H, and produces an invalid error message for case G.
To Reproduce
stringf
(all lowercase)string g
(with a space)string-h
(with a dash)StringI
(mixed case)string_j
(all lowercase with an underscore)Expected behavior
All given examples should work. All cases should present the correct list of Hosts for Director Modification.
Screenshots
Setup
Success
Failure: Got no such dimension
Failure: Failure: Modify 0 hosts
Your Environment
Additional context
There may be additional test cases I have not thought of.
Also, based on the limitations of column naming in MySQL, MariaDB and PostgreSQL, the maximum length of a custom data field that will succeed is 31 characters.