glpi-inventory-plugin icon indicating copy to clipboard operation
glpi-inventory-plugin copied to clipboard

glpi.CRITICAL: *** Uncaught PHP Exception TypeError: "Safe\json_decode(): Argument #1 ($json) must be of type string, null given, called in ./marketplace/glpiinventory/inc/deploycommon.class.php on line 334" at special_cases.php line 35

Open jluis144 opened this issue 4 weeks ago • 3 comments

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • [x] I have searched the existing issues

GLPI Version

11.0.2

Plugin version

1.6.1

Bug description

after migration to GLPI 11.0.2 and GLPI upgrade to 1.6.1, I have this erro on "php-errors.log" file

- error 1 06-11-2025 09:47 glpi.CRITICAL: *** Uncaught PHP Exception TypeError: "Safe\json_decode(): Argument #1 ($json) must be of type string, null given, called in ./marketplace/glpiinventory/inc/deploycommon.class.php on line 334" at special_cases.php line 35 Backtrace : ... /thecodingmachine/safe/lib/special_cases.php:35 ... ce/glpiinventory/inc/deploycommon.class.php:334 Safe\json_decode() ... lace/glpiinventory/public/b/deploy/index.php:91 PluginGlpiinventoryDeployCommon->run() ... Glpi/Controller/LegacyFileLoadController.php:64 require() ./vendor/symfony/http-kernel/HttpKernel.php:181 ./vendor/symfony/http-kernel/HttpKernel.php:76 ./vendor/symfony/http-kernel/Kernel.php:197 ./public/index.php:70

- error 2 06-11-2025 09:48 glpi.WARNING: *** Warning: Undefined array key "json" at deploycommon.class.php line 334 Backtrace : ... ce/glpiinventory/inc/deploycommon.class.php:334 ... lace/glpiinventory/public/b/deploy/index.php:91 PluginGlpiinventoryDeployCommon->run() ... Glpi/Controller/LegacyFileLoadController.php:64 require() ./vendor/symfony/http-kernel/HttpKernel.php:181 ./vendor/symfony/http-kernel/HttpKernel.php:76 ./vendor/symfony/http-kernel/Kernel.php:197 ./public/index.php:70

deploy jobs do not happen on Clients

Relevant log output


Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

jluis144 avatar Nov 06 '25 11:11 jluis144

I think it's not expected to get a null value at this point.

Taskjob itself is probably incorrect. Was it updated from a previous version, or created recently?

trasher avatar Nov 06 '25 11:11 trasher

hello,

how do i know which task are we talking about? there are a total of 72 tasks, only one or two are new, the rest have been migrated from version 9.x to 10.x to 11.x

and, what is a new task? if a task is cloned, it's considered "created recently" or "updated from a previous version"? I ask this because I have cloned a lot of tasks, and deleted de originals

jluis144 avatar Nov 06 '25 19:11 jluis144

Check the json column of the glpi_plugin_glpiinventory_deploypackages table; as far as I understood, this should always contains a valid JSON, and you have a null one.

trasher avatar Nov 07 '25 07:11 trasher

i have data in all JSON columns (if all are valid JSON I dont know how to confirm)

while checking for that, i noticed that in some rows, the UUID columns have NULL values

is there any way to get/find the exact Package that is causing this error?

thanks in advance, Jose Luis

jluis144 avatar Nov 08 '25 09:11 jluis144

Invalid JSON would not break on this line according to the code. I guess the problem is glpi_plugin_glpiinventory_taskjobstates entry references a missing object.

Please test #799

trasher avatar Nov 10 '25 06:11 trasher