regression: cannot open network scanner with error "unable to read device-id ret=-1"

Bug #1069898 reported by Andrea Rota on 2012-10-22
This bug affects 8 people
Affects Status Importance Assigned to Milestone
hplip (Ubuntu)

Bug Description

under Ubuntu 12.04 i could scan perfectly via the network from my HP Photosmart Premium MFP (HP C309A), using gscan2pdf as frontend.

during Quantal beta and now on Quantal release, i cannot access the network-connected scanner anymore: when opening the scan dialog in gscan2pdf, the error message displayed is "Error opening device: End of file reached".

on closer inspection, and having tried all the different backends available in gscan2pdf, this seems related to the package libsane-hpaio: if i downgrade this single package to libsane-hpaio_3.12.2-1ubuntu3.1_amd64 from Precise i can scan ok (only side effect is that gscan2pdf hangs on exit and needs to be killed with signal SIGKILL).

in syslog, these are the lines that appear when using the newer libsane-hpaio from Quantal when a frontend application tries to access the scanner:

perl: io/hpmud/pp.c 627: unable to read device-id ret=-1
perl: io/hpmud/hpmud.c 611: invalid channel_open state
perl: failed to open scan channel: scan/sane/hpaio.c 659
perl: sane_hpaio_cancel: already cancelled!
perl: io/hpmud/hpmud.c 611: invalid channel_open state
perl: failed to open scan channel: scan/sane/hpaio.c 659
perl: sane_hpaio_cancel: already cancelled!
perl: io/hpmud/pp.c 627: unable to read device-id ret=-1

hp-check completes without errors nor warnings and correctly finds the network-connected scanner:


