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.

<HTTP Status Code #500> after update to 2.9.2

Hi,

I updated the OCS server to the latest version (2.9.2) from previous version 2.4.
I also updated the client and everything seems to work but I get a HTTP 500 error when the client wants to connect:

Starting OCS Inventory Agent on Thursday, June 02, 2022 12:28:48.
AGENT => Running OCS Inventory Agent Version 2.9.2.0
AGENT => Using OCS Inventory FrameWork Version 2.9.2.0
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory cURL Communication Provider> Version <2.9.2.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
DOWNLOAD => Download and setup tool successfully started
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:09.

I understand that this error should normally be a wrong password but I checked
dbconfig details and the z-ocsinventory-server.conf and also the zz-ocsinventory-restapi.conf and all the credentials and passwords are fine.

So I have no idea why I get this error.
I can login in ocsreports and that seems to work fine.

Any idea? Thanks.
in OCS Inventory NG server for Unix by (680 points)

19 Answers

0 votes
Hi,

Please post content of apache error log file.

Regards
by (90.2k points)
0 votes

I would like to post the apache error log but I get the following message:

Your post contains too many links to external sites.

by (680 points)
0 votes
[Thu Jun 02 12:52:14.289503 2022] [mpm_prefork:notice] [pid 2575] AH00170: caught SIGWINCH, shutting down gracefully

[Thu Jun 02 12:52:15.580734 2022] [suexec:notice] [pid 6512] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

Scalar value @args[$i] better written as $args[$i] at /usr/local/share/perl5/Apache/Ocsinventory/Interface/AssetCategory.pm line 54.

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message

[Thu Jun 02 12:52:15.814684 2022] [lbmethod_heartbeat:notice] [pid 6512] AH02282: No slotmem from mod_heartmonitor

PHP Warning:  PHP Startup: Unable to load dynamic library 'propro.so' (tried: /usr/lib64/php/modules/propro.so (/usr/lib64/php/modules/propro.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/propro.so.so (/usr/lib64/php/modules/propro.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

PHP Warning:  Module "gmp" is already loaded in Unknown on line 0

PHP Warning:  Module "sodium" is already loaded in Unknown on line 0

PHP Warning:  Module "raphf" is already loaded in Unknown on line 0

PHP Warning:  Module "http" is already loaded in Unknown on line 0

[Thu Jun 02 12:52:15.852208 2022] [mpm_prefork:notice] [pid 6512] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.0.19 mod_perl/2.0.11 Perl/v5.16.3 configured -- resuming normal operations

[Thu Jun 02 12:52:15.852233 2022] [core:notice] [pid 6512] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
by (680 points)
0 votes
I downgraded php 8 to 7.4.

In the ocsinventory.log on the client I have this:

Starting OCS Inventory Agent on Friday, June 03, 2022 10:55:52.

AGENT => Running OCS Inventory Agent Version 2.9.2.0

AGENT => Using OCS Inventory FrameWork Version 2.9.2.0

AGENT => Loading plug-in(s)

AGENT => Using network connection with Communication Server

AGENT => Using Communication Provider <OCS Inventory cURL Communication Provider> Version <2.9.2.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

DOWNLOAD => Download and setup tool successfully started

AGENT => Unloading communication provider

AGENT => Unloading plug-in(s)

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

So still the 500 error.

The apache error log shows this:

[Fri Jun 03 10:55:45.821525 2022] [suexec:notice] [pid 4309] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

Scalar value @args[$i] better written as $args[$i] at /usr/local/share/perl5/Apache/Ocsinventory/Interface/AssetCategory.pm line 54.

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message

[Fri Jun 03 10:55:46.056060 2022] [lbmethod_heartbeat:notice] [pid 4309] AH02282: No slotmem from mod_heartmonitor

[Fri Jun 03 10:55:46.083130 2022] [mpm_prefork:notice] [pid 4309] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.29 mod_perl/2.0.11 Perl/v5.16.3 configured -- resuming normal operations

[Fri Jun 03 10:55:46.083160 2022] [core:notice] [pid 4309] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

I don't understand why it is still not working.
Can anybody help with this? Is there not a ocsinventory logfile on the server to check errors and communication problems?
thanks.
by (680 points)
0 votes
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.
by (90.2k points)
0 votes
I get these errors:

DBI connect('database=ocsweb;host=localhost;port=3306','ocs',...) failed: Access denied for user 'ocs'@'localhost' (using password: YES) at /usr/local/share/perl5/Apache/Ocsinventory/Server/System.pm line 187.

This is not clear because I configured it like it was in the documentation.
Seems a problem with the credentials.
Any quick solution?

Thanks.
by (680 points)
0 votes
I removed the database user and created a new one.

Then I relaunch the inventory on the client.
In apache error_log I get:

[Fri Jun 03 11:43:04.871604 2022] [core:notice] [pid 7330] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

DBD::mysql::db do failed: Table 'ocsweb.softwares_name_cache' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Cache.pm line 77.

DBD::mysql::db do failed: Table 'ocsweb.softwares_name_cache' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Cache.pm line 78.

DBD::mysql::db do failed: Table 'ocsweb.softwares' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 96.

DBD::mysql::st execute failed: Column 'ID' in field list is ambiguous at /usr/local/share/perl5/Apache/Ocsinventory/Server/Capacities/Download.pm line 268.

DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/local/share/perl5/Apache/Ocsinventory/Server/Capacities/Download.pm line 270.

DBD::mysql::db do failed: Table 'ocsweb.softwares_name_cache' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Cache.pm line 77.

DBD::mysql::db do failed: Table 'ocsweb.softwares_name_cache' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Cache.pm line 78.

DBD::mysql::db do failed: Table 'ocsweb.softwares' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 96.

The client still gives
ERROR *** AGENT => Failed to send Inventory <HTTP Status Code #500>
by (680 points)
0 votes

I still have this error:

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

Apache error log:
 

DBD::mysql::db do failed: Table 'ocsweb.softwares_name_cache' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Cache.pm line 77.
DBD::mysql::db do failed: Table 'ocsweb.softwares_name_cache' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Cache.pm line 78.
DBD::mysql::db do failed: Table 'ocsweb.softwares' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 96.
DBD::mysql::db do failed: Table 'ocsweb.softwares_name_cache' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Cache.pm line 77.
DBD::mysql::db do failed: Table 'ocsweb.softwares_name_cache' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Cache.pm line 78.
DBD::mysql::db do failed: Table 'ocsweb.softwares' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 96.
DBD::mysql::st execute failed: Column 'ID' in field list is ambiguous at /usr/local/share/perl5/Apache/Ocsinventory/Server/Capacities/Download.pm line 268.
DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/local/share/perl5/Apache/Ocsinventory/Server/Capacities/Download.pm line 270.

What can I do?

by (680 points)
edited by
0 votes
The support regarding to problem solving is absolutely stunning! Great support!
by (680 points)
0 votes
Table software_name_cache is missing. Run this command in mysql :

CREATE TABLE `softwares_name_cache` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `NAME` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `NAME` (`NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
by (90.2k points)
 
Powered by Question2Answer
...