glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.1k stars 1.27k forks source link

[Glpi 10.0.12] Excessive logging of the message: Error: Deadlock found when trying to get lock; try restarting transaction #16717

Closed SilvaFernando closed 2 months ago

SilvaFernando commented 6 months ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.12

Bug description

Hi team, on SQL-errors.log I have many errors like this:

[2024-03-06 09:26:25] glpisqllog.ERROR: DBmysql::doQuery() in /usr/share/glpi/src/DBmysql.php line 403 *** MySQL query error: SQL: UPDATE glpi_softwares SET softwarecategories_id = '2', date_mod = '2024-03-06 09:24:14' WHERE id = '45785' Error: Deadlock found when trying to get lock; try restarting transaction Backtrace : src/DBmysql.php:1503 DBmysql->doQuery() src/CommonDBTM.php:692 DBmysql->update() src/CommonDBTM.php:1701 CommonDBTM->updateInDB() src/Inventory/Asset/Software.php:407 CommonDBTM->update() src/Inventory/Asset/MainAsset.php:1001 Glpi\Inventory\Asset\Software->handle() src/Inventory/Asset/MainAsset.php:916 Glpi\Inventory\Asset\MainAsset->handleAssets() src/RuleImportAsset.php:981 Glpi\Inventory\Asset\MainAsset->rulepassed() src/Rule.php:1531 RuleImportAsset->executeActions() src/RuleCollection.php:1660 Rule->process() src/Inventory/Asset/MainAsset.php:582 RuleCollection->processAllRules() src/Inventory/Inventory.php:724 Glpi\Inventory\Asset\MainAsset->handle() src/Inventory/Inventory.php:355 Glpi\Inventory\Inventory->handleItem() src/Inventory/Request.php:364 Glpi\Inventory\Inventory->doInventory() src/Inventory/Request.php:90 Glpi\Inventory\Request->inventory() src/Agent/Communication/AbstractRequest.php:359 Glpi\Inventory\Request->handleAction() src/Agent/Communication/AbstractRequest.php:271 Glpi\Agent\Communication\AbstractRequest->handleJSONRequest() front/inventory.php:95 Glpi\Agent\Communication\AbstractRequest->handleRequest() index.php:93 include_once() public/index.php:82 require() {"user":"inventory@app-glp1-prd1","mem_usage":"31.489\", 15.62Mio)"}

[2024-03-06 09:26:26] glpisqllog.ERROR: DBmysql::doQuery() in /usr/share/glpi/src/DBmysql.php line 403 *** MySQL query error: SQL: UPDATE glpi_softwares SET softwarecategories_id = '2', date_mod = '2024-03-06 09:23:44' WHERE id = '33655' Error: Lock wait timeout exceeded; try restarting transaction Backtrace : src/DBmysql.php:1503 DBmysql->doQuery() src/CommonDBTM.php:692 DBmysql->update() src/CommonDBTM.php:1701 CommonDBTM->updateInDB() src/Inventory/Asset/Software.php:407 CommonDBTM->update() src/Inventory/Asset/MainAsset.php:1001 Glpi\Inventory\Asset\Software->handle() src/Inventory/Asset/MainAsset.php:916 Glpi\Inventory\Asset\MainAsset->handleAssets() src/RuleImportAsset.php:981 Glpi\Inventory\Asset\MainAsset->rulepassed() src/Rule.php:1531 RuleImportAsset->executeActions() src/RuleCollection.php:1660 Rule->process() src/Inventory/Asset/MainAsset.php:582 RuleCollection->processAllRules() src/Inventory/Inventory.php:724 Glpi\Inventory\Asset\MainAsset->handle() src/Inventory/Inventory.php:355 Glpi\Inventory\Inventory->handleItem() src/Inventory/Request.php:364 Glpi\Inventory\Inventory->doInventory() src/Inventory/Request.php:90 Glpi\Inventory\Request->inventory() src/Agent/Communication/AbstractRequest.php:359 Glpi\Inventory\Request->handleAction() src/Agent/Communication/AbstractRequest.php:271 Glpi\Agent\Communication\AbstractRequest->handleJSONRequest() front/inventory.php:95 Glpi\Agent\Communication\AbstractRequest->handleRequest() index.php:93 include_once() public/index.php:82 require() {"user":"inventory@app-glp1-prd1","mem_usage":"50.606\", 16.19Mio)"}

After this error my GLPI gives a timeout error, can you help me?

Relevant log output

