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.

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

I always get the error ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #500> in the ocsinventory.log:

==============================================================================
Starting OCS Inventory NG Agent on Thursday, September 15, 2016 10:51:10.
AGENT => Running OCS Inventory NG Agent Version 2.1.1.3
AGENT => Using OCS Inventory NG FrameWork Version 2.1.1.3
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.1.1.3>
AGENT => Sending Prolog
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #500>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:00.

The username and password in ocsinventory-server.conf is also correct. I can't find the problem. Can you help me?

Here are the config files:

ocsinventory-server.conf (important part):
#
# OCS Inventory NG Communication Server Perl Module Setup
#
# Copyleft 2006 Pascal DANEK
# Web: http://www.ocsinventory-ng.org
 

<IfModule mod_perl.c>
 
  # Which version of mod_perl we are using
  # For mod_perl <= 1.999_21, replace VERSION_MP by 1
  # For mod_perl > 1.999_21, replace VERSION_MP by 2
  PerlSetEnv OCS_MODPERL_VERSION VERSION_MP

  # Master Database settings
  # Replace DATABASE_SERVER by hostname or ip of MySQL server for WRITE
  PerlSetEnv OCS_DB_HOST DATABASE_SERVER
  # Replace DATABASE_PORT by port where running MySQL server, generally 3306
  PerlSetEnv OCS_DB_PORT DATABASE_PORT
  # Name of database
  PerlSetEnv OCS_DB_NAME ocsweb
  PerlSetEnv OCS_DB_LOCAL ocsweb
  # User allowed to connect to database
  PerlSetEnv OCS_DB_USER ocs
  # Password for user
  PerlSetVar OCS_DB_PWD ocs1
 
  # Path to log directory (must be writeable)
  PerlSetEnv OCS_OPT_LOGPATH "PATH_TO_LOG_DIRECTORY"
 
  # If you need to specify a mysql socket that the client's built-in
  #PerlSetEnv OCS_OPT_DBI_MYSQL_SOCKET "path/to/mysql/unix/socket"
  # DBI verbosity
  PerlSetEnv OCS_OPT_DBI_PRINT_ERROR 0
 
  # Unicode support
  PerlSetEnv OCS_OPT_UNICODE_SUPPORT 1

  # If you are using a multi server architecture,
  # Put the ip addresses of the slaves on the master
  # (This is read as perl regular expressions)
  PerlAddVar OCS_OPT_TRUSTED_IP 127.0.0.1
  #PerlAddVar OCS_OPT_TRUSTED_IP XXX.XXX.XXX.XXX
 
# ===== WEB SERVICE (SOAP) SETTINGS =====

  PerlSetEnv OCS_OPT_WEB_SERVICE_ENABLED 0
  PerlSetEnv OCS_OPT_WEB_SERVICE_RESULTS_LIMIT 100
  # PerlSetEnv OCS_OPT_WEB_SERVICE_PRIV_MODS_CONF "WEBSERV_PRIV_MOD_CONF_FILE"

# Be careful: you must restart apache to make settings taking effects

  # Configure engine to use the settings from this file  
  PerlSetEnv OCS_OPT_OPTIONS_NOT_OVERLOADED 0

  # Try to use other compress algorythm than raw zlib
  # GUNZIP and clear XML are supported
  PerlSetEnv OCS_OPT_COMPRESS_TRY_OTHERS 1
 
##############################################################
# ===== OPTIONS BELOW ARE OVERLOADED IF YOU USE OCS GUI =====#
##############################################################

# NOTE: IF YOU WANT TO USE THIS CONFIG FILE INSTEAD, set OCS_OPT_OPTIONS_NOT_OVERLOADED to '1'

# ===== MAIN SETTINGS =====

  # Enable engine logs (see LOGPATH setting)
  PerlSetEnv OCS_OPT_LOGLEVEL 0
  # Specify agent's prolog frequency
  PerlSetEnv OCS_OPT_PROLOG_FREQ 12
  # Configure the duplicates detection system
  PerlSetEnv OCS_OPT_AUTO_DUPLICATE_LVL 15
  # Futur security improvements
  PerlSetEnv OCS_OPT_SECURITY_LEVEL 0
  # Validity of a computer's lock
  PerlSetEnv OCS_OPT_LOCK_REUSE_TIME 600
  # Enable the history tracking system (useful for external data synchronisation
  PerlSetEnv OCS_OPT_TRACE_DELETED 0
 