device `hpaio:/net/Photosmart_C309a_series?ip=' is a Hewlett-Packard Photosmart_C309a_series all-in-one

hp-scan displays a similar error message to gscan2pdf:

$ hp-scan -d hpaio:/net/Photosmart_C309a_series?ip= -s viewer

HP Linux Imaging and Printing System (ver. 3.12.6)
Scan Utility ver. 2.2

Copyright (c) 2001-14 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Using device hpaio:/net/Photosmart_C309a_series?ip=
Opening connection to device...
error: SANE: End of file reached (code=5)

and the corresponding error messages in syslog are:

python: io/hpmud/pp.c 627: unable to read device-id ret=-1
hp-scan: hp-scan[10183]: error: SANE: End of file reached (code=5)

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: libsane-hpaio 3.12.6-3ubuntu4
Uname: Linux 3.6.2-030602-generic x86_64
ApportVersion: 2.6.1-0ubuntu3
Architecture: amd64
Date: Mon Oct 22 16:51:47 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111011)
 device for hp-cute: hp:/net/Photosmart_C309a_series?ip=
 device for hp-cute-fax: hpfax:/net/Photosmart_C309a_series?ip=
MachineType: System manufacturer System Product Name
Papersize: a4
 hp-cute: HP Photosmart c309a Series, hpcups 3.12.6
 hp-cute-fax: HP Fax hpcups
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.6.2-030602-generic root=/dev/mapper/vgx11miel0-rootfs ro quiet splash vt.handoff=7
SourcePackage: hplip
UpgradeStatus: Upgraded to quantal on 2012-09-09 (42 days ago) 07/25/2007
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1001
dmi.board.asset.tag: To Be Filled By O.E.M. P5B-VM
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr1001:bd07/25/2007:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP5B-VM:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Andrea Rota (hotzeplotz) wrote :
Andrea Rota (hotzeplotz) wrote :

i should add that after several attempts to isolate the issue, what led me to try to downgrade packages related to the scan system one at a time to isolate a possible regression was this post (user is on Fedora):

Andrea Rota (hotzeplotz) on 2012-10-22
description: updated
Andrea Rota (hotzeplotz) wrote :
Till Kamppeter (till-kamppeter) wrote :

According to the linked fedoraforum thread 3.12.4 is the newest HPLIP version where scanning still works.

Can someone of the HPLIP developers at HP look in this and provide a patch for HPLIP 3.12.6 so that we can issue an update for 12.10 (Quantal)? Thanks.

Peter Harvey (pdqharvey) wrote :

Just confirming that I am affected by this bug as well.

HP309a, Quantal, 64bit, HPLIP from repos: printing OK, scanning fails as other have described. I worked through hp-check --fix (with sudo, which seemed to help get past certain errors), but despite all dependencies being met, and all the necessary users and groups being created and available, it still fails.

This has been fixed in hplip-3.12.10 release onwards.

Changed in hplip:
status: New → Fix Released
Peter Harvey (pdqharvey) wrote :

Do we know when the fixed version is likely to reach the repos?

Sanjay Kumar (sanjay-kumar14) wrote :

Hello Peter,

I am not sure about the repo update but you can install latest HPLIP release from: (automatic installer) or (manual installation, if automatic installer is not supported)

Hello Till,

Can you provide an update on this to Peter.

FYI diff:
Index: scan/sane/hpaio.c
--- scan/sane/hpaio.c (revision 17153)
+++ scan/sane/hpaio.c (revision 17154)
@@ -335,7 +335,7 @@
        return soapht_open(devicename, pHandle);
     if (ma.scantype == HPMUD_SCANTYPE_LEDM)
        return ledm_open(devicename, pHandle);
- if ((ma.scantype == HPMUD_SCANTYPE_SCL) || (ma.scantype == HPMUD_SCANTYPE_PML))
+ if ((ma.scantype == HPMUD_SCANTYPE_SCL) || (ma.scantype == HPMUD_SCANTYPE_SCL_DUPLEX) ||(ma.scantype == HPMUD_SCANTYPE_PML))
        return sclpml_open(devicename, pHandle);


Peter Harvey (pdqharvey) wrote :

@ Sanjay:

Hello Sanjay. I really appreciate your help, and have done what you suggested. However, although the printer works (I've not tested the fax), xsane and simple scanner report 'no devices available' and 'no scanner detected' respectively. The HP-C309a is installed on (wired into) a network with a fixed IP (though since the printer works, that is not related to the problem).

Incidentally, running xsane and simple-scan from a terminal both give the output:
"Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated."
I doubt if that is particularly relevant, though.

Many thanks for any light you can shed on this, Peter

Peter Harvey (pdqharvey) wrote :

PS: The printer incorrectly reports that the printer 'has no ink left'.

Peter Harvey (pdqharvey) wrote :

Running hp-check (with ot without --fix)

- reports "No scanner found"
- give the warning "Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices."

Peter Harvey (pdqharvey) wrote :


Deleted printer and fax from 'Printers'
Reinstalled from terminal using hp-setup -g
hp-check now reports that a scanner is installed:
"device `hpaio:/net/Photosmart_C309a_series?zc=HPD6238E' is a Hewlett-Packard Photosmart_C309a_series all-in-one"

Peter Harvey (pdqharvey) wrote :

Update (cont.)

... but running xsane now gives the "Failed to open device 'hpaio ... ... end of file reached' error message.
Which is what I had using the version of HPLIP in the Quantal repos.

Any ideas?

Peter Harvey (pdqharvey) wrote :

I now see that deleting the printer and reinstalling using hp-setup caused the version of hplip in the Quantal repo to be used, which explains the last post. I had assumed it would have been updated. Shall try again from the downloaded verson of HPLIP.

Peter Harvey (pdqharvey) wrote :

Installed again using 'sh'

Reported errors:
error: ubuntu-12.10 version is not supported, so all dependencies may not be installed. However trying to install using ubuntu-12.04 version packages.

warning: An error occurred running 'sudo apt-get update'

and finally:
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/ RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.

Printer reports: "There is a missing print filter for printer 'Photosmart_C309a' on the Ink/Toner tab.

Scanner is still unavailable.

george pon (geponchuk) wrote :

tried everything in mint 13, can't see scanner with xsane and simple scan.

Peter Harvey (pdqharvey) wrote :

I finally got it working, although apt complains. Andrea Rota does in fact give the solution above, though I missed it as well:

"if i downgrade this single package to libsane-hpaio_3.12.2-1ubuntu3.1_amd64 from Precise i can scan ok"

