You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-05-22 10:56:07

TouTUN
Member
Registered: 2023-04-07
Posts: 4

netinventory duplicate entry

Hello,

GLPI : 10.0.7
GLPI Inventory : 1.2

I've got some duplicate problems with the netinventory that i do'nt understand sad

I made a task which inventory 350 swicth and then injection the xml file in my glpi. I do that because i don't want to scan the remote networks with a netdiscovery task. it's work fine, the inventory of the switchs take about 10mn.

But during the import of the result i've got that error on the agent : (i upload to the marketplace/glpiinventory/ url)

"ERROR: Unexpected empty server response"


and on the server i've got that error :

[2023-05-22 10:31:05] glpiphplog.ERROR:   *** PHP User Error (256): Duplicate entry '142198-1' for key 'unicity' in /data/www/glpi/src/DBmysql.php at line 1969
  Backtrace :
  src/DBmysql.php:1969                               trigger_error()
  src/Inventory/Asset/NetworkPort.php:532            DBmysql->executeStatement()
  src/Inventory/Asset/NetworkPort.php:632            Glpi\Inventory\Asset\NetworkPort->handleVlans()
  src/Inventory/Asset/NetworkPort.php:621            Glpi\Inventory\Asset\NetworkPort->portChanged()
  src/Inventory/Asset/InventoryNetworkPort.php:512   Glpi\Inventory\Asset\NetworkPort->portUpdated()
  src/Inventory/Asset/InventoryNetworkPort.php:121   Glpi\Inventory\Asset\NetworkPort->handleUpdates()
  src/Inventory/Asset/NetworkPort.php:815            Glpi\Inventory\Asset\NetworkPort->handlePortsTrait()
  src/Inventory/Asset/NetworkPort.php:616            Glpi\Inventory\Asset\NetworkPort->handlePorts()
  src/Inventory/Asset/MainAsset.php:921              Glpi\Inventory\Asset\NetworkPort->handle()
  src/Inventory/Asset/MainAsset.php:841              Glpi\Inventory\Asset\MainAsset->handleAssets()
  src/Inventory/Asset/NetworkEquipment.php:228       Glpi\Inventory\Asset\MainAsset->rulepassed()
  src/RuleImportAsset.php:969                        Glpi\Inventory\Asset\NetworkEquipment->rulepassed()
  src/Rule.php:1525                                  RuleImportAsset->executeActions()
  src/RuleCollection.php:1625                        Rule->process()
  src/Inventory/Asset/MainAsset.php:575              RuleCollection->processAllRules()
  src/Inventory/Inventory.php:710                    Glpi\Inventory\Asset\MainAsset->handle()
  src/Inventory/Inventory.php:341                    Glpi\Inventory\Inventory->handleItem()
  src/Inventory/Request.php:360                      Glpi\Inventory\Inventory->doInventory()
  src/Inventory/Request.php:283                      Glpi\Inventory\Request->inventory()
  src/Inventory/Request.php:250                      Glpi\Inventory\Request->network()
  src/Inventory/Request.php:98                       Glpi\Inventory\Request->networkInventory()
  src/Agent/Communication/AbstractRequest.php:332    Glpi\Inventory\Request->handleAction()
  src/Agent/Communication/AbstractRequest.php:269    Glpi\Agent\Communication\AbstractRequest->handleXMLRequest()
  front/inventory.php:92                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  ...tplace/glpiinventory/front/communication.php:72 include_once()
  marketplace/glpiinventory/index.php:45             include_once()



And i've got that error too in sql.error :

[2023-05-22 09:30:49] glpisqllog.ERROR: DBmysql::query() in /data/www/glpi/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: DELETE `glpi_networkports_networkports` FROM `glpi_networkports_networkports` WHERE `id` = '177133'
  Error: Deadlock found when trying to get lock; try restarting transaction
  Backtrace :
  src/DBmysql.php:1550
  src/CommonDBTM.php:794                             DBmysql->delete()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  src/NetworkPort_NetworkPort.php:187                CommonDBTM->delete()
  src/NetworkPort_NetworkPort.php:138                NetworkPort_NetworkPort->disconnectFrom()
  src/Inventory/Asset/NetworkPort.php:872            NetworkPort_NetworkPort->connectToHub()
  src/Inventory/Asset/NetworkPort.php:368            Glpi\Inventory\Asset\NetworkPort->handleHub()
  src/Inventory/Asset/NetworkPort.php:609            Glpi\Inventory\Asset\NetworkPort->handleMacConnection()
  src/Inventory/Asset/NetworkPort.php:631            Glpi\Inventory\Asset\NetworkPort->handleConnections()
  src/Inventory/Asset/NetworkPort.php:621            Glpi\Inventory\Asset\NetworkPort->portChanged()
  src/Inventory/Asset/InventoryNetworkPort.php:512   Glpi\Inventory\Asset\NetworkPort->portUpdated()
  src/Inventory/Asset/InventoryNetworkPort.php:121   Glpi\Inventory\Asset\NetworkPort->handleUpdates()
  src/Inventory/Asset/NetworkPort.php:815            Glpi\Inventory\Asset\NetworkPort->handlePortsTrait()
  src/Inventory/Asset/NetworkPort.php:616            Glpi\Inventory\Asset\NetworkPort->handlePorts()
  src/Inventory/Asset/MainAsset.php:921              Glpi\Inventory\Asset\NetworkPort->handle()
  src/Inventory/Asset/MainAsset.php:841              Glpi\Inventory\Asset\MainAsset->handleAssets()
  src/Inventory/Asset/NetworkEquipment.php:228       Glpi\Inventory\Asset\MainAsset->rulepassed()
  src/RuleImportAsset.php:969                        Glpi\Inventory\Asset\NetworkEquipment->rulepassed()
  src/Rule.php:1525                                  RuleImportAsset->executeActions()
  src/RuleCollection.php:1625                        Rule->process()
  src/Inventory/Asset/MainAsset.php:575              RuleCollection->processAllRules()
  src/Inventory/Inventory.php:710                    Glpi\Inventory\Asset\MainAsset->handle()
  src/Inventory/Inventory.php:341                    Glpi\Inventory\Inventory->handleItem()
  src/Inventory/Request.php:360                      Glpi\Inventory\Inventory->doInventory()
  src/Inventory/Request.php:283                      Glpi\Inventory\Request->inventory()
  src/Inventory/Request.php:250                      Glpi\Inventory\Request->network()
  src/Inventory/Request.php:98                       Glpi\Inventory\Request->networkInventory()
  src/Agent/Communication/AbstractRequest.php:332    Glpi\Inventory\Request->handleAction()
  src/Agent/Communication/AbstractRequest.php:269    Glpi\Agent\Communication\AbstractRequest->handleXMLRequest()
  front/inventory.php:92                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  ...tplace/glpiinventory/front/communication.php:72 include_once()
  marketplace/glpiinventory/index.php:45             include_once()


