Closed fralla2 closed 2 years ago
@trasher Do you want me to test the fix on my setup or it's still have some work to do on it before? Thanks Francois
I think you can test on your environment. PR is not apporved yet; but I do not think there will be huge changes ;)
This looks like it did the trick 👍
Thanks @trasher
I see the same problem now that GLPI Inventory is activated but on another table :
[2022-10-03 10:25:03] glpisqllog.ERROR: DBmysql::query() in /var/www/html/glpi-10.0.3/src/DBmysql.php line 370
*** MySQL query error:
SQL: INSERT INTO glpi_devicecontrols
(designation
, manufacturers_id
, interfacetypes_id
, date_creation
, date_mod
) VALUES ('H81 Express LPC Controller', 'Intel Corporation', '217', '2022-10-03 10:24:59', '2022-10-03 10:24:59')
Error: Incorrect integer value: 'Intel Corporation' for column 'manufacturers_id' at row 1
Backtrace :
src/DBmysql.php:1312
src/CommonDBTM.php:716 DBmysql->insert()
src/CommonDBTM.php:1321 CommonDBTM->addToDB()
src/CommonDevice.php:512 CommonDBTM->add()
src/Inventory/Asset/Device.php:121 CommonDevice->import()
src/Inventory/Asset/Controller.php:98 Glpi\Inventory\Asset\Device->handle()
src/Inventory/Asset/MainAsset.php:847 Glpi\Inventory\Asset\Controller->handle()
src/Inventory/Asset/MainAsset.php:754 Glpi\Inventory\Asset\MainAsset->handleAssets()
src/RuleImportAsset.php:946 Glpi\Inventory\Asset\MainAsset->rulepassed()
src/Rule.php:1510 RuleImportAsset->executeActions()
src/RuleCollection.php:1591 Rule->process()
src/Inventory/Asset/MainAsset.php:554 RuleCollection->processAllRules()
src/Inventory/Inventory.php:701 Glpi\Inventory\Asset\MainAsset->handle()
src/Inventory/Inventory.php:336 Glpi\Inventory\Inventory->handleItem()
src/Inventory/Request.php:360 Glpi\Inventory\Inventory->doInventory()
src/Inventory/Request.php:90 Glpi\Inventory\Request->inventory()
src/Agent/Communication/AbstractRequest.php:305 Glpi\Inventory\Request->handleAction()
src/Agent/Communication/AbstractRequest.php:242 Glpi\Agent\Communication\AbstractRequest->handleXMLRequest()
front/inventory.php:86 Glpi\Agent\Communication\AbstractRequest->handleRequest()
{"user":"@host","mem_usage":"0.001\", 7.48Mio)"}
Are you sure the fix from the PR is still activated?
Yes the file src/Inventory/Asset/InventoryAsset.php still contains the fix
Yes the file src/Inventory/Asset/InventoryAsset.php still contains the fix
Well, that's another problem then... I've opened a new issue to investigate; I have no idea right now if I can reproduce or not.
Code of Conduct
Is there an existing issue for this?
Version
10.0.3
Bug description
When having dictionary rule active for manufacturer (might also affect other dictionary rules too), the name is returned instead of the id when trying to import the device in GLPI using native inventory. This throws errors like this one and prevent import of the new device
Error: Incorrect integer value: 'Dell, Inc.' for column 'manufacturers_id' at row 1
Relevant log output
Page URL
No response
Steps To reproduce
Create a dictionary rule for the computer manufacturer like this one :
Try to import the computer to native glpi inventory (this throw a lot of error in the log files related to incorrect integer value
Disable the dictionary rule
Try to import again (works fine)
Note : This was working correctly in GLPI 9.5.7
Your GLPI setup information
Informations sur le système, l'installation et la configuration
Server
GLPI constants
Libraries
REDACTED
SQL replicas
Notifications
Plugins list
Anything else?
No response