ocsinventory-agent sends a invalid report to the server

Bug #767012 reported by Sergio Soto on 2011-04-20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ocsinventory-agent (Ubuntu)

Bug Description

Binary package hint: ocsinventory-agent

The pakcage is:

the version:
root@myhost:~# dpkg -l|grep ocsinventory
ii ocsinventory-agent 2:1.1.1-2

The ubuntu version:
root@myhost:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04 LTS
Release: 10.04
Codename: lucid

The apache error log:
root@ocsinventory-server:~# tail /var/log/apache2
[Wed Apr 20 12:21:00 2011] [error] [client] :1995: parser error : Input is not proper UTF-8, indicate encoding !\nBytes: 0xF1 0x6F 0x6E 0x20\n <COMMENTS>Ca\xf1on de Red Virtual</COMMENTS>\n ^\n at /usr/lib/perl5/XML/LibXML/SAX/Parser.pm line 31\n

The problem is in the encoding of the client. The "\xf1" char is the letter "ñ", that corresponds with the application "Cañon de Red Virtual"

I try installing the version 1: of the package and it works right. The report is sent and the apache server doesn't crash.

Changed in ocsinventory-agent (Ubuntu):
status: New → Confirmed
Eric Seigne (eric-seigne) wrote :

Hello all,
here is a dirty workaround (in my case):

edit /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm

         'COMMENTS' => $4,

         'COMMENTS' => '',

and it could work ... but there is no "comments" in software inventory ... in my case that's less important than "no inventory at all"


Personally, I have circumvented this bug by a just-a-little-less-dirty workaround (see attached patch).
It will only affect fields/data that contain non-UTF-8 character(s) and just strip those from the field rather than suppressing the entire field.
Hope this helps.

The attachment "non-utf-8.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch

Forget my previously-posted patch. It was a bit too aggressive on the character substitution and led to other errors in similar situations.

The newly attached patch should solve this.

Sorry for the trouble and cheers

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers