Scanner not found

319 views
Skip to first unread message

Piet de Vries

unread,
May 24, 2014, 8:32:46 AM5/24/14
to open...@googlegroups.com
Hi Wayne,

Yesterday and today I tried the new version of openDIAS and the installation went fine but openDIAS does not find my scanner, the HP PhotoSmart 2575. I did the following;
  • Clean install of Ubuntu server 14.04, 64 bit
  • After install a complete update, apt-get update, apt-get dist-upgrade -y, apt-get autoclean, apt-get autoremove -y
  • After updating and rebooting I installed the hplip package, apt-get install hplip
  • Next was the hp-setup -i command which finds my network attached scanner and I could print a testpage. Printing the testpage did succeed but on the console the were a lot of ' cannot adopt OID' errors. Googling on these errors suggests that the installed version of HPLIP is not compatible with Ubuntu 14.04.
  • Next was the test of the scanning functionality, scanimage -L did list my scanner and also the command scanimgae > gg.test did produce results
  • After this I downloaded the 64-bit version of openDIAS suitable for Ubuntu 14.04
  • Installed it with dpkg -i opendias....
  • To solve dependencies I ran apt-get install -f
  • Just to make sure I performed another reboot
  • Now time to start openDIAS, service opendias start
  • Logging in the web-interface went nicely, the language was correctly set from the web-browser which is neat
  • Acquiring a new document did not find any scanner which is weird because scanimage -L still lists my scanner
To try to solve the problem I ran the hp-check -t command which produced an lot of output concerning dependencies that are missing or not the correct version. Most disturbing was the message that the supplied version of hplip is not compatible with Ubuntu 14.04. the hp-check command recommended to run the hp-doctor command which should solve all problems, this turned out to be not a good idea.. Being brave I purged hplip, apt-get purge hplip, and installed the latest version of hplip as supplied from the hplip website. Installation took quite a while and the result was disappointing. openDIAS could still not find the scanner and the command scanimage -L did result in segmentation faults.

I suspect hplip of being the cause of all the problems but I'm looking for assurance on this statement before filing a bugreport. Did you get the HP PhotoSmart running in the latest version of openDIAS?

To rule things out I also installed the previous version of openDIAS in an Ubuntu 12.04 machine and this went OK, the scanner was found and usable from openDIAS.

Hope to hear from you soon.

Piet de Vries  

Wayne Booth

unread,
May 24, 2014, 11:25:38 AM5/24/14
to open...@googlegroups.com
Hi Piet,

As you remember, I bought a second hand HP Photosmart 2575 to help with some problems you had before.
I've dusted this off and have given it a try.
Apparently I already had the latest version of hplip installed. (It must have been installed when I upgraded my machine to 14.04).
An "image -L" reported the correct scanner (connected via USB)
A reasonable image was also produced from "scanimage".
When I asked openDias to "acquire", with only the HP attached, no problem. The scanner was found and it produced a decent scan.

You may want to go back to the Ubuntu supplied version. Do a purge remove, then install a fresh.
then if scanimage works again, check if you have a "SANE" file "/etc/sane.d/dll.d/hplip" that contains "hpaio".

Good luck.
Wayne
====================

Piet de Vries

unread,
May 25, 2014, 4:14:47 AM5/25/14
to open...@googlegroups.com
Hi Wayne,

After the failure of trying to use the latest version of hplip I setup a brand-new virtualmachine with the hplip version installed from the official repos. I checked the hplip file for the text hpaio and this text is present. The only difference between your setup and mine is that your printer is connected through USB while mine is connected over the network.

Is there a way for me to trace where the error of not finding the scanner might come from?

Kind regards,

Piet

Piet de Vries

unread,
May 29, 2014, 6:34:42 AM5/29/14
to open...@googlegroups.com
Hi Wayne,

I did some more fiddling and I got a bit further. First I solved all the required dependencies for HPLIP. Further I gave my VM a USB-port wich did solve another error from HPLIP. After that I increased the loglevel for openDIAS and gave it another spin. openDIAS still not detects my scanner but now the logfile is telling me that is hitting some segmentation fault, somewhere in the process of searching for scanners;

       username : admin
      realname : Admin User
      role : 1
20140529101849:A2A52700:DBG:db.c:310 Run Query (9c04f1b0)
20140529101849:A2A52700:DBG:db.c:413 Free recordset (9c04f1b0)
20140529101849:A2A52700:DBG:web_handler.c:698 Collected post data:
      action : getScannerList
