You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error is when trying to amend/update an icinga director service. To do an amend first I query the current service object using:
icingacli director service show --host="aslf02" 'check_juniper_load' --json --no-pretty
which returns the json output, I would then modify the keys/values and then submit the change back. However when pushing back the change (for example even if I don't change any fields and push back exactly the same record) I get the error:
ERROR: InvalidArgumentException in /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php:364 with message: Trying to set invalid key "fields"
The "director service show" command returns:
icingacli director service show --host="aslf02" 'check_juniper_load' --json --no-pretty
{"fields":[],"host":"aslf02","imports":["servicetemplate-XXXX","service-juniper-load"],"notes":"Added by icinga-import 10:14:56 13/12/2024","object_name":"check_juniper_load","object_type":"object","uuid":"198e50ba-73d8-4be8-979f-fae427918a2b","vars":{"ARG1":"20,30,40"}}
You can see the first json array returned is "fields". This isn't being set in my code anywhere, it seems to be a default parameter added either by director or icinga.
So if I then submit that back I get the error returned as it's trying to set the key "fields" which it states to be invalid.
In previous versions of icinga/icingacli this didn't occur, however my other installation is a much older install so this may be a few revisions since this crept in.
icingacli version
Icinga Web 2 2.12.2
Git Commit 7f9217b0521f19f770ad59ca17d7d4b3514e54e5
PHP Version 8.1.2-1ubuntu2.19
MODULE VERSION
director 1.11.3
incubator 0.22.0
monitoring 2.12.2
pnp 1.0.1
pulsant-theme 1.0.1
(For reference, my older install uses 2.7.3 which doesn't appear to have this issue)
If I do an "inspect" via the GUI I see no reference of this key "fields".
Looking at the code, the export I suspect is adding this is here:
/usr/share/icingaweb2/modules/director/library/Director/Data/Exporter.php
Actually, I think I'm looking in the wrong place. It could have custom fields defined, so the export seems correct in creating/exporting this value, however the import seems to be the problem.
On import it's hitting this failure:
This also happens when using the REST API.
The object you get is from the api contains the "fields" array but when you send it back to update something the "fields" array isn't allowed. I think this problem was introduced in 1.10.
moreamazingnick
added a commit
to RISE-GmbH/icingaweb2-module-director
that referenced
this issue
Jan 3, 2025
Describe the bug
The error is when trying to amend/update an icinga director service. To do an amend first I query the current service object using:
icingacli director service show --host="aslf02" 'check_juniper_load' --json --no-pretty
which returns the json output, I would then modify the keys/values and then submit the change back. However when pushing back the change (for example even if I don't change any fields and push back exactly the same record) I get the error:
The "director service show" command returns:
You can see the first json array returned is "fields". This isn't being set in my code anywhere, it seems to be a default parameter added either by director or icinga.
So if I then submit that back I get the error returned as it's trying to set the key "fields" which it states to be invalid.
In previous versions of icinga/icingacli this didn't occur, however my other installation is a much older install so this may be a few revisions since this crept in.
icingacli version
Icinga Web 2 2.12.2
Git Commit 7f9217b0521f19f770ad59ca17d7d4b3514e54e5
PHP Version 8.1.2-1ubuntu2.19
MODULE VERSION
director 1.11.3
incubator 0.22.0
monitoring 2.12.2
pnp 1.0.1
pulsant-theme 1.0.1
(For reference, my older install uses 2.7.3 which doesn't appear to have this issue)
If I do an "inspect" via the GUI I see no reference of this key "fields".
Looking at the code, the export I suspect is adding this is here:
/usr/share/icingaweb2/modules/director/library/Director/Data/Exporter.php
But I'm not clear if this should be exporting the property "fields" or not when it's clearly blank in my case?
The text was updated successfully, but these errors were encountered: