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

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

Error 500 when adding software to the inventory

Hello Folks,

first of all, I'm sorry but I'm not allowed to post logfiles on the internet. I'm aware that this complicates the debug process but maybe someone had the problem before and knows what to do.

OCS works fine except the inventory of new software. If I install a new peace of software on one of my machines I get an HTTP 500, with the next inventory. If I remove the software again, the inventory works. If I use --nosoftware the inventory works even with the new software installed.
I allready checked the values of the softwares.id column and we're far from MAX_INT. The current highest ID is 85840603.

After setting OCS_OPT_DBI_PRINT_ERROR to 1 I finally got some debug info with duplicate entries. For me it seams, OCS tires to add a new Software with ID 0. Odd thing is there is no software with ID=0 in the table, hence there is no duplicate entry.
I also checked all other tables for ID=0 without any luck.

# activity.log
Thu Sep 14 12:33:38 2017;19382;113;IT111111-2017-04-25-08-38-05;;OCS-NG_WINDOWS_AGENT_v2.1.0.1;inventory;u:softwares
Thu Sep 14 12:33:38 2017;19382;515;IT111111-2017-04-25-08-38-05;;OCS-NG_WINDOWS_AGENT_v2.1.0.1;end;error

# httpd error_log
DBD::mysql::st execute failed: Duplicate entry '3998-0' for key 1 at /usr/lib/perl5/site_perl/5.8.8/Apache/Ocsinventory/Server/Inventory/Update.pm line 147.

# ocsinventory-agent.log
[Thu Sep 14 12:44:46 2017][error] Cannot establish communication : 500 Internal Server Error
in OCS Inventory NG server for Unix by (480 points)

1 Answer

+2 votes
apache  http-error.log

DBD::mysql::db DESTROY failed: MySQL server has gone away at /usr/local/lib/perl5/site_perl/Apache/DBI.pm line 212.
DBD::mysql::st execute failed: Unknown column 'MTU' in 'field list' at /usr/local/lib/perl5/site_perl/Apache/Ocsinventory/Server/Inventory/Update.pm line 159.

I create MTU field.

mysql -p ocsweb

by (200 points)
Powered by Question2Answer