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
When activing plugin, there is a strange error in php errors log when an inventory is raised
index 'glpiname' not found..
if i deactivate plugin database inventory : no more error
remark :
in 1.0.0 i had error with id not found
[2025-09-01 10:05:04] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "id" in D:\wamp\www\glpi\plugins\databaseinventory\inc\task.class.php at line 177
If the use is well this one :
Agent contacts glpi server to get db parameters in order to process inventory....
in fact, As i defined 3 computers in the plugin databaseinventory, I think any other agents fails fetching databaseinventory id...
So perhaps a "monitor" misses ?
I think it's ok : no error for the moment.
but, I will wait for 'all' computer defined in the static group :
Do you confirm that database inventory (for the case it's mysql db) must be done by the agent ?
what do you mean by 'socket' ?
Thanks
Edit :
Still same error
[2025-09-02 14:52:04] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "glpiname" in D:\wamp\www\glpi\src\Search.php at line 729
Backtrace :
...nventory\inc\computergroupdynamic.class.php:189 Search::constructSQL()
plugins\databaseinventory\inc\task.class.php:244 PluginDatabaseinventoryComputerGroupDynamic->isDynamicSearchMatchComputer()
src\Plugin.php:1763 PluginDatabaseinventoryTask::handleInventoryTask()
src\Inventory\Request.php:420 Plugin::doHookFunction()
src\Inventory\Request.php:130 Glpi\Inventory\Request->handleInventoryTask()
src\Inventory\Request.php:340 Glpi\Inventory\Request->handleTask()
src\Inventory\Request.php:83 Glpi\Inventory\Request->contact()
src\Agent\Communication\AbstractRequest.php:359 Glpi\Inventory\Request->handleAction()
src\Agent\Communication\AbstractRequest.php:271 Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
front\inventory.php:100 Glpi\Agent\Communication\AbstractRequest->handleRequest()
plugins\glpiinventory\front\communication.php:72 include_once()
plugins\glpiinventory\index.php:45 include_once()
Here are the lines updated :
private function countDynamicItems()
{
$search_params = Search::manageParams('Computer', unserialize($this->fields['search']));
$data = Search::prepareDatasForSearch('Computer', $search_params);
in fact
in dynamic group I choose computer with name contains GLPI -> 5 computers are presents -> I save the requets
in table computergroupdynamics :
a:4:{s:10:"is_deleted";s:1:"0";s:6:"as_map";s:1:"0";s:8:"criteria";a:1:{i:0;a:4:{s:4:"link";s:3:"AND";s:5:"field";s:1:"1";s:10:"searchtype";s:8:"contains";s:5:"value";s:4:"glpi";}}s:12:"metacriteria";a:0:{}}
but at agents levels
any computers raises : ok
but some inventorys raises (I have contact AND inventory dates updated) (the name does not contain GLPI) and are coming from FusionInventory)
some others are not . their name doens contain GLPI too but there are from GLPI-agent (whch contain GLPI) .
so for me there is something wrong with the check...
When i delete ths record in the table : the inventory (of a computer which was not inventoried) raises
Activity
EC2311 commentedon Sep 2, 2025
If the use is well this one :
Agent contacts glpi server to get db parameters in order to process inventory....
in fact, As i defined 3 computers in the plugin databaseinventory, I think any other agents fails fetching databaseinventory id...
So perhaps a "monitor" misses ?
stonebuzz commentedon Sep 2, 2025
@EC2311
can you check -> #74
EC2311 commentedon Sep 2, 2025
I think it's ok : no error for the moment.
but, I will wait for 'all' computer defined in the static group :
Do you confirm that database inventory (for the case it's mysql db) must be done by the agent ?
what do you mean by 'socket' ?
Thanks
Edit :
Still same error
[2025-09-02 14:52:04] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "glpiname" in D:\wamp\www\glpi\src\Search.php at line 729
Backtrace :
...nventory\inc\computergroupdynamic.class.php:189 Search::constructSQL()
plugins\databaseinventory\inc\task.class.php:244 PluginDatabaseinventoryComputerGroupDynamic->isDynamicSearchMatchComputer()
src\Plugin.php:1763 PluginDatabaseinventoryTask::handleInventoryTask()
src\Inventory\Request.php:420 Plugin::doHookFunction()
src\Inventory\Request.php:130 Glpi\Inventory\Request->handleInventoryTask()
src\Inventory\Request.php:340 Glpi\Inventory\Request->handleTask()
src\Inventory\Request.php:83 Glpi\Inventory\Request->contact()
src\Agent\Communication\AbstractRequest.php:359 Glpi\Inventory\Request->handleAction()
src\Agent\Communication\AbstractRequest.php:271 Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
front\inventory.php:100 Glpi\Agent\Communication\AbstractRequest->handleRequest()
plugins\glpiinventory\front\communication.php:72 include_once()
plugins\glpiinventory\index.php:45 include_once()
Here are the lines updated :
private function countDynamicItems()
{
$search_params = Search::manageParams('Computer', unserialize($this->fields['search']));
$data = Search::prepareDatasForSearch('Computer', $search_params);
stonebuzz commentedon Sep 2, 2025
That’s unusual. Could you please try resetting the GLPI cache with the following command,
php bin/console cache:clearand then restart the web server?
Best regards,
EC2311 commentedon Sep 2, 2025
I cleared cache, but command is not successfull : some directory were not deleted
I restarted services (wamp)
same errors
when plugin not activated -> no error
stonebuzz commentedon Sep 2, 2025
I’m not a WAMP expert. Could you please try deleting the contents of the glpi/files/_cache/ directory manually instead of using the command?
EC2311 commentedon Sep 2, 2025
in fact by debugging it fails in function isdynamicsearchmatchcomputer,
searching for "glpiname"
I put in comment the lines
as soon as I remove comment of the line
if ($dynamic_group->isDynamicSearchMatchComputer($computer))
errors in php errors log with glpiname
EC2311 commentedon Sep 2, 2025
I wonder if it's not due to a record in
glpi_plugin_databaseinventory_computergroupdynamics
there was a record (for which I attempt to filter using name contains "glpi"
I deleted record in it : I have no more error at all :)
So I just re-add a dynamic group (name contains GLPI) -> 5 computers in it.
For the moment : no error
Was there a mismatch in the previous filter ?
EC2311 commentedon Sep 2, 2025
again error with dynamic group/
-> the name of computer doesn't match the filter
-> the agent is glpi-1.12 : name contains glpi...
I have no error on computers with FusionInventory agent (the name of agent does'nt contains glpi...)
I try to remove filter using
I delete record in the table directly : no more error
so it's linked with the data in dynamic group
stonebuzz commentedon Sep 3, 2025
Sorry, I fixed the issue in the wrong place.
I’ve updated the PR, so could you please revert your changes and apply this patch instead?
https://patch-diff.githubusercontent.com/raw/pluginsGLPI/databaseinventory/pull/74.diff
Best regards
EC2311 commentedon Sep 3, 2025
still have error with glpiname :(
Undefined array key "glpiname" in D:\wamp\www\glpi\plugins\databaseinventory\inc\computergroupdynamic.class.php at line 182
unless error : glpiname matchs with connected user
and in batch, no connected user ?
EC2311 commentedon Sep 3, 2025
here is what I did :
and $_Session :
no more error, but the date inventory in the computer is not set, as if there was other thing wrong (the contact date is ok)
as soon I delete record in group dynamic :-> all is right
so for me the inventory with dynamic group is not "right"
stonebuzz commentedon Sep 3, 2025
I’ve updated the PR, so could you please revert your changes and apply this patch instead?
https://patch-diff.githubusercontent.com/raw/pluginsGLPI/databaseinventory/pull/74.diff
EC2311 commentedon Sep 3, 2025
so
no error on php logs.
but i am not sure of good running of the program
in fact
in dynamic group I choose computer with name contains GLPI -> 5 computers are presents -> I save the requets
in table computergroupdynamics :
a:4:{s:10:"is_deleted";s:1:"0";s:6:"as_map";s:1:"0";s:8:"criteria";a:1:{i:0;a:4:{s:4:"link";s:3:"AND";s:5:"field";s:1:"1";s:10:"searchtype";s:8:"contains";s:5:"value";s:4:"glpi";}}s:12:"metacriteria";a:0:{}}
but at agents levels
any computers raises : ok
but some inventorys raises (I have contact AND inventory dates updated) (the name does not contain GLPI) and are coming from FusionInventory)
some others are not . their name doens contain GLPI too but there are from GLPI-agent (whch contain GLPI) .
so for me there is something wrong with the check...
When i delete ths record in the table : the inventory (of a computer which was not inventoried) raises
stonebuzz commentedon Sep 3, 2025
For me it's another problem, can you create a dedicated issue