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

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

Local Import Error HTTP/1.1 400 Bad Request

I am trying to use the Local Import function to load a .ocs file that was sent to me by someone who remotely scanned a machine.  When I try to import, I am getting an error as follows:

Error HTTP/1.1 400 Bad Request

I was able to import a different .ocs file a few weeks ago into this same system, via the same method, but I have since turned off the VM as it wasnt needed until now.  I have tried to import both .ocs files, the one that worked previously, and the new one, and both give the same error.  

I am running OCS Server 2.3 on a CentOS 7, Apache 2.4, PHP 5.6, mod_perl 2.0.10, PERL v5.16.3.

Also, when I go to the local import screen, it says the server is http://localhost:80/ocsinventory.  Could this be part of the issue?  How do I change that to be the IP instead of localhost? 

Thanks in Advance.

Rick

asked Feb 3 in OCS Inventory NG server for Unix by rickschneider17 (180 points)

5 Answers

0 votes
Hello, can you send error.log of apache2 (var/log/apache2).
answered Feb 28 by castous (760 points)
0 votes

Hey Rick,

I have a similar OS / OCS setup as you and I'm dealing with the same issue on local imports. Are you using https / ssl for your agent(s)?  I get Error HTTP/1.1 400 Bad Request when I change my local import server to "http://localhost:443/ocsinventory".  Perhaps you are sending the request via. https, instead of http?

Vinnie

answered Mar 29 by vinman (310 points)
0 votes

Hi, I have the same issue (related in a topic I've created today...) since upgrade OCS version to the latest (2.3.1).

Here is parts of logs files :

  • In the OCS activity.log, there is no error message.
  • In the Apache access.log, I found this :

10.75.x.x - - [29/Mar/2017:10:26:23 +0200] "GET /ocsreports/index.php?function=admin_local_import HTTP/1.1" 200 3103 "http://ocsserver/ocsreports/index.php?function=admin_logs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) $
::1 - - [29/Mar/2017:10:26:27 +0200] "POST /ocsinventory HTTP/1.1" 400 0 "-" "-"
10.75.x.x - - [29/Mar/2017:10:26:27 +0200] "POST /ocsreports/index.php?function=admin_local_import HTTP/1.1" 200 3171 "http://ocsserver/ocsreports/index.php?function=admin_local_import" "Mozilla/5.0 (Windows NT 10.0; Win$
::1 - - [29/Mar/2017:10:26:28 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.10 (Debian) mod_perl/2.0.9dev Perl/v5.20.2 (internal dummy connection)"
::1 - - [29/Mar/2017:10:26:35 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.10 (Debian) mod_perl/2.0.9dev Perl/v5.20.2 (internal dummy connection)"

  • In the Apache error.log, I have this :

[Wed Mar 29 10:25:20.995195 2017] [mpm_prefork:notice] [pid 15489] AH00169: caught SIGTERM, shutting down
ocsinventory-server: Can't load SOAP::Transport::HTTP* - Web service will be unavailable
ocsinventory-server: Can't load SOAP::Transport::HTTP* - Web service will be unavailable
[Wed Mar 29 10:25:22.817099 2017] [mpm_prefork:notice] [pid 15593] AH00163: Apache/2.4.10 (Debian) mod_perl/2.0.9dev Perl/v5.20.2 configured -- resuming normal operations
[Wed Mar 29 10:25:22.817163 2017] [core:notice] [pid 15593] AH00094: Command line: '/usr/sbin/apache2'

answered Mar 29 by yannc (400 points)
0 votes

I have the same issue. I can't see anything in the logs that identify the root cause.

I see these allover lately but does not seem to break anything:

[Wed May 17 11:17:58.580171 2017] [:error] [pid 3372] [client 10.2.3.4:50247] PHP Warning:  mysqli_connect(): Headers and client library minor version mismatch. Headers:50554 Library:50636 in /usr/share/ocsinventory-reports/ocsreports/require/function_commun.php on line 160, referer: http://ocs-server.lan/?function=admin_local_import

answered May 17 by daniedj (1,000 points)
0 votes
I just did a clean install of 2.3.1 and from that install I cannot import either.
answered May 17 by daniedj (1,000 points)
 
Powered by Question2Answer
...