logger has problems with errors/warnings containing non-ascii chars

Bug #1073197 reported by Jiri Popelka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned
hplip (Fedora)
Won't Fix
Undecided

Bug Description

Hi,

I think I've found some bugs in logger.

As you can see in this [1] backtrace,
Logger.error(self, message) tries to encode message to "utf-8",
which fails if the message already is in "utf-8" and contains some non-ascii chars.
I think the error() (as well as warn() and fatal()) shouldn't try to encode the message to "utf-8" because Logger.log() does that itself when UnicodeEncodeError occurs.

See also debug(), debug2(), debug3(), info() and note() which do not do that.

[1] https://bugzilla.redhat.com/attachment.cgi?id=633807

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Description of problem:
hplip error

Version-Release number of selected component:
hplip-3.12.10-4.a.fc17

Additional info:
libreport version: 2.0.16
abrt_version: 2.0.16
cmdline: /usr/bin/python /usr/bin/hp-setup -u
kernel: 3.6.2-4.fc17.x86_64

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Created attachment 633804
File: core_backtrace

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Created attachment 633805
File: environ

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Created attachment 633806
File: event_log

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Created attachment 633807
File: backtrace

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Created attachment 633808
File: smolt_data

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Created attachment 633809
File: dso_list

Revision history for this message
In , Jiri (jiri-redhat-bugs) wrote :

The problem seems to be in some "/DevMgmt/FaxConfigDyn.xml" file.
But I haven't been able to find the origin of this file.

Revision history for this message
In , Tim (tim-redhat-bugs) wrote :

Probably comes from the hardware...

Revision history for this message
In , Jiri (jiri-redhat-bugs) wrote :

Stanislav, what's output of the following command (when the printer is on) ?
su -c "lpinfo -l -v"

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :
Download full text (6.9 KiB)

[stas@stas-fedora ~]$ su -c "lpinfo -l -v"
Пароль:
WARNING: gnome-keyring:: couldn't connect to: /run/user/stas/keyring-CzEiC7/pkcs11: Нет такого файла или каталога
Device: uri = http
        class = network
        info = Протокол интернет-печати (http)
        make-and-model = Unknown
        device-id =
        location =
Device: uri = ipps
        class = network
        info = Протокол интернет-печати (ipps)
        make-and-model = Unknown
        device-id =
        location =
Device: uri = lpd
        class = network
        info = Хост или принтер LPD/LPR
        make-and-model = Unknown
        device-id =
        location =
Device: uri = https
        class = network
        info = Протокол интернет-печати (https)
        make-and-model = Unknown
        device-id =
        location =
Device: uri = socket
        class = network
        info = AppSocket/HP JetDirect
        make-and-model = Unknown
        device-id =
        location =
Device: uri = ipp
        class = network
        info = Протокол интернет-печати (ipp)
        make-and-model = Unknown
        device-id =
        location =
Device: uri = hp
        class = direct
        info = HP Printer (HPLIP)
        make-and-model = Unknown
        device-id =
        location = ...

Read more...

Revision history for this message
In , Jiri (jiri-redhat-bugs) wrote :

Hmm, that hasn't shown what I was expecting. Is it a network printer ? If yes, can you show me the output of:
/usr/lib/cups/backend/snmp <ip address or hostname of the printer>

Or do you know the exact model of the printer ?

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Ok, its HP LaserJet Pro 400 color MFP 475 dn

[stas@stas-fedora ~]$ /usr/lib/cups/backend/snmp 10.10.77.83
network socket://10.10.77.83 "HP LaserJet 400 colorMFP M475dn" "HP LaserJet 400 colorMFP M475dn" "MFG:Hewlett-Packard;CMD:PJL,PML,PCLXL,URP,PCL,PDF,POSTSCRIPT;MDL:HP LaserJet 400 colorMFP M475dn;CLS:PRINTER;DES:Hewlett-Packard LaserJet 400 colorMFP M475dn;MEM:MEM=169MB;COMMENT:RES=600x8;LEDMDIS:USB#ff#04#01;CID:HPLJPDLV1;" "Location_Not_Printable"
[stas@stas-fedora ~]$

Revision history for this message
In , Tim (tim-redhat-bugs) wrote :

Could you please try running this command? Make sure the printer is on first.

curl --remote-name http://10.10.77.83:8080/DevMgmt/FaxConfigDyn.xml

You should end up with a FaxConfigDyn.xml file. Could you please attach that to this bug report using the "Add an attachment" link on this page (above all the comments)? Thanks.

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Created attachment 635551
curl --remote-name http://10.10.77.83:8080/DevMgmt/FaxConfigDyn.xml

Ok

Revision history for this message
In , Jiri (jiri-redhat-bugs) wrote :

Thanks.
First let's try to get rid of the logger error.

Stanislav, can you edit /usr/share/hplip/base/logger.py and at line 321 replace
txt = "error: %s" % message.encode("utf-8")
with
txt = "error: %s" % message

Then try to reproduce the problem (have you been actually able to reproduce it ?).

Revision history for this message
In , Stanislav (stanislav-redhat-bugs) wrote :

Thanks!
All is ok, printer and scanner and fax is functioning.
Thank you all!

Revision history for this message
Jiri Popelka (jpopelka) wrote :
Revision history for this message
In , Jiri (jiri-redhat-bugs) wrote :

I've reported the logger problem upstream as
https://bugs.launchpad.net/hplip/+bug/1073197

Revision history for this message
In , Jiri (jiri-redhat-bugs) wrote :

The problem with XML parsing was reported upstream as
https://bugs.launchpad.net/hplip/+bug/1073228

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Revision history for this message
Jiri Popelka (jpopelka) wrote :

The first two hunks of my patch were merged into 3.13.10.

But you still need to fix the fatal() function.

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Jiri,

Thank you for the patch. We will look into this.

Regards,
Amarnath

Changed in hplip (Fedora):
importance: Unknown → Undecided
status: Unknown → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.