hal_lpadmin reports cups error incorrectly

Bug #160386 reported by drewp
6
Affects Status Importance Assigned to Milestone
hal-cups-utils (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: hal-cups-utils

I don't care much about this error or cups, as I am actually trying to use a usb/parallel convertor to control electronics. But there is what looks like a typo in the python code:

Nov 5 20:00:06 score kernel: [1031822.460000] usb 1-2: new full speed USB device using uhci_hcd and address 13
Nov 5 20:00:06 score kernel: [1031822.664000] usb 1-2: configuration #1 chosen from 1 choice
Nov 5 20:00:06 score NetworkManager: <debug> [1194321606.296508] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_4348_5584_noserial').
Nov 5 20:00:06 score kernel: [1031822.704000] drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 13 if 0 alt 0 proto 2 vid 0x4348 pid 0x5584
Nov 5 20:00:06 score NetworkManager: <debug> [1194321606.386101] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_ffffffff_ffffffff_noserial').
Nov 5 20:00:06 score NetworkManager: <debug> [1194321606.596959] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_4348_5584_noserial_usbraw').
Nov 5 20:00:07 score hal_lpadmin: Unable to connect to CUPS: 'httpConnectionEncrypt failed'. Is CUPS running?
Nov 5 20:00:07 score hal_lpadmin: File "/usr/lib/hal/scripts/hal_lpadmin", line 413, in main h = HalLpAdmin()
Nov 5 20:00:07 score hal_lpadmin: File "/usr/lib/hal/scripts/hal_lpadmin", line 387, in __init__ self.addPrinter()
Nov 5 20:00:07 score hal_lpadmin: File "/usr/lib/hal/scripts/hal_lpadmin", line 399, in addPrinter printer = HalPrinter()
Nov 5 20:00:07 score hal_lpadmin: File "/usr/lib/hal/scripts/hal_lpadmin", line 18, in __init__ os.exit (1)
Nov 5 20:00:07 score hal_lpadmin: AttributeError: 'module' object has no attribute 'exit'

/usr/lib/hal/scripts/hal_lpadmin:
     15 except RuntimeError, e:
     16 syslog (LOG_ERR,
     17 "Unable to connect to CUPS: '%s'. Is CUPS running?" % e)
     18 os.exit (1)

line 18 should probably say "sys.exit(1)"

Changed in hal-cups-utils:
status: New → Fix Committed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

hal-cups-utils (0.6.13+svn86-0ubuntu1) hardy; urgency=low

  * New upstream release
     o Subversion snapshot r86
     o Use "lsusb" and "hp-makeuri" instead of "hp-probe" and "hp-info", this
       needs less I/O.
     o Fork the creation of the print queue into a sub-process. This is
       needed as on detection of an HP LaserJet 1018/1020 HPLIP loads
       (triggered by UDEV) the firmware into the printer and this uncouples
       the printer from the usblp kernel module. This lets HAL assume that
       the printer got disconnected and HAL kills the hal_lpadmin process
       which creates the queue. The child process does not get killed so
       that this is the only solution to get a queue automatically created
       for these printers.
     o Do only one notification at the tray icon when a new printer got set
       up, also if it needs two queues (printer and fax). Otherwise the tray
       icon will disappear on clicking the first notification and the second
       one appears without icon.
     o Replaced a wrong "os.exit()" by "sys.exit()" (LP: #160386).
     o Made check for removal of manufacturer name from model name
       case-insensitive (LP: #150219).
     o Let hal_admin not fail if "lsusb" or "hp-makeuri" are not installed.
       Simply do not use HPLIP URIs then.
  * debian/patches/01_interpreter_path.patch: Regenerated.
  * debian/control: Added dependency on python-cups (LP: #144586).
  * debian/control: Added "Recommends: hplip, usbutils". These are needed
    to automatically set up print queues with HPLIP.

 -- Till Kamppeter <email address hidden> Fri, 07 Dec 2007 20:49:31 +0000

Changed in hal-cups-utils:
status: Fix Committed → Fix Released
Revision history for this message
acacha (sergi-tur) wrote :

Hello Till,

It seems that this patch is what i need.

How can I install this version of hal-cup-utils on my Ubuntu Gutsy?

Revision history for this message
acacha (sergi-tur) wrote :

I've tried the following:

$ cd
$ mkdir test
$ cd test
$ wget https://launchpad.net/ubuntu/hardy/+source/hal-cups-utils/0.6.13+svn86-0ubuntu1/+files/hal-cups-utils_0.6.13+svn86.orig.tar.gz
$ wget https://launchpad.net/ubuntu/hardy/+source/hal-cups-utils/0.6.13+svn86-0ubuntu1/+files/hal-cups-utils_0.6.13+svn86-0ubuntu1.diff.gz
$ wget https://launchpad.net/ubuntu/hardy/+source/hal-cups-utils/0.6.13+svn86-0ubuntu1/+files/hal-cups-utils_0.6.13+svn86-0ubuntu1.dsc
$ dpkg-source -x hal-cups-utils_0.6.13+svn86-0ubuntu1.dsc
$ cd hal-cups-utils-0.6.13+svn86
$ sudo apt-get install cdbs libcupsys2-dev
$ fakeroot
# dpkg-buildpackage
# exit
$ cd ..
$ sudo dpkg -i hal-cups-utils_0.6.13+svn86-0ubuntu1_i386.deb

But I still have the same problems:

$ dmesg | grep usb
...
[ 328.949129] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 4 if 0 alt 0 proto 2 vid 0x03F0 pid 0x4117

Ok

But when i tried to print a file nothing happens:

$ dmesg | grep usb
...
[ 328.949129] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 4 if 0 alt 0 proto 2 vid 0x03F0 pid 0x4117
[ 1537.172132] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/class/usblp.c: usblp0: removed

Revision history for this message
acacha (sergi-tur) wrote :

Ok now it works!

I found it was a problem with firmware. I forget to download the firware.

$ cd /usr/share/foo2zjs/firmware
$ getweb 1018
$ sudo -i
# arm2hpdl sihp1018.img > sihp1018.dl
# rm sihp1018.img
# exit

I've restarted the printer and now it works. I've done some test like trying to print without paper (before this test freezes the printer and doesn't works until I restarted in Windows) and now all is ok.

Thank you.

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.