OCSInventory-Server
OCSInventory-Server copied to clipboard
One agent getting HTTP 500 errors when trying to POST inventory
General information
Operating system : Server: Container using podman-compose on Debian 11 Client: Windows 10 x64
Server information
Perl version :
This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-gnu-thread-multi
(with 57 registered patches, see perl -V for more detail)
Mysql / Mariadb / Percona version :
ocsdb :
image : mysql:8.0
OCS Inventory information
Ocs server version :
ocsapplication:
image: ocsinventory/ocsinventory-docker-image:2.11
Problem description
One particular agent is unable to push the report:
Starting OCS Inventory Agent on Thursday, March 30, 2023 08:16:34.
AGENT => Running OCS Inventory Agent Version 2.10.1.0
AGENT => Using OCS Inventory FrameWork Version 2.10.1.0
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory cURL Communication Provider> Version <2.10.1.0>
AGENT => Sending Prolog
AGENT => Prolog successfully sent
AGENT => Inventory required
AGENT => Launching hardware and software checks
AGENT => Sending Inventory
INVENTORY => Inventory changed since last run
ERROR *** AGENT => Failed to send Inventory <HTTP Status Code #500>
AGENT => Communication Server asked for Package Download
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:19.
a.b.c.d - - [30/Mar/2023:02:16:53 +0200] "POST /ocsinventory HTTP/1.1" 500 836 "-" "OCS-NG_WINDOWS_AGENT_v2.10.1.0"
I've tried to add OCS_OPT_DBI_PRINT_ERROR
in various ways:
- Editing the config in the container live and reloading apache
- Modifying the container and using the new image in
docker-compose.yml
- Editing the config used by the
Dockerfile
and re-building the container, and updating thedocker-compose.yml
to use that container - Adding the below into the
docker-compose.yml
:
environment:
OCS_OPT_DBI_PRINT_ERROR: 1
At no point do I seem to get any logs other than the single "500" error above.
All of the other clients seem to work fine.
This server did start out at 2.9.2 (because I didn't realise that it wasn't the newest version, oops!) but it has since been upgraded to 2.11.
Hi @nroach44 ,
Can you set the Windows agent debug to 1 ?
To do that :
- Stop the OCS Inventory service on the machine
- Edit the ocsinventory.ini file in
C:\ProgramData\OCS Inventory\Agent
- Set DEBUG=1, save and restart the service
Are all your agents in 2.10.1 ?
Best regards, Charlene
Hi @charleneauger ! No, I have some old XP machines on the XP version of the agent, but that's purely for retro computing reasons.
The rest of the agents are on either the latest Windows or Linux agents. As far as I can tell, there are other Windows 10 machines, just like this one, working fine.
==============================================================================
Starting OCS Inventory Agent on Wednesday, April 05, 2023 20:01:12.
AGENT => Running OCS Inventory Agent Version 2.10.1.0
AGENT => Using OCS Inventory FrameWork Version 2.10.1.0
AGENT => Loading plug-in(s)
DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files\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\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory cURL Communication Provider> Version <2.10.1.0>
AGENT => Sending getLabel request
COM SERVER => Initializing cURL library for getFile
COM SERVER => Using cURL without server authentication
COM SERVER => Disabling cURL proxy support
COM SERVER => Disabling cURL SSL server validation support
COM SERVER => Sending fileGet request to URL <https://ocsng.fqdn/ocsinventory/deploy/label>
COM SERVER => fileGet response received <HTTP Status Code #400>
COM SERVER => Cleaning cURL library
AGENT => Failed to retrieve Label <HTTP Status Code #400>
AGENT => Sending Prolog
DID_CHECK => Read DeviceID <HOST-2023-03-29-17-39-13> and MACs <three MACs> 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 => Disabling cURL SSL server validation support
COM SERVER => Sending HTTP Post request to URL <https://ocsng.fqdn/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 => WMI FLAG MODE is set to <WBEM_FLAG_RETURN_WBEM_COMPLETE>
INVENTORY => Logged on user ID is <user>
INVENTORY => Operating System is <Microsoft Windows 10 Pro 10.0.19045 >, description <>
INVENTORY => Operating System uses 64 bits memory address width
INVENTORY => Computer domain or workgroup is <domain>
INVENTORY => User domain is <>
INVENTORY => System Manufacturer <ASUS>, System Model <System Product Name>, System S/N <System Serial Number>, Bios Manufacturer <American Megatrends Inc.>, Bios Date <25/02/2022>, Bios Version <2604>, Motherboard Manufacturer <ASUSTeK COMPUTER INC.>, Motherboard Model <>, Motherboard S/N <snip>
INVENTORY => 1 processor(s) AMD Ryzen 5 3600X 6-Core Processor [6 core(s) x86_64] at 3801 MHz
INVENTORY => OS Memory 32683 MB, OS Swap size 37547 MB
INVENTORY => 4 memory slot(s) found
INVENTORY => 8 input device(s) found
INVENTORY => 31 system port(s) found
INVENTORY => 3 system slot(s) found
INVENTORY => 10 system controller(s) found
INVENTORY => 3 storage peripheral(s) found
INVENTORY => 6 sound device(s) found
WARNING *** INVENTORY => Failed to retrieve modems
INVENTORY => 26 network adapter(s) found
INVENTORY => 3 system printer(s) found
INVENTORY => 3 video adapter(s) found
INVENTORY => 2 system monitor(s) found
INVENTORY => Default IPv4 address is <10.x.y.z>
INVENTORY => Default Gateway address is <10.x.y.a>
INVENTORY => Default DNS address is <10.x.y.b / 10.x.y.c / 10.x.d.e>
INVENTORY => Registered company <>, registered owner <LocalAdmin>, Product ID <00330-80...>
INVENTORY => Product key <VK7JG-NP...>
INVENTORY => 150 software found
INVENTORY => Computer/VM UUID is <UUID>
INVENTORY => Computer seems to be Microsoft virtual host
INVENTORY => System Memory set to 32768 (instead of 32683)
INVENTORY => Reading last inventory state
WARNING *** INVENTORY => Failed to load/parse inventory state from file <C:\ProgramData\OCS Inventory NG\Agent\last_state>
WARNING *** INVENTORY => Failed to load/parse plugin state from file <C:\ProgramData\OCS Inventory NG\Agent\last_state>
EXECUTABLE PLUGIN => Searching for VBS script(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>
EXECUTABLE PLUGIN => Searching for PS1 script(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>
EXECUTABLE PLUGIN => Found executable plugin <Saas.ps1>
EXECUTABLE PLUGIN => Plugin <Saas.ps1> executed successfully
AGENT => Sending Inventory
INVENTORY => Checking last inventory state
INVENTORY => Hardware inventory state changed
INVENTORY => Bios inventory state changed
INVENTORY => Memory slots inventory state changed
INVENTORY => System slots inventory state changed
INVENTORY => System controllers inventory state changed
INVENTORY => Monitors inventory state changed
INVENTORY => System ports inventory state changed
INVENTORY => Storage peripherals inventory state changed
INVENTORY => Logical drives inventory state changed
INVENTORY => Input peripherals inventory state changed
INVENTORY => Network adapters inventory state changed
INVENTORY => Printers inventory state changed
INVENTORY => Sound adapters inventory state changed
INVENTORY => Video adapters inventory state changed
INVENTORY => Software inventory state changed
INVENTORY => CPU inventory state changed
INVENTORY => Inventory changed since last run
INVENTORY => Generating XML document with Device properties
INVENTORY => XML Update BIOS
INVENTORY => XML Update 1 CPU(s)
INVENTORY => XML Update 4 Memory Slot(s)
INVENTORY => XML Update 8 Input Device(s)
INVENTORY => XML Update 31 System Port(s)
INVENTORY => XML Update 10 System Controller(s)
INVENTORY => XML Update 3 System Slot(s)
INVENTORY => XML Update 6 Sound Device(s)
INVENTORY => XML Update 3 Storage Peripheral(s)
INVENTORY => XML Update 4 Logical Drive(s)
INVENTORY => XML Update 0 Modem(s)
INVENTORY => XML Update 26 Network Adapter(s)
INVENTORY => XML Update 3 Video Adapter(s)
INVENTORY => XML Update 2 Monitor(s)
INVENTORY => XML Update 3 Printer(s)
INVENTORY => XML Update 151 Software
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 => Disabling cURL SSL server validation support
COM SERVER => Sending HTTP Post request to URL <https://ocsng.fqdn/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 asked 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:24.
Hi @nroach44 ,
Can you send me back the server logs for this machine located in /var/log/ocsinventory-server/activity.log
?
I don't see anything suspicious in the agent logs
Regards, Charlene Auger
@charleneauger I've just checked again, getting the same results as in my original post:
a.b.c.d - - [26/Jun/2023:21:52:38 +0800] "GET /ocsinventory/deploy/label HTTP/1.1" 400 495 "-" "OCS-NG_WINDOWS_AGENT_v2.10.1.0"
a.b.c.d - - [26/Jun/2023:21:52:38 +0800] "POST /ocsinventory HTTP/1.1" 200 463 "-" "OCS-NG_WINDOWS_AGENT_v2.10.1.0"
a.b.c.d - - [26/Jun/2023:21:52:47 +0800] "POST /ocsinventory HTTP/1.1" 500 836 "-" "OCS-NG_WINDOWS_AGENT_v2.10.1.0"
Hi @nroach44 ,
This is not the correct log file you sent me :-)
I would like the following : /var/log/ocsinventory-server/activity.log
Regards, Charlene
@charleneauger no luck, there's no activity in that log when the agent attempts a report.
@nroach44 , have you enabled the LOGLEVEL
option in Configuration > General configuration > Server
on the administration console ?
If it is disabled, activate it and restart an inventory. Logs should appear in the file.
Hi @nroach44 ,
Any update on this issue ?
Regards, Léa
@Lea9250 @charleneauger My apologies for the delay.
This is the activity.log
from inside the container:
Wed Aug 23 15:30:56 2023;92;511;NA;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;deploy;no_file
Wed Aug 23 15:30:56 2023;92;515;NA;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;end;bad_request
Wed Aug 23 15:30:56 2023;95;103;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;prolog;new_deviceid
Wed Aug 23 15:30:56 2023;95;1001;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;ipdiscover;checking if is enabled
Wed Aug 23 15:30:56 2023;95;100;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;prolog;accepted
Wed Aug 23 15:30:56 2023;95;311;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;session;started
Wed Aug 23 15:31:09 2023;94;319;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;session;found
Wed Aug 23 15:31:09 2023;94;104;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;inventory;incoming
Wed Aug 23 15:31:09 2023;94;515;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;end;error
Wed Aug 23 15:31:10 2023;86;511;NA;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;deploy;no_file
Wed Aug 23 15:31:10 2023;86;515;NA;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;end;bad_request
Wed Aug 23 15:31:10 2023;80;103;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;prolog;new_deviceid
Wed Aug 23 15:31:10 2023;80;1001;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;ipdiscover;checking if is enabled
Wed Aug 23 15:31:10 2023;80;100;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;prolog;accepted
Wed Aug 23 15:31:10 2023;80;311;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;session;started
Wed Aug 23 15:31:20 2023;87;319;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;session;found
Wed Aug 23 15:31:20 2023;87;104;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;inventory;incoming
Wed Aug 23 15:31:20 2023;87;515;<<HOSTNAME>>-2023-06-27-19-21-14;<<IP>>;OCS-NG_WINDOWS_AGENT_v2.10.1.0;end;error
Here is the corresponding OCSInventory.log
from the agent:
Hi @nroach44 ,
To set OCS_OPT_DBI_PRINT_ERROR
to 1, can you follow the instructions below:
- Access the ocsinventory-server container:
docker exec -it ocsinventory-server bash
-
Edit
z-ocsinventory-server.conf
and setOCS_OPT_DBI_PRINT_ERROR
to 1. -
Leave the container and execute:
docker-compose restart
Do you have any new logs showing up in /var/log/apache2/error.log
?
Can you provide me with the HOSTNAME
of your machine in error ?
Regards, Charlene
Hi, I have the same error on my side. After some search, I have do this:
set OCS_OPT_DBI_PRINT_ERROR 1 in z-ocsinventory-server.conf file and restart apache. Launch an inventory and look in apache error log file for errors.
And in our log, now we have:
DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173.
@charleneauger any idea?
Thank you
Hi @thenamelessthing ,
Can you provide me with the HOSTNAME
of your machine in error ?
Best regards, Charlene
Hi @thenamelessthing ,
Can you provide me with the
HOSTNAME
of your machine in error ?Best regards, Charlene
Is it really relevant, I mean. I have added myself to this thread as I am experiencing exactly the same problem and the computer name will not be in the logs provided earlier in this thread. We have many computers with this problem. Our computer name nomenclature looks like this: T-SSO-99-001234
I also can provide our log file too if necessary.
In my instance the computer name is "AAAAA" (where A is any capital latter between A-Z), no numbers, symbols, Unicode etc.
I'll try to check the logs to see if I'm getting the same error.
On 28 October 2023 4:19:56 am AWST, thenamelessthing @.***> wrote:
Hi @thenamelessthing ,
Can you provide me with the
HOSTNAME
of your machine in error ?Best regards, Charlene
Is it really relevant, I mean. I have added myself to this thread as I am experiencing exactly the same problem and the computer name will not be in the logs provided earlier in this thread. We have many computers with this problem. Our computer name nomenclature looks like this: T-SSO-99-001234
-- Reply to this email directly or view it on GitHub: https://github.com/OCSInventory-NG/OCSInventory-Server/issues/423#issuecomment-1783459986 You are receiving this because you were mentioned.
Message ID: @.***>
Hi @charleneauger , I provided our log too if this can help you.
ocs_httpd_error.log ocs_activity.log
One of the computer with the error is: L-SSO-21-008645
Hi, it is possible to obtain help on this?
@charleneauger if you can give us a hint on how to solve this problem. That would be great! Thanks again for your help.
In the apache error log with debug enable we see:
DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173. DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl5/Apache/Ocsinventory/Server/Communication/Session.pm line 46. DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173.
Hi @thenamelessthing
COncerning the following error : DBD::mysql::st execute failed: Out of range value for column 'ID' at row 1 at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173.
I answered you in the other issue you opened.
The table prolog_conntrack is a memory temporary table that should purge from time to time. I'll recommend to truncate the table manualy to fix the issue.
Regards, Gilles DUBOIS.
Hi @nroach44 ,
Any update on this issue ?
Regards, Charlene