If i delete the switch and all his component from the server, i works again for a moment. Last week, i've got 2 or 3 siwtch like that and now i've got 20 !

Is someone have the same issue or better is somone have an idea to resole my problem ?

Regards

Last edited by TouTUN (2023-05-22 12:09:42)

Offline

#2 2023-05-23 10:11:45

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: netinventory duplicate entry

Hello,
a colleague told me you should empty the following tables: glpi_networkports_networkports, glpi_vlans and glpi_networkports_vlans
Then you have to import again your switches.
If the problem occurs again after that, you'll have to open an issue on the GLPI project.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#3 2023-06-13 09:30:58

TouTUN
Member
Registered: 2023-04-07
Posts: 4

Re: netinventory duplicate entry

Hi,
Thanks for the reply, i had test but still get the same issue sad

  *** MySQL query error:
  SQL: INSERT INTO `glpi_networkports_networkports` (`networkports_id_1`, `networkports_id_2`) VALUES ('696619', '653215')
  Error: Duplicate entry '696619-653215' for key 'unicity'
  Backtrace :
  src/DBmysql.php:1320
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/Inventory/Asset/NetworkPort.php:923            CommonDBTM->add()
  src/Inventory/Asset/NetworkPort.php:318            Glpi\Inventory\Asset\NetworkPort->addPortsWiring()
  src/Inventory/Asset/NetworkPort.php:607            Glpi\Inventory\Asset\NetworkPort->handleLLDPConnection()
  src/Inventory/Asset/NetworkPort.php:631            Glpi\Inventory\Asset\NetworkPort->handleConnections()
  src/Inventory/Asset/NetworkPort.php:621            Glpi\Inventory\Asset\NetworkPort->portChanged()
  src/Inventory/Asset/InventoryNetworkPort.php:512   Glpi\Inventory\Asset\NetworkPort->portUpdated()
  src/Inventory/Asset/InventoryNetworkPort.php:121   Glpi\Inventory\Asset\NetworkPort->handleUpdates()
  src/Inventory/Asset/NetworkPort.php:815            Glpi\Inventory\Asset\NetworkPort->handlePortsTrait()
  src/Inventory/Asset/NetworkPort.php:616            Glpi\Inventory\Asset\NetworkPort->handlePorts()
  src/Inventory/Asset/MainAsset.php:921              Glpi\Inventory\Asset\NetworkPort->handle()
  src/Inventory/Asset/MainAsset.php:841              Glpi\Inventory\Asset\MainAsset->handleAssets()
  src/Inventory/Asset/NetworkEquipment.php:228       Glpi\Inventory\Asset\MainAsset->rulepassed()
  src/RuleImportAsset.php:969                        Glpi\Inventory\Asset\NetworkEquipment->rulepassed()
  src/Rule.php:1525                                  RuleImportAsset->executeActions()
  src/RuleCollection.php:1625                        Rule->process()
  src/Inventory/Asset/MainAsset.php:575              RuleCollection->processAllRules()
  src/Inventory/Inventory.php:710                    Glpi\Inventory\Asset\MainAsset->handle()
  src/Inventory/Inventory.php:341                    Glpi\Inventory\Inventory->handleItem()
  src/Inventory/Request.php:360                      Glpi\Inventory\Inventory->doInventory()
  src/Inventory/Request.php:283                      Glpi\Inventory\Request->inventory()
  src/Inventory/Request.php:250                      Glpi\Inventory\Request->network()
  src/Inventory/Request.php:98                       Glpi\Inventory\Request->networkInventory()
  src/Agent/Communication/AbstractRequest.php:332    Glpi\Inventory\Request->handleAction()
  src/Agent/Communication/AbstractRequest.php:269    Glpi\Agent\Communication\AbstractRequest->handleXMLRequest()
  front/inventory.php:92                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  ...tplace/glpiinventory/front/communication.php:72 include_once()
  marketplace/glpiinventory/index.php:45             include_once()
  {"user":"inventory@tenance"}

Last edited by TouTUN (2023-06-13 09:31:11)

Offline

Board footer

Powered by FluxBB