I found a copy of that file (here:, but then ran into difficulties installing it. Synaptic or Apt either forced me to remove the other HP files (hplip and dependencies), or if I installed this file alone, they then insisted that this file be upgraded to the latest version - which was not the point. The answer, I eventually discovered, is to have hplip fully installed, THEN force the installation of this single .deb, using the command:

 sudo dpkg -i libsane-hpaio_3.12.2-1ubuntu3.1_amd64.deb

During the process you have to choose between keeping the later version or insist (correctly) on installing this apparently dodgy earlier one.

In fact, I did this after running the latest version of HPLIP (which I downloaded from here: I'm not sure if I gained anything using this latest version (which probably only supports more printer models, rather than offering more features - though it does offer installation of fax facilities, which is not something I have had before), but do note that if you try it, it requires that an existing version of HPLIP be already installed. No idea why.

Peter Harvey (pdqharvey) wrote :

Having done the above, I am faced with complaints from Synaptic and Apt that hplip has unmet dependencies (it is considered a broken package), and I cannot continue to add software. 2 questions:

1) Is there a way around this?
2) when will there be a fix for hplip?

Help much appreciated.

Peter Harvey (pdqharvey) wrote :

Solution found to Q1 above:

sudo apt-get install -f

Chose to keep existing (i.e. not update to 'correct' version) version of lbsane-hpaio and Synaptic was happy.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in hplip (Ubuntu):
status: New → Confirmed
Peter Harvey (pdqharvey) wrote :

Update to 'Solution' above:

This does not fix it after all. Instead it updates libsane-hpaio to the later version, whereupon scanning is again impossible. But adopting the earlier package is a temporary workaround until a fix appears.

Peter Harvey (pdqharvey) wrote :

This is NOT fixed in hplip-3.12.10a.

I have run it a number of times, manually and automatically. Printing seems OK, but attempting to scan still gives the 'end of file' error.

Or am I missing something?

Andrea Rota (hotzeplotz) wrote :

i have just had some minutes to recompile libsane-hpaio from Quantal's current source package (3.12.6-3ubuntu4) after applying the patch provided by Sanjay Kumar in comment #8 above and i can confirm that Sanjay's patch fixes the issue for me.

Peter, i'm not sure why installing hplip-3.12.10a from source or from hplip's upstream packages is not fixing the issue for you - as far as i can see from hplip-3.12.10a source tarball, the patch i have applied manually to the Ubuntu 3.12.6-3ubuntu4 package is there in upstream's latest release.

having said that, i *think* that before coming to identify the Ubuntu Q libsane-hpaio as the cuprit for the issue i was experiencing, i had indeed tried installing a newer version of hplip from upstream and that did not fix the issue for me either. now i can't remember if that was 3.120.10 or 3.12.10a, although i *think* it was the former - but this specific bit of code was added in 3.12.9 so that's pretty weird. maybe i had inadvertently left around some Ubuntu library before installing hplip upstream.

Peter Harvey (pdqharvey) wrote :

@Andrea: Thanks for looking at it. However, I'm not at all sure what I should do now. I did eventually manage to compile something once (gtkpod, broken on Precise), but it took a lot of figuring out for someone not used to it. Is there a patched version I can run, or even a .deb?

Andrea Rota (hotzeplotz) wrote :

@Peter until an official update is released in Ubuntu, if you use Quantal on amd64 i'm happy to share my compiled .deb - just PM me via launchpad. i am not able to produce i386 packages at the moment, unfortunately.

Piedro Kulman (piedro) wrote :

Hi there!
I have the same problem on Kubuntu 12.10, 64bit, fresh install.
Also a network printer 309a photosmart all-in-one with fixed IP - but as stated before the connectiontype doesn't seem to be the problem.

regression is nasty - plz make anolder version available,
thx for the efforts,

Andrea Rota (hotzeplotz) wrote :

hi all (affected users),
until a package incorporating upstream's fix makes its way to the official Quantal repos, since i have been receiving a few requests for the .deb i compiled for my own workstation, i have uploaded a hotfix to my ppa here:

the only packages really needed should be

for amd64:
for i386:

please note that this is just a hotfix package i created primarily for myself - i updated the Quantal source package to the best of my packaging knowledge, but i cannot guarantee that this package does indeed solve the issue, does work at all, does not break badly something else, does not cause a black hole to swallow your computers, the whole planet, etc.

Peter Harvey (pdqharvey) wrote :