# ===== INVENTORY SETTINGS =====
 
  # Specify the validity of inventory data
  PerlSetEnv OCS_OPT_FREQUENCY 0  
  # Configure engine to update inventory regarding to CHECKSUM agent value (lower DB backend load)
  PerlSetEnv OCS_OPT_INVENTORY_DIFF 1
  # Make engine consider an inventory as a transaction (lower concurency, better disk usage)
  PerlSetEnv OCS_OPT_INVENTORY_TRANSACTION 1
  # Configure engine to make a differential update of inventory sections (row level). Lower DB backend load, higher frontend load
  PerlSetEnv OCS_OPT_INVENTORY_WRITE_DIFF 1
  # Enable some stuff to improve DB queries, especially for GUI multicriteria searching system
  PerlSetEnv OCS_OPT_INVENTORY_CACHE_ENABLED 1
  # Specify when the engine will clean the inventory cache structures
  PerlSetEnv OCS_OPT_INVENTORY_CACHE_REVALIDATE 7
  # Enable you to keep trace of every elements encountered in db life
  PerlSetEnv OCS_OPT_INVENTORY_CACHE_KEEP 1

dbconfig.inc.php:

<?php
define("DB_NAME", "ocsweb");
define("SERVER_READ","localhost");
define("SERVER_WRITE","localhost");
define("COMPTE_BASE","root");
define("PSWD_BASE","myrootpassword");
?>

ocsinventory.ini: (Server= tried also with ip and localhost --> nothing worked)

[OCS Inventory Agent]
ComProvider=ComHTTP.dll
Debug=0
Local=
NoSoftware=0
HKCU=0
NoTAG=0
IpDisc=
[HTTP]
Server=http://DNSofmyServer/ocsinventory
SSL=1
CaBundle=cacert.pem
AuthRequired=0
User=
Pwd=
ProxyType=0
Proxy=
ProxyPort=0
ProxyAuthRequired=0
ProxyUser=
ProxyPwd=
[OCS Inventory Service]
PROLOG_FREQ=10
OLD_PROLOG_FREQ=10
TTO_WAIT=720

When i go to http://DNSofServer/ocsinventory/ I just get the Error 500

Can't call method "do" on an undefined value at C:/xampp/perl/site/lib/Apache/Ocsinventory/Server/System.pm line 177.

I installed OCS Server with the Setup-File of OCS Inventory NG 2.2.1 so I've installed the components:

Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1

Do you have any suggestions how I can fix this problem? The agent can't send an inventory.

Thanks in advance!

Regards Mike

in OCS Inventory NG agent for Windows by (260 points)
edited by

9 Answers

0 votes
If I change the password from "ocs1" back to the standard "ocs" and restart the server, sending inventory works. I also changed the password on mysql for the table ocsweb. But if I want to take another password than the default password, it won't work. What am I doing wrong?
by (260 points)
0 votes

Hi,

  1. root can't be the user that access ocsweb database. Use mysql ocs user.
  2. When you change the password for ocs mysql user (in mysql) you have to change it in var.php and (z-)ocsinventory-server.conf. After that restart apache otherwise this is not operating correctly.

Regards

Frank

by (90.4k points)
Hi, thx for the answer!

But it is no solution for my problem. If I change the standard password for user ocs in mysql, the client can't connect to the server and says Error 500. Im using Windows Server so the config files are ocsinventory-server.conf and dbconfig.inc.php. I can change it there too, restart the server but the client can't connect to the server then. To test I made a new user "ocsuser" and use this user in both of the config files. Then it works, but only when the password for the user "ocs" is standard password "ocs". When I change it, there is Error 500 again, although I use user "ocsuser" in both config files..

Can you help me to solve this problem? Thanks

Regards

Mike
0 votes
I'm in the same problem.
I install the Agent on my workstation on my machine and I do not get results from collecting information on the server. I was able to observe that the ports during the installation are TIME WAIT and after a minute they disappear without bringing any information from my machine.
Here's the LOG:

