glpi-project / glpi-inventory-plugin

GLPI Inventory plugin
GNU Affero General Public License v3.0
46 stars 27 forks source link

Wakeupagent did not start and errors in php-error.log #327

Closed eric95630 closed 1 year ago

eric95630 commented 1 year ago

Describe the bug

Hello,

The wakeupagent task did not start, no agent are waked up. And I have errors in the php-error.log The agents are waked up when I force a sync on the computer page.

Thanks for your help

Php log

`[2023-03-06 14:15:01] glpiphplog.WARNING: *** PHP User Warning (512): Invalid item "Agent" (112). in /var/www/glpi/marketplace/glpiinventory/inc/task.class.php at line 833 Backtrace : marketplace/glpiinventory/inc/task.class.php:833 trigger_error() marketplace/glpiinventory/inc/task.class.php:663 PluginGlpiinventoryTask->getAgentsFromActors() marketplace/glpiinventory/inc/task.class.php:913 PluginGlpiinventoryTask->prepareTaskjobs() src/CronTask.php:1018 PluginGlpiinventoryTask::cronTaskscheduler() front/cron.php:84 CronTask::launch()

[2023-03-06 14:15:01] glpiphplog.WARNING: *** PHP User Warning (512): Invalid item "Agent" (311). in /var/www/glpi/marketplace/glpiinventory/inc/task.class.php at line 833 Backtrace : marketplace/glpiinventory/inc/task.class.php:833 trigger_error() marketplace/glpiinventory/inc/task.class.php:663 PluginGlpiinventoryTask->getAgentsFromActors() marketplace/glpiinventory/inc/task.class.php:913 PluginGlpiinventoryTask->prepareTaskjobs() src/CronTask.php:1018 PluginGlpiinventoryTask::cronTaskscheduler() front/cron.php:84 CronTask::launch()

[2023-03-06 14:15:01] glpiphplog.WARNING: *** PHP User Warning (512): Invalid item "Agent" (311). in /var/www/glpi/marketplace/glpiinventory/inc/task.class.php at line 833 Backtrace : marketplace/glpiinventory/inc/task.class.php:833 trigger_error() marketplace/glpiinventory/inc/task.class.php:663 PluginGlpiinventoryTask->getAgentsFromActors() marketplace/glpiinventory/inc/task.class.php:913 PluginGlpiinventoryTask->prepareTaskjobs() src/CronTask.php:1018 PluginGlpiinventoryTask::cronTaskscheduler() front/cron.php:84 CronTask::launch()

[2023-03-06 14:15:01] glpiphplog.WARNING: *** PHP User Warning (512): Invalid item "Agent" (112). in /var/www/glpi/marketplace/glpiinventory/inc/task.class.php at line 833 Backtrace : marketplace/glpiinventory/inc/task.class.php:833 trigger_error() marketplace/glpiinventory/inc/task.class.php:663 PluginGlpiinventoryTask->getAgentsFromActors() marketplace/glpiinventory/inc/task.class.php:913 PluginGlpiinventoryTask->prepareTaskjobs() src/CronTask.php:1018 PluginGlpiinventoryTask::cronTaskscheduler() front/cron.php:84 CronTask::launch()

[2023-03-06 14:15:01] glpiphplog.CRITICAL: *** Uncaught Exception Error: Class name must be a valid object or a string in /var/www/glpi/src/Agent.php at line 527 Backtrace : src/Agent.php:544 Agent->getLinkedItem() src/Agent.php:644 Agent->guessAddresses() src/Agent.php:680 Agent->getAgentURLs() src/Agent.php:730 Agent->requestAgent() ...ace/glpiinventory/inc/agentwakeup.class.php:179 Agent->requestStatus() src/CronTask.php:1018 PluginGlpiinventoryAgentWakeup::cronWakeupAgents() front/cron.php:84 CronTask::launch()

[2023-03-06 14:17:33] glpiphplog.CRITICAL: *** Uncaught Exception Error: Class name must be a valid object or a string in /var/www/glpi/src/Agent.php at line 527 Backtrace : src/Agent.php:544 Agent->getLinkedItem() src/Agent.php:644 Agent->guessAddresses() src/Agent.php:680 Agent->getAgentURLs() src/Agent.php:730 Agent->requestAgent() ...ace/glpiinventory/inc/agentwakeup.class.php:179 Agent->requestStatus() src/CronTask.php:1018 PluginGlpiinventoryAgentWakeup::cronWakeupAgents() front/crontask.form.php:52 CronTask::launch()`

To reproduce

Ask software self install. Nothing happen until I force the sync

Expected behavior

Agent wakeup and start installation of self-service software

Operating system

Windows

GLPI Agent version

1.4

GLPI version

10.0.6

GLPIInventory plugin

1.1.0

Additional context

No response

stonebuzz commented 1 year ago

Hi @eric95630 can you check this -> https://github.com/glpi-project/glpi-inventory-plugin/issues/313

stonebuzz commented 1 year ago

For information this error is triggered when the Agent (with the ID 112, 311 in your case) does not exist in GLPI

It doesn't stop the script (it's 'just' a notification by the plugin in the logs).

eric95630 commented 1 year ago

Thank you for your feedback. I have checked and indeed these agents do not exist. However, I don't know why they are notified because I don't have any tasks with these actors! However, this does not prevent the wakeupagent task from waking up my agents when this task is executed. On the other hand, the agents are well woken up when I force the installation or if I force an inventory from the agent's page. Thanks for your help.