glpi-project / glpi-inventory-plugin

GLPI Inventory plugin
GNU Affero General Public License v3.0
46 stars 27 forks source link

Native Inventory or GLPIInventory error 400, 500 or Can't decode JSON content, starting with in GLPI 10.0.6 #311

Closed erique-souza closed 1 year ago

erique-souza commented 1 year ago

Describe the bug

In several installations of GLPI 10.0.6 there is a communication error 500 "Internal Server Error" giving or 400 Bad Request, I am sending the 2 logs from 2 different computers accessing 2 different GLPI's giving the error 500 and sometimes the 400 for sending of the inventory, in this case when there is a communication problem, it doesn't matter if it is a native inventory that only points to the dns/ip or points to the glpiinventory plugin.

I only noticed this problem specifying in GLPI 10.0.6, I suspect that the update brought some problem, both environments also have glpiinventory and did not accept the inventory.

glpi-agent.log

glpi-agent-2.log

In some cases, pointing to the native inventory gives the attached error, as shown in the log below:

In some cases, pointing to the native inventory gives the attached error, as shown in the log below: Can't decode JSON content, starting with glpi-agent-3.log

To reproduce

Environment 10.0.6 GLPI Inventory in the latest version 1.1.0 GLPI Agent tested: 1.2 and 1.4

Expected behavior

computer inventory

Operating system

Windows

GLPI Agent version

1.4

GLPI version

10.0.6

GLPIInventory plugin

1.1.0

Additional context

No response

erique-souza commented 1 year ago

An extra piece of information, agents usually get in touch with GLPI, and create the first structure of the agent, but without actually creating the item

image

image

g-bougard commented 1 year ago

Hi @eriqueSDB

I tested on GLPI 10.0.5 the 2 json files extracted from your first 2 log files. They were imported normally with glpi-injector. On error 500, you may have triggered an error in glpi which could have put error in glpi's files/_log/php-errors.log file. Check this file for error at the same time glpi-agent is submitting its inventory.

For the last one, errors are normal as you probably have set a wrong URL in "Agent base URL". Check it in the Assets tab of your entities in the Entities administration.

erique-souza commented 1 year ago

Hi @eriqueSDB

I tested on GLPI 10.0.5 the 2 json files extracted from your first 2 log files. They were imported normally with glpi-injector. On error 500, you may have triggered an error in glpi which could have put error in glpi's files/_log/php-errors.log file. Check this file for error at the same time glpi-agent is submitting its inventory.

For the last one, errors are normal as you probably have set a wrong URL in "Agent base URL". Check it in the Assets tab of your entities in the Entities administration.

Hello everything is fine?

I made sure that the URLs I'm looking for are correct for both the native inventory and the glpiinventory plugin, I always enter from the computer via the web first and check that there is no error getting to the URL by opening the login screen or even logging in, so in all these cases that I'm posting I'm sure the URL is correct and the computer has unblocked access to the GLPI server, I tested it in environments without firewall, anti virus, or any blocking software that might be disturbing the arrival of the inventory up to the glp.

Another point that I didn't mention is about the certificate, which is common for the 500 error, on computers that have this problem, try to inventory even with the .crt certificate pointed correctly or with the no-ssl-check = 1 option in regedit to skip it certificate verification did not postpone, continued with error 500.

An excerpt from php-erros.log that I found interesting:

image

erique-souza commented 1 year ago

image

Based on this print log I attached about the Dell, I suspected the manufacturer's dictionary rules, and had actually created some in both environments.

I disabled the global manufacturer dictionary rules and it went back to inventorying without any problems.

I believe this is not the expected behavior using the dictionary, the computers that were being inventoried without 400 or 500 errors were the computers that were not being checked by the dictionary.

Could you check to see if there is any part of the computer import code that could prevent inventory if it doesn't fit a global vendor rule?

image

stonebuzz commented 1 year ago

this image

Is fixed on GLPI nightly build

tomg156 commented 1 year ago

Bonjour, j'ai le même problème avec certains PC.

J'ai pus rentrer la plupart des PC et tout en étant sur le même je n'arrive pas à inventorier certains pc qui me disent erreur 500. j'ai essayé beaucoup de solutions (filaire, wifi).

le problème persiste encore…

Des solutions à cela?

trasher commented 1 year ago

@tomg156 Please write in english only. Also, you do not provide any log, nor inventory contents; we do not know what your problem is.

As @stonebuzz said, reported issue has already been fixed in GLPI core; try with nightly build. Since reporter does not give any feedback in 2 weeks, I close.

tomg156 commented 1 year ago

Hello, I have the same problem with some PCs.

I was able to enter most of the PCs and while being on the same one I can't manage to inventory some PCs that tell me error 500. I tried many solutions (wired, wifi).

the problem still persists...

Any solutions to this?

stonebuzz commented 1 year ago

Have you the same result from a fresh install (GLPI nightly build) ?

erique-souza commented 1 year ago

Have you the same result from a fresh install (GLPI nightly build) ?

Good afternoon

Sorry for the delay, validating in version 10.0.7 released today, the problem has already been fixed, and the dictionary does not prevent the computer's inventory, thank you very much.