Starting OCS Inventory NG Agent on Friday, May 05, 2017 10:50:10.
AGENT => Running OCS Inventory NG Agent Version 2.3.0.0
AGENT => Using OCS Inventory NG FrameWork Version 2.3.0.0
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.0.0>
AGENT => Sending Prolog
DID_CHECK => Read DeviceID <BLM134-2017-05-03-14-05-11> and MACs <74: 27: EA: 7E: C8: 2100: 13: 3B: 10: 34: 7D0A: 00: 27: 00 : 00: 0B74: 27: EA: 7E: C8: 2100: 13: 3B: 10: 34: 7D00: 13: 3B: 10: 34: 7D> in file <ocsinventory.dat>
COM SERVER => Initializing cURL library for sendRequest
COM SERVER => Using cURL with 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://192.168.5.65/ocsinventory>
COM SERVER => HTTP Post response received <HTTP Status Code # 500>
COM SERVER => Cleaning cURL library
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code # 500>
AGENT => Unloading communication provider
AGENT => Unloading plug-in (s)
AGENT => Execution duration: 00:00:00.

If someone could help, I would appreciate it.
Open a questions to this: http://ask.ocsinventory-ng.org/6899/implementing-ocs_inventory-2-3-1-on-centos7
by (430 points)
0 votes

Have you solved the problem? I have  the same problem.

I have updated to version 2.4 and since then I get the error:

Failed to send Prolog <HTTP Status Code #500>

I have checked the file dbconfig.inc.php and it's correct. 

I have checked  file z-ocsinventory-server.conf and i's correct. 

Log: 

Starting OCS Inventory NG Agent on Friday, January 12, 2018 12:21:20.

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 <PC40A8F04933BA-2018-01-10-14-16-20> and MACs <40:A8:F0:49:33:BA00:00:00:00:00:0000:00:00:00:00:00> in file <ocsinventory.dat>

COM SERVER => Initializing cURL library for sendRequest

COM SERVER => Using cURL with server authentication

COM SERVER => Disabling cURL proxy support

COM SERVER => Disabling cURL SSL server validation support

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

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

COM SERVER => Cleaning cURL library

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

AGENT => Unloading communication provider

AGENT => Unloading plug-in(s)

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

Any solution?

by (260 points)
0 votes

I also have updated to version 2.4 and since then I get the error:

Failed to send Prolog <HTTP Status Code #500

by (140 points)
0 votes
Hi,

What errors have you in apache error log file?

Regards

Frank
by (90.4k points)
0 votes

I also have the same problem

==============================================================================

Starting OCS Inventory NG Agent on Wednesday, April 03, 2019 16:40:07.

AGENT => Running OCS Inventory NG Agent Version 2.4.0.0

AGENT => Using OCS Inventory NG FrameWork Version 2.4.0.0

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.4.0.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 => Enabling cURL SSL server validation support using CA Bundle <C:\ProgramData\OCS Inventory NG\Agent\cacert.pem>

COM SERVER => Sending fileGet request to URL <http://192.168.14.62/ocsinventory/deploy/label>

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

COM SERVER => Cleaning cURL library

AGENT => Failed to retrieve Label <HTTP Status Code #500>

AGENT => Sending Prolog

DID_CHECK => Read DeviceID <R9H7GEW-2019-04-03-15-26-14> and MACs <46:F5:20:52:41:5394:39:E5:92:1D:C0F0:DE:F1:9B:90:2D00:09:0F:FE:00:01> 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://192.168.14.62/ocsinventory>

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

COM SERVER => Cleaning cURL library

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

AGENT => Unloading communication provider

AGENT => Unloading plug-in(s)

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

Initially it worked =(
by (140 points)
0 votes
I also have the same problem

==============================================================================

Starting OCS Inventory NG Agent on Friday, January 22, 2021 15:58:04.

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 getLabel request

COM SERVER => Initializing cURL library for getFile

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 fileGet request to URL <http://192.168.10.9/ocsinventory/deploy/label>

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

COM SERVER => Cleaning cURL library

AGENT => Failed to retrieve Label <HTTP Status Code #500>

AGENT => Sending Prolog

DID_CHECK => Read DeviceID <PCNT4HSCMD2-2021-01-22-15-53-57> and MACs <F4:8E:38:E3:AE:D640:49:0F:FD:4B:F800:FF:46:F4:20:7100:FF:46:F4:20:7100:FF:46:F4:20:7100:FF:46:F4:20:7100:FF:46:F4:20:7100:FF:46:F4:20:71> 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://192.168.10.9/ocsinventory>

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

COM SERVER => Cleaning cURL library

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

AGENT => Unloading communication provider

AGENT => Unloading plug-in(s)

AGENT => Execution duration: 00:00:00.
by (160 points)
0 votes
Hi

Look apache error log file to find the corresponding 500 error.

Regards

Frank
by (90.4k points)
 
Powered by Question2Answer
...