I'm on Quantal, amd64 and it fixed it for me. Unless it was the cause of the mother of all storms in the Atlantic, I can report no ill effects. Big thanks to Andrea.

Piedro Kulman (piedro) wrote :

Same here!

On Kubuntu Quantal 64bit it runs smooth so far ...

Big thx for your help @hotzeplotz !!!



   I guess, this was the issue happening in hplip-3.12.6 version. However this problem has been fixed and released in hplip-3.12.10 release.

Those who are working on Kubuntu/Ubuntu 12.10, it has hplip-3.12.6 version. Hence requesting the people to install latest hplip from site.

The same has been given in the comment # 8.

Peter Harvey (pdqharvey) wrote :


Please see my comments #9 and #33. This is not, repeat *not* fixed in the version of hplip on the HP website!

Piedro Kulman (piedro) wrote :


Yes Peter is right (see comment above)! This is not fixed in the HP Website version! After a long thread like this with the issue of the problem not being fixed by the HP web download, plz, don't give misleading information. I thought maybe I have made a mistake, because you brought it up again - insisting it works, - and I tried again. But as it turns out Peter's insight is still valid ... - so the second effort was a waste of time ...

@ Peter

I have been happy with the file by Andrea, but now I have to deal with some defect packages and dependencies when using syanptic. Do you have the same problems and couls you solve it?

thx for reading,

Piedro Kulman (piedro) wrote :

To be more precise:
Andreas fix works but when using apt-get or synaptic now I get the notice that the package hplip is defect.
And I can't do a lot (not even updates) without repairing the broken dependencies first. I can use dpkg to still install stuff but the normal apt-get upgrade won't work anymore.

So how to make this workaround file by @hotzeplotz work?

Peter Harvey (pdqharvey) wrote :


Hi. I'm fairly sure I uninstalled ALL versions of hplip, then installed only the version in the repos - not the website version.