[2024-03-06 09:26:25] glpisqllog.ERROR: DBmysql::doQuery() in /usr/share/glpi/src/DBmysql.php line 403
  *** MySQL query error:
  SQL: UPDATE `glpi_softwares` SET `softwarecategories_id` = '2', `date_mod` = '2024-03-06 09:24:14' WHERE `id` = '45785'
  Error: Deadlock found when trying to get lock; try restarting transaction
  Backtrace :
  src/DBmysql.php:1503                               DBmysql->doQuery()
  src/CommonDBTM.php:692                             DBmysql->update()
  src/CommonDBTM.php:1701                            CommonDBTM->updateInDB()
  src/Inventory/Asset/Software.php:407               CommonDBTM->update()
  src/Inventory/Asset/MainAsset.php:1001             Glpi\Inventory\Asset\Software->handle()
  src/Inventory/Asset/MainAsset.php:916              Glpi\Inventory\Asset\MainAsset->handleAssets()
  src/RuleImportAsset.php:981                        Glpi\Inventory\Asset\MainAsset->rulepassed()
  src/Rule.php:1531                                  RuleImportAsset->executeActions()
  src/RuleCollection.php:1660                        Rule->process()
  src/Inventory/Asset/MainAsset.php:582              RuleCollection->processAllRules()
  src/Inventory/Inventory.php:724                    Glpi\Inventory\Asset\MainAsset->handle()
  src/Inventory/Inventory.php:355                    Glpi\Inventory\Inventory->handleItem()
  src/Inventory/Request.php:364                      Glpi\Inventory\Inventory->doInventory()
  src/Inventory/Request.php:90                       Glpi\Inventory\Request->inventory()
  src/Agent/Communication/AbstractRequest.php:359    Glpi\Inventory\Request->handleAction()
  src/Agent/Communication/AbstractRequest.php:271    Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
  front/inventory.php:95                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  index.php:93                                       include_once()
  public/index.php:82                                require()
  {"user":"inventory@app-glp1-prd1","mem_usage":"31.489\", 15.62Mio)"}

[2024-03-06 09:26:26] glpisqllog.ERROR: DBmysql::doQuery() in /usr/share/glpi/src/DBmysql.php line 403
  *** MySQL query error:
  SQL: UPDATE `glpi_softwares` SET `softwarecategories_id` = '2', `date_mod` = '2024-03-06 09:23:44' WHERE `id` = '33655'
  Error: Lock wait timeout exceeded; try restarting transaction
  Backtrace :
  src/DBmysql.php:1503                               DBmysql->doQuery()
  src/CommonDBTM.php:692                             DBmysql->update()
  src/CommonDBTM.php:1701                            CommonDBTM->updateInDB()
  src/Inventory/Asset/Software.php:407               CommonDBTM->update()
  src/Inventory/Asset/MainAsset.php:1001             Glpi\Inventory\Asset\Software->handle()
  src/Inventory/Asset/MainAsset.php:916              Glpi\Inventory\Asset\MainAsset->handleAssets()
  src/RuleImportAsset.php:981                        Glpi\Inventory\Asset\MainAsset->rulepassed()
  src/Rule.php:1531                                  RuleImportAsset->executeActions()
  src/RuleCollection.php:1660                        Rule->process()
  src/Inventory/Asset/MainAsset.php:582              RuleCollection->processAllRules()
  src/Inventory/Inventory.php:724                    Glpi\Inventory\Asset\MainAsset->handle()
  src/Inventory/Inventory.php:355                    Glpi\Inventory\Inventory->handleItem()
  src/Inventory/Request.php:364                      Glpi\Inventory\Inventory->doInventory()
  src/Inventory/Request.php:90                       Glpi\Inventory\Request->inventory()
  src/Agent/Communication/AbstractRequest.php:359    Glpi\Inventory\Request->handleAction()
  src/Agent/Communication/AbstractRequest.php:271    Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
  front/inventory.php:95                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  index.php:93                                       include_once()
  public/index.php:82                                require()
  {"user":"inventory@app-glp1-prd1","mem_usage":"50.606\", 16.19Mio)"}

Page URL

127.0.0.1/glpi

Steps To reproduce

I'm just using the GLPI Inventory. I have more less than 5000 computers on my GLPI.

Your GLPI setup information

No response

Anything else?

No response

EC2311 commented 5 months ago

I have the same problem GLPI V10.0.10 the line is 379 (instead of 403), for any asset (glpi_monitors, glpi_items_softwareversions...) [2024-04-03 21:27:48] glpisqllog.ERROR: DBmysql::query() in D:\wamp\www\glpi\src\DBmysql.php line 379 *** MySQL query error: SQL: UPDATE glpi_monitors SET name = 'Smart Cable', manufacturers_id = '134', monitormodels_id = '6', date_mod = '2024-04-03 21:27:34' WHERE id = '6' Error: Deadlock découvert en essayant d'obtenir les verrous : essayez de redémarrer la transaction Backtrace : src\DBmysql.php:1468
src\CommonDBTM.php:686 DBmysql->update() src\CommonDBTM.php:1675 CommonDBTM->updateInDB() src\Inventory\Asset\Monitor.php:168 CommonDBTM->update() src\Inventory\Asset\MainAsset.php:937 Glpi\Inventory\Asset\Monitor->handle() src\Inventory\Asset\MainAsset.php:852 Glpi\Inventory\Asset\MainAsset->handleAssets() src\RuleImportAsset.php:969 Glpi\Inventory\Asset\MainAsset->rulepassed() src\Rule.php:1533 RuleImportAsset->executeActions() src\RuleCollection.php:1640 Rule->process() src\Inventory\Asset\MainAsset.php:574 RuleCollection->processAllRules() src\Inventory\Inventory.php:736 Glpi\Inventory\Asset\MainAsset->handle() src\Inventory\Inventory.php:353 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:332 Glpi\Inventory\Request->handleAction() src\Agent\Communication\AbstractRequest.php:269 Glpi\Agent\Communication\AbstractRequest->handleXMLRequest() front\inventory.php:94 Glpi\Agent\Communication\AbstractRequest->handleRequest() plugins\glpiinventory\front\communication.php:72 include_once() plugins\glpiinventory\index.php:51 include_once()

github-actions[bot] commented 3 months ago

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.