20140529101849:A2A52700:INF:web_handler.c:728 Processing request for: getScannerList
20140529101849:A2A52700:INF:saneDispatcher.c:128 Child process created 1207
20140529101849:A2A52700:INF:saneDispatcher.c:115 Just about to start the worker: /usr/bin/opendias_worker nl
20140529101849:3BE8A780:DBG:opendias_worker.c:55 database file is /var/lib/opendias/openDIAS.sqlite3
20140529101849:3BE8A780:DBG:localisation.c:94 loading translation file: /usr/share/opendias/language.resource.en
20140529101849:3BE8A780:INF:opendias_worker.c:65 Worker started and ready to process: internalGetScannerList
20140529101855:3BE8A780:INF:scan.c:741 No devices found
20140529101855:3BE8A780:INF:opendias_worker.c:32 Worker Finished
20140529101855:3BE8A780:DBG:db.c:444 Closing database
20140529101857:A2A52700:ERR:saneDispatcher.c:140 Child sane process was signalled (Segmentation fault) to finish early
20140529101857:A2A52700:DBG:saneDispatcher.c:143 Child sane process created a dump file
20140529101857:A2A52700:DBG:saneDispatcher.c:152 Worker sent a response of:
20140529101857:A2A52700:DBG:saneDispatcher.c:168 Caching the response.
20140529101857:A2A52700:DBG:pageRender.c:68 RESPONSE WAS: ERROR
20140529101857:A2A52700:DBG:web_handler.c:1141 Serving the following content: <?xml version='1.0' encoding='iso-8859-1'?>
<Response><error>ERROR</error></Response>
20140529101857:A2A52700:DBG:web_handler.c:156 setting cookie 'o_session_id=7516bbd1-c611-4bda-b5d9-242640c2e834; path=/; max-age=3595'
20140529101857:A2A52700:DBG:web_handler.c:405 Language setting (from header) is: nl
20140529101857:A2A52700:DBG:web_handler.c:471 Client provided session cookie: 7516bbd1-c611-4bda-b5d9-242640c2e834
20140529101857:A2A52700:DBG:web_handler.c:484 Using session: 7516bbd1-c611-4bda-b5d9-242640c2e834
20140529101857:A2A52700:DBG:web_handler.c:486 Session contains:

Also syslog mentions the seg.fault like;
May 29 12:18:56 vb-opendias1404 kernel: [  256.433243] opendias_worker[1208]: segfault at 7f70314e9248 ip 00007f70314e9248 sp 00007f703083eea0 error 14 in libffi.so.6.0.1[7f7031906000+7000]

Could you give me a hint of where the problem might come from or how how I can figure out myself where the problem might come from?

Wayne Booth

unread,
Jun 1, 2014, 1:42:15 AM6/1/14
to open...@googlegroups.com
Hi Piet,

It looks like you've hit one of the problems that forced a large amount of work in the the 0.9 series to cater for.
It seems that quite a number of SANE backends will segfault when pushed outside what some would call a 'normal use case'. When the backend is configured in a certain way (eg hplip over a network) the backend library would always trigger a segfault - irrespective of the frontend being used (opendias or some other, eg simpleScan).

Because openDias was intrinsically linked to the SANE backend library, these segfaults would bring openDias down.
I investigated several backends that would die like this (including the sane test backend if I remember) and I found that to solve the problem the sane backend would need to be 'fixed' in some way. This is outside the scope of the openDias team, so we've reported the problems and decoupled sane from the main opendias process (segfaults are just swallowed now).

Do you get the same effect when using a different scanner frontend (say simpleScan)? If so, I think the only thing you can do is ask the developers of SANE or HPLIP to fix the problem.

Sorry I can't help. Do let me know what you find out.

Regards

Wayne

Piet de Vries

unread,
Jun 2, 2014, 1:22:07 PM6/2/14
to open...@googlegroups.com
Hi Wayne,

Thanks for your suggestions. I tried them and the result is weird. On my virtual machine I tried the hp-scan command without any option, this produces a nice scan. I also tried to make a scan using the scanimage command, this also went fine. Next I tried to make a scan in openDIAS wich ended in an error where there were no scanners found. Running hp-scan and scanimgae afterward went without any problem.

Next I installed the KDE environment with the SkanLite application. This took a while and after that SkanLiet scanned OK. I also installed xsane and xsane makes nice scans. In between I again tried openDIAS and it fails to find my scanner all the time. Running scanimage and hp-scan from the commandline still produces nice scans. Next I installed simple-scan and also simple-scan produces nice and clear scans.

Now, do I need to ask the developers of sane and/or hplip for a solution and if so what should I ask them to change?

Hope to hear from you soon,

Piet

Wayne Booth

unread,
Jun 7, 2014, 5:00:02 PM6/7/14
to open...@googlegroups.com
Interesting that you can get your configuration working using other frontends.
I'll try things out using wifi here.

Piet de Vries

unread,
Jun 27, 2014, 8:41:10 AM6/27/14
to open...@googlegroups.com
Hi Wayne,

There is a new version op HP-LIP available in the Ubuntu repository so I gave it another shot using this updated version. Sadly openDIAS still gives the same error of not finding any scanner. The command scanimage -L still lists my scanner.

Did you find anything that could solve the problem I'm facing?

Kind regards,

Piet

homi...@gmail.com

unread,
Jul 2, 2014, 12:44:25 PM7/2/14
to open...@googlegroups.com
Just contributing to this error, got the same problem, same error message in syslog and more or less the same situation: one network scanner on my network: a Brother dcp-9055 cdn and a usb scanner locally attached: a scansnap s1300i. Both working fine with Xsane, SimpleScan and Scanimage.
Using Ubuntu 14.04 x64, all updates etc installed. Using sane from git for sane backends 1.0.25 (required for scansnap s1300i), sane git repository by rolf bensch.

Wayne Booth

unread,
Jul 3, 2014, 3:15:40 PM7/3/14
to open...@googlegroups.com, homi...@gmail.com
Hi, 
Just to let you know, I have replicated the problem.
I'll report back when I know more.

Regards
Wayne

Wayne Booth

unread,
Jul 6, 2014, 10:51:03 AM7/6/14
to open...@googlegroups.com, homi...@gmail.com
OK guys, I have a prognosis, but a dubious fix.

in the changes for the last release, I isolated out the sane processing into a separate process. This isolation was defend against SANE errors bringing the whole of openDias down. When this process starts it immediately initialises SANE, does the processing it needs to (in this case gather information about the available scanning devices, then returns the information to the client and does some cleanup/shutdown routines.
It's the SANE shutdown call that is causing the failure. (I assume that) since the SANE shotdown call is made so soon after the get devices call, the background SANE processes have not completed, and so a SEGFAULT is produced. This segfault is caught by the openDias parent and then reported back to the user as an error - ergo 'no devices'.

The fix is simple but dirty. I could:
  • I can add a sleep just before the call to SANE-cleanup routine. This would 'hopefully' (but not guaranteed to) allow SANE to finish all it's background processing before closing down.
  • Not call the SANE-cleanup routine and just finish the openDias child process. This will stop the errors, but could cause other problems down the line.
I've got a branch of the both working locally, so if your interested I could let you have a copy.

Interestingly, this only happens for networked scanners. I supposing the SANE has some additional work to do for none USB conected devices which makes the result none sequential.
Further, I'd expect the the other programs you're seeing successful scans on, will not have to protect themselves from SANE failures as much - since they themselves are not services, and so are generally not long running. Therefore they can stand to initialise SANE when that process starts up, and only have to call the SANE-cleanup when the program itself closes down.

Regards.
Wayne.

Wayne Booth

unread,
Jul 6, 2014, 10:51:51 AM7/6/14
to open...@googlegroups.com
incase you don't get alerted, see my post below...

Piet de Vries

unread,
Jul 7, 2014, 12:13:18 PM7/7/14
to open...@googlegroups.com, homi...@gmail.com
Hi Wayne,

I read your reply and I'm glad you could reproduce the error I encountered. Both fixes sound pretty dirty but they could be a work around for a short time. I think that the solution with the extra 'sleep' is the least harmful. This fix only affects openDIAS while the other fix has the potential, as far as I understand it, to mess up SANE completely.

I would like to try openDIAS with some extra sleep time added to it, could you provide me with a download-link?

Maybe this issue for network attached scanners can be circumvented by issuing a feature request: In most home situations or small-office environments there is only one scanner or maybe just a few scanners available. Is it possible to configure openDIAS to always use a default scanner or is it possible to link a default scanner to an openDIAS user? In this way the URI of the scanner has to discovered once and after that the URI can be used by openDIAS.

Could you also provide me with the latest Dutch translations? I found some typo's and some translations that could be improved.

Thanks for your efforts

Piet
   

homi...@gmail.com

unread,
Jul 11, 2014, 5:00:54 AM7/11/14
to open...@googlegroups.com, homi...@gmail.com
Hi Wayne,

Great to learn that you found the problem.
Your two solutions do sound a bit dubious as you state yourself already,  I would be fine to try the time-out option.
Just for of my curiosity, what logic triggers the cleanup/shutdown routines?

With best regards,
Hombibi

Wayne Booth

unread,
Jul 14, 2014, 5:01:11 PM7/14/14
to open...@googlegroups.com, homi...@gmail.com
Hi,

I've created a package for you that contains the sleep fix as disucssed.
Do let me know how you get on.

cheers
Wayne

Wayne Booth

unread,
Jul 14, 2014, 5:01:30 PM7/14/14
to open...@googlegroups.com, homi...@gmail.com
Hi,

I've created a package for you that contains the sleep fix as disucssed.
Do let me know how you get on.

cheers
Wayne

Piet de Vries

unread,
Jul 16, 2014, 1:18:14 PM7/16/14
to open...@googlegroups.com, homi...@gmail.com
Hi Wayne,

Thanks for providing a patched version of openDIAS for testing. I did setup a new virtual machine, 32 bits this time, and installed openDIAS. Of course I updated this system and installed HPLIP. During configuration hp-setup detects my scanner. SCANIMAGE -L lists my scanner and SCANIMAGE >test.png does produce a scan.

When running openDIAS it still won't detect my scanner and segfault errors show up in both the openDIAS logfile and syslog. De segfaults in syslog are a bit different than before. Earlier the segfaults gave error 14 but now they give error 4. Don't know the difference but maybe this is important.

Just to make sure I performed an reboot but also after the reboot openDIAS can't find my scanner while scanimage does produce scans.

Do you have further suggestions to solve the problem with network attached scanners?

Kind regards

Piet
Reply all
Reply to author
Forward
0 new messages