Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inventory not made (HTTP 500) - #14016

Closed
2 tasks done
GLGHus opened this issue Feb 6, 2023 · 1 comment
Closed
2 tasks done

Inventory not made (HTTP 500) - #14016

GLGHus opened this issue Feb 6, 2023 · 1 comment

Comments

@GLGHus
Copy link

GLGHus commented Feb 6, 2023

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.6

Bug description

Using GLPI 10.0.5, GLPI Agent 1.2 &1.4 is working fine

Migrating from GLPI 10.0.5 to 10.0.6 inventory is not more working. The agent is starting inventory, but after the inventory the data upload failed:
agent log
[error] [http client] communication error: 500 Internal Server Error
server log
POST /front/inventory.php - 80 - x.x.x.x GLPI-Agent_v1.2 - 500 0 0 6654
glpiphplog

glpiphplog.ERROR:   *** PHP User Error (256): Duplicate entry 'Computer-360-25264' for key 'glpi_items_softwareversions.unicity' in \src\DBmysql.php at line 1969
  Backtrace :
  src\DBmysql.php:1969                               trigger_error()
  src\Inventory\Asset\Software.php:874               DBmysql->executeStatement()
  src\Inventory\Asset\Software.php:446               Glpi\Inventory\Asset\Software->storeAssetLink()
  src\Inventory\Asset\MainAsset.php:871              Glpi\Inventory\Asset\Software->handle()
  src\Inventory\Asset\MainAsset.php:791              Glpi\Inventory\Asset\MainAsset->handleAssets()
  src\RuleImportAsset.php:969                        Glpi\Inventory\Asset\MainAsset->rulepassed()
  src\Rule.php:1522                                  RuleImportAsset->executeActions()
  src\RuleCollection.php:1626                        Rule->process()
  src\Inventory\Asset\MainAsset.php:571              RuleCollection->processAllRules()
  src\Inventory\Inventory.php:706                    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: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:92                             Glpi\Agent\Communication\AbstractRequest->handleRequest()

For now i fixed the issue in src\Inventory\Asset\Software.php in handle() function $iterator select instruction
10.0.5
Line 293 : 'glpi_softwares.softwarecategories_id'
10.0.6
Line 297 : 'glpi_softwarecategories.name AS softwarecategories_id'
EDIT: error come back again. change all dir src\Inventory by 10.0.5 does the trick. this time i think that maybe a change entity rules is involved

it seems working, i'll let the pro make a pull request if the answer is ok, but the behavior of the new request seems ok but conflit with at least 1 app.
I think the issue appear because of two same software name with different software categories :

image

Relevant log output

No response

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

@trasher
Copy link
Contributor

trasher commented Feb 20, 2023

This should be fixed as of #14105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants