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.11.1 available

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

Error 500 Win10 agent 2.3.1.1:undefined subroutine

Hello,

after hours of researches on your website, impossible to find a solution to my basic problem : My OCS Agent 2.3.1.1 is unable to send its data collected on the Windows 10 to OCS Server : it logs error 500 ! But no other post could help me ! (I had install previously a OCS server in a similar way and I had absolutely NO such problem, so, as I’m using exactly the same method I can’t understand why it’s not running for this second install !).

Here are my configurations :

1. OCS Server (perfectly running with with OCS -Reports) :

Système :

  • Nom du système :Linux x86_64

  • Version :4.9.0-4-amd64

  • RAM totale :2004 Mo

  • RAM disponible :1673 Mo

  • CPU :Intel(R) Xeon(R) CPU E5606 @ 2.13GHz

  • Distribution :Debian GNU/Linux 9 (stretch)

Logiciel :

  • Version de PHP :7.0.27

  • Serveur Web :Apache/2.4.25 (Debian)

  • Serveur SQL :Debian 9.1 version 10.1.26-MariaDB-0+deb9u1

  • Version OCSReports:2.4.

Réseau :

  • IP: 172.16.20.190/17

2. In my Win10Pro station where agent 2.3.1.1 is running :

    • C:\programData\OCS Inventory NG\Agent\OCSInventory.log : after good connection to the server at the beginning of the process (code 200 received), finally, error 500 appears and NO inventory can be sent to the server... => see BOLD lines ...

Starting OCS Inventory NG Agent on Thursday, May 17, 2018 16:49:49.

AGENT => Running OCS Inventory NG Agent Version 2.3.1.1

AGENT => Using OCS Inventory NG FrameWork Version 2.3.1.1

AGENT => Loading plug-in(s)

DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>

DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found

AGENT => Using network connection with Communication Server

COM PROVIDER => Loading Communication Provider <C:\Program Files (x86)\OCS Inventory Agent\ComHTTP.dll>

AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.3.1.1>

AGENT => Sending Prolog

DID_CHECK => Read DeviceID <WIN10-PRO-BASE--2018-05-02-11-43-33> and MACs <00:50:56:0B:BA:CD> in file <ocsinventory.dat>

COM SERVER => Initializing cURL library for sendRequest

COM SERVER => Using cURL without server authentication

COM SERVER => Disabling cURL proxy support

COM SERVER => Enabling cURL SSL server validation support using CA Bundle <C:\ProgramData\OCS Inventory NG\Agent\cacert.pem>

COM SERVER => Sending HTTP Post request to URL <http://172.16.20.190/ocsinventory>

COM SERVER => HTTP Post response received <HTTP Status Code #200>

COM SERVER => Cleaning cURL library

AGENT => Prolog successfully sent

AGENT => Prolog Frequency set to 24 hour(s)

AGENT => Inventory on startup option set to 1

AGENT => Inventory required

AGENT => Launching hardware and software checks

INVENTORY => Loading Download history

INVENTORY => Logged on user ID is <Administrateur>

INVENTORY => Operating System is <Microsoft Windows 10 Professionnel 10.0.15063 >, description <>

INVENTORY => User domain is <>

INVENTORY => System Manufacturer <VMware, Inc.>, System Model <VMware Virtual Platform>, System S/N <VMware-42 15 46 34 2e fc ef bf-91 9c ff 36 96 4d 4a a8>, Bios Manufacturer <Phoenix Technologies LTD>, Bios Date <07/09/2012>, Bios Version <6.00>, Motherboard Manufacturer <Intel Corporation>, Motherboard Model <440BX Desktop Reference Platform>, Motherboard S/N <None>

....
WARNING *** INVENTORY => Failed to retrieve modems

INVENTORY => 1 network adapter(s) found

...
INVENTORY => System Memory set to 6144 (instead of 6144)

INVENTORY => Reading last inventory state

EXECUTABLE PLUGIN => Searching for VBS script(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>

EXECUTABLE PLUGIN => Searching for PS1 script(s) in folder <C:\Program Files (x86)\OCS Inventory Agent\plugins>

AGENT => Sending Inventory

INVENTORY => Checking last inventory state

INVENTORY => Logical drives inventory state changed

...

INVENTORY => Printers inventory state changed

INVENTORY => Inventory changed since last run

INVENTORY => Generating XML document with Device properties

INVENTORY => XML Update BIOS

INVENTORY => XML Update 2 CPU(s)

...
INVENTORY => XML Update 0 Registry Value(s)

INVENTORY => XML Update Administrative Information(s)

INVENTORY => XML Update common Device properties

COM SERVER => Initializing cURL library for sendRequest

COM SERVER => Using cURL without server authentication

COM SERVER => Disabling cURL proxy support

COM SERVER => Enabling cURL SSL server validation support using CA Bundle <C:\ProgramData\OCS Inventory NG\Agent\cacert.pem>

COM SERVER => Sending HTTP Post request to URL <http://172.16.20.190/ocsinventory>

COM SERVER => HTTP Post response received <HTTP Status Code #500>

COM SERVER => Cleaning cURL library

ERROR *** AGENT => Failed to send Inventory <HTTP Status Code #500>

AGENT => Communication Server ask for Package Download

DOWNLOAD => Package history file successfully cleaned for duplicate IDs

DOWNLOAD => Download disabled by server

AGENT => Unloading communication provider

AGENT => Unloading plug-in(s)

AGENT => Execution duration: 00:00:31.


 

3. In my OCS server :

    • /var/log/apache2/access.log : error 500 appears after code 200 Ok.

172.16.0.68 - - [17/May/2018:16:42:52 +0200] "POST /ocsinventory HTTP/1.1" 200 411 "-" "OCS-NG_WINDOWS_AGENT_v2.3.1.1"

172.16.0.68 - - [17/May/2018:16:43:05 +0200] "POST /ocsinventory HTTP/1.1" 500 842 "-" "OCS-NG_WINDOWS_AGENT_v2.3.1.1"

172.16.0.68 - - [17/May/2018:16:49:49 +0200] "POST /ocsinventory HTTP/1.1" 200 411 "-" "OCS-NG_WINDOWS_AGENT_v2.3.1.1"

172.16.0.68 - - [17/May/2018:16:50:20 +0200] "POST /ocsinventory HTTP/1.1" 500 842 "-" "OCS-NG_WINDOWS_AGENT_v2.3.1.1"

    • /var/log/apache2/error.log : « strange » programming errors in different scripts on lines 38, 48, 66, 74, 103 (in eg. : « Undefined subroutine » =>???). I can’t understand why that kind of errors appear. And how I can solve them ! It is as if some Perl or Php programs were missing... ??? => see BOLD lines ...

[Thu May 17 16:33:17.119893 2018] [:error] [pid 5499] [client 10.10.10.6:53540] PHP Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 66, referer: http://172.16.20.190/ocsreports/

[Thu May 17 16:33:17.119958 2018] [:error] [pid 5499] [client 10.10.10.6:53540] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 103, referer: http://172.16.20.190/ocsreports/

[Thu May 17 16:33:17.119975 2018] [:error] [pid 5499] [client 10.10.10.6:53540] PHP Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 38, referer: http://172.16.20.190/ocsreports/

[Thu May 17 16:33:58.005945 2018] [:error] [pid 5498] [client 10.10.10.6:53548] PHP Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 66, referer: http://172.16.20.190/ocsreports/

[Thu May 17 16:33:58.006004 2018] [:error] [pid 5498] [client 10.10.10.6:53548] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 103, referer: http://172.16.20.190/ocsreports/

[Thu May 17 16:33:58.006021 2018] [:error] [pid 5498] [client 10.10.10.6:53548] PHP Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, null given in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 38, referer: http://172.16.20.190/ocsreports/

[Thu May 17 16:38:25.929608 2018] [:error] [pid 5504] [client 10.10.10.6:53601] PHP Warning: vsprintf(): Too few arguments in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 74, referer: http://172.16.20.190/ocsreports/index.php

[Thu May 17 16:38:25.929666 2018] [:error] [pid 5504] [client 10.10.10.6:53601] PHP Warning: mysqli_query(): Empty query in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 103, referer: http://172.16.20.190/ocsreports/index.php

[Thu May 17 16:43:05.450371 2018] [perl:error] [pid 5513] [client 172.16.0.68:64801] Undefined subroutine &Apache::Ocsinventory::Server::Inventory::Update::set_asset_category called at /usr/local/share/perl/5.24.1/Apache/Ocsinventory/Server/Inventory/Update.pm line 48.\n

[Thu May 17 16:50:20.146113 2018] [perl:error] [pid 5516] [client 172.16.0.68:64833] Undefined subroutine &Apache::Ocsinventory::Server::Inventory::Update::set_asset_category called at /usr/local/share/perl/5.24.1/Apache/Ocsinventory/Server/Inventory/Update.pm line 48.


 

My question is : Would you have an idea to solve that kind of problem, please ?


 

Thanks for your advises or solutions.

Best regards.


 


 

in OCS Inventory NG server for Unix by (260 points)

1 Answer

0 votes
I must precise that I have installed a first OCS Server under Debian9 10 days ago on a first server, getting sources from GitHub (git clone ...) and everything was perfectly running with Win10 agents 2.3.1.1.

And today, I have used exactly the same procedure to install a second time my OCS Server on the same type of VM and the same operating system, WITH THE SAME COMMANDS EXACTLY (!!!) and ... it's not running anymore !!! (same agents and same clients !!!!) ????

So, what ????

I have many error messages such as "undefined subroutines" (on the server) , or "code 200 (OK) for prolog" but finally "code 500 Failed to send inventory" on the client !!!

Please help me, my solution must absolutely be running on next Tuesday ... :-/
by (260 points)
 
Powered by Question2Answer
...