I used gdebi (if you've not got it, get it from the repos - it is a far quicker way of installing .debs) to install Andrea's .deb. It pointed out that I was RE-installing that package, but let me do so without further complaint. Since it bears the same version number as the one in the repos, I have had no problems updating etc.

I wonder if you are still using the website version of hplip (3.12.10a)? If so, Andrea's version of libsane-hpaio (3.12.6) would appear to the package manager as an outdated version, and could be the cause of the errors.

I'm not an expert, but if I have figured it out correctly, I hope it helps you :)

Piedro Kulman (piedro) wrote :

Thx for your post! sadly I've done the same thing:

- completely removed all hplip related packages
- deleted cached deb-files in the /var/cache/apt-get folder
- installed the repo version 3.12.6
- used dpkg to install the @hotzeplot file (will try with gdebi but should be the same)
- works great! But now everytime I want to use apt-get per console or via synaptic I get:

>> hplip: depends on: libsane-hpaio (=3.12.6-3ubuntu4), but (=3.12.6-3ubuntu4ppa1) is installed
>> please repair by using -f

Using -f with apt-get repairs the packages thereby removing hplip !

And I don't see any way to update any packages before repairing this.

thx for reading,

Peter Harvey (pdqharvey) wrote :

Sorry to hear that. I've looked in Synaptic and it shows the installed version as '3.12.6-3ubuntu4', so the system has installed the @hotzeplot file 'believing' it to be a reinstallation of the repo's one.

I see that yours reports it as coming from a ppa (3.12.6-3ubuntu4ppa1) - does that mean you added Andrea's ppa as a software source? I can imagine that might cause Synaptic etc. to give the @hotzeplot file a different version label. I simply downloaded it from the link and installed the .deb file locally.

Best of luck.

Piedro Kulman (piedro) wrote :

That is strange indeed! I've downloaded the file (64bit) from the link in @hotzeplotz comment #27 and it's name is "libsane-hpaio_3.12.6-3ubuntu4ppa1_amd64.deb". trying to rename it doesn't effect the version that shows in synaptic. I guess the problem is NOT the file of Andrea - it rather is the hplip package expecting the version you mentioned.

Is there any way for me to manually overwrite the internal version label in your package?
It's working great just breaks the dependencies of hplip, so apt repeatedly wants to repair this by removing hplip.

Thx for all your efforts,

Peter Harvey (pdqharvey) wrote :

You're quite right. I had forgotten that Andrea had sent me the file as an attachment to a private email, and it is not the same (name or filesize). I suppose that she is happy to share it further, so if you send me an email, I'll forward it.

Is it OK for me to send Piedro the file? Unless I hear soon, I'll assume it is. However, his experience does suggest that the version you put in your ppa is not the same, and doesn't provide a fix.

Andrea Rota (hotzeplotz) wrote :

@pdqharvey you're right, the package i sent you privately is a different one as i hadn't done the patching and packaging properly to be published in a PPA at that stage as i was too busy - you can certainly share the .deb i sent you privately: as far as i can tell the only difference is that i hand't bumped the package version according to the ubuntu ppa packaging guidelines, but the patched code should be the same
@piedro you should be able to recompile my patched package from source by via apt-get source making sure apt fetches the source from my PPA and you can then change the package version string to anything suitable so that your upgrades don't break - if you are not familiar with Debian packaging, the relevant documentation should be all here:

Piedro Kulman (piedro) wrote :

Thanks so much to @hotzplotz and @pdqharvey!

Peter has sent me the file with the old version labels that had been created by Andrea before.
Now everything works and apt-get (or Synaptic) is willing to work with my packages again ...

I am very glad this has turned out working and I hope someone will soon incorporate the workaround in the official version of hplip.

thx for all your efforts!


Andrea - genius. Thanks, all working for me.

Unfortunately, this fix is not permanent and I have broken package dependencies.

Does anyone know when HP will release a fix for the HPLIP packages?

Peter Harvey (pdqharvey) wrote :


I presume you used Andrea's ppa. She sent me a .deb which I installed instead of the libsane-hpaio in the Quantal hplip package. It worked for me and Piedro and I've had no further problems. I'll try to attach it to this comment. Hope it works!

Thanks Peter.
I installed the deb and things seem to be working perfectly.
Looks like there are no issues with other packages also, so all is well.

Appreciate your help!

Lilian ROBERT (lilian-robert) wrote :


I have read all the comments but I am not sure what to do (my english is poor...).

The problem occurs on the PC of a family member of myself and I cannot install packages that broke something else or break update manager or synaptic.

I need to make working the scanner included with her HP PHotosmart Premium C309a, is there a user-friendly solution ?

I think I understood that the problem is fixed, will the fix come automatically in a next update?

Thank you for your help.

PS the PC has Ubuntu 12.10 i386.

Andrea Rota (hotzeplotz) wrote :

hi Lilian,
i have been using the standard Ubuntu packages for libsane-hpaio with no issues since Ubuntu 13.04 (now on 13.10 with libsane-hpaio version 3.13.9-1).

On ubuntu 12.10 i386, there is a recently updated package from the official Ubuntu security updates source:, however i'm not sure whether this only includes security updates or also bug fixes such as the one related to this launchpad bug thread.

if that doesn't work, you could try installing the package i created a few months ago for my own 12.20 system:
although from earlier messages in this thread it seems that other could not successfully install this package from my PPA. unfortunately i hadn't compiled an i386 package back then and i don't have an Ubuntu 12.10 system available anymore so i can only point you to either the Ubuntu security updates package or my PPA, if you need an i386 package - i hope you can get this scanner working.

gf (gf-interlinks) wrote :

Hello Andrea,
Thank you for submitting this bug and reporting a problem with the hplip package. You made this bug report in 2012 and Ubuntu and hplip have been updated since then.

Could you confirm that this is no longer a problem and that we can close the ticket?
If it is still a problem, are you still interested in finding a solution to this bug?
If you are, could you let us know and, in the current version, could you run the following (only once):
apport-collect 1069898
and upload the updated logs and and any other logs that are relevant for this particular issue.

Thank you again for helping make Ubuntu better.
[Ubuntu Bug Squad volunteer triager]

Changed in hplip (Ubuntu):
status: Confirmed → Incomplete
Andrea Rota (hotzeplotz) wrote :


thanks for the heads up. unfortunately i don't own this MFP anymore so i am not able to triage this bug on a current Ubuntu.

seeing that there hasn't been any other activity on this issue since October 2013, i'd think it could be assumed that the issue hasn't been occurring with newer hplip versions: i would close this issue (as invalid? not sure what would be appropriate according to Ubuntu triaging policies).

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