Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

many agent installs work some give 500 error on server

fresh download and install of server 2.3 on linux (CentOS 7) and agent 2.3. I'm installing the agent on several linux boxes all running CentOS 7 with all updates, some work fine and report, some give a 500 server error, all have the same perl modules and all have the same ocsinventory-agent.cfg file

agent log on the client
Wed Jan 25 13:41:45 2017][error] Cannot establish communication : 500 Internal Server Error

apache error log on the server corresponding line
[Wed Jan 25 13:44:32.579981 2017] [perl:error] [pid 5489] [client xxx.xxx.xxx.xxx:45672] Not a HASH reference at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Data.pm line 126.\n

and activity.log
Wed Jan 25 11:54:36 2017;5322;114;hostname-2017-01-25-13-10-39;xxx.xxx.xxx.xxx;OCS-NG_unified_unix_agent_v2.3;inventory;no_session
in OCS Inventory NG agent for Unix by (550 points)

9 Answers

0 votes
Hi,

On machines that report error 500 have you some usb external devices?

Regards

Frank
by (90.2k points)
0 votes

no, these are rack mount workstations, some HP some Dell, all headless with nothing attached apart from a network cable, all with the same OS with the same updates and installs, some HPs report fine some give 500 server error some Dells report fine and some give 500 server errors and the web server reports

Not a HASH reference at /usr/local/share/perl/5/Apache/Ocsinventory/Server/Inventory/Data.pm line 126

for those machines

by (550 points)
edited by
0 votes
Hi, fresh install, same problem. Any way to debug this?

regards
by (200 points)
0 votes
Facing the same problem, keyboard, mouse and speaker are all usb. Any way to debug this further ?
by (140 points)
0 votes
I have the same problem. Mostly agent on pure Debian Jessie servers not working. I don't understand why this is happening so very difficult to troubleshoot. If it was a missing dependency I don't see any errors about that.
by (1.9k points)
0 votes
so i tried using the --local flag on the ocs-agent (and --nosoftware to keep it shorter), on one of the machines that give the 500 server error, and can't see anything obviously wrong with the xml file, but when I try to do a manual upload of the file to the server, via the OCS admin page I also get the 500 error and logging about

Not a HASH reference at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Data.pm line 126.

kind of assuming there IS something in the XML that the server does not like, but not a perl expert
by (550 points)
edited by
Is it something wrong with the collected data?
0 votes
Same problem here

 Not a HASH reference at /usr/local/share/perl/5.18.2/Apache/Ocsinventory/Server/Inventory/Data.pm line 126.
by (140 points)
0 votes
Hi,

See this post => http://ask.ocsinventory-ng.org/5785/lots-of-host-duplicates-since-server-agent-update-2-3

The solution is to create the missing table.

Regards

Frank
by (90.2k points)
0 votes
the missing table (it's not missing) is not the issue.
I have updated the serer to 2.3.1 and the issue persists for some machines

having done some further digging, and using the suggestions fro the link above, I get this in the error log

refXml:
$VAR1 = {
          'INTERFACE' => 'Unused',
          'TYPE' => 'Hub'
        };
$VAR1 = {
          'INTERFACE' => 'Unused',
          'TYPE' => 'Hub'
        };
[Tue Nov 21 10:00:31.838120 2017] [perl:error] [pid 8741] [client xxx.xxx.xxx.xxx.:47538] Not a HASH reference at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Data.pm line 141.\n

the corresponding part of the .ocs file

</SLOTS>
    <USBDEVICES>
      <INTERFACE>Unused</INTERFACE>
      <TYPE>Hub</TYPE>
    </USBDEVICES>
    <USBDEVICES>
      <INTERFACE>Unused</INTERFACE>
      <TYPE>Hub</TYPE>
    </USBDEVICES>
    <USERS>

however the part

<USBDEVICES>
      <INTERFACE>Unused</INTERFACE>
      <TYPE>Hub</TYPE>
    </USBDEVICES>

also exists in the XML of machines that do report to the server without errors, also removing the <USBDEVICES> entries from the XML and trying a manual upload still fails
by (550 points)
edited by
 
Powered by Question2Answer
...