Error retreiving scanner options: error getting option 5: invalid argument
Brought to you by:
ra28145
Hello,
I am encountering a problem with gscan2pdf (tried with version 1.8.7 and 2.1.7) with a Brother ADS-2800W (connected with wired ethernet) on Ubuntu.
After the fetching devices step if I select "Brother ADS-2800W" device I have this error message:
Error retreiving scanner options: error getting option 5: invalid argument
After closing dialog box device is removed until I restart gscan2pdf.
This device seems to work with SANE and Simple Scan.
You can find included a log made with version 2.1.7 and --log=log switch.
This might be because you have two devices and the HP is opened first.
Can you force it to open the Brother first by black-listing the HP in Edit/Preferences?
Hello,
Many thanks for your quick reply. I apologize for the delay because I was not at home.
I tried to blacklist HP device as you recommended but I don't succeed.
HP device is always listed. I tried with HP device off too and gscan2pdf say that the device is offline and list it.
I tried using these regular expressions:
Now each time I try to select the Brother ADS-2800W device this one is deleted until I restart gscan2pdf but there is no more error message. No ADS-2800W settings are loaded.
I uploaded in the zip file SANE & gscan2pdf devices listing screen captures.
Many thanks in advance for your help.
Kind Regards
Hello,
Update to my previous message.
It seems that I succeed to blacklist HP device using the exact model name (shown in gscan2pdf log file) "HP_Color_LaserJet_MFP_M477fdw" without regular expression because I can read in the log file
HP device is always listed and retreived after refreshing the device list or restarting gscan2pdf (maybe normal) but if I select the ADS-2800W no settings are retreived and this device is simply deleted.
I have uploaded the log of all the test.
Kind Regards
Unfortunately
HP_*
is not valid regex. SimplyHP_
should have worked. I've added some code for the next release to check the regex when the apply button in the preferences dialog is pressed.However, you worked out how to blacklist the device. Unfortunately, I'm not sure if what happens after you corrected the regex is still affected by the earlier errors.
Would you mind creating a new log file, now that the regex should be correct from the start?
Hello,
Thanks for your reply.
No problem.
I have generated two log file because:
All log are containing the following steps
1- modifiying blacklist regex from "HP_Color_LaserJet_MFP_M477fdw" to "HP_"
2- Opening scan
3- first time no device is discovered so accessing rescan device
4- two devices are discovered (HP and ADS-2800W)
5- trying to select ADS-2800W
6- ADS-2800W is deleted from the list of devices and no properties/settings loaded
7- Closing scan dialog
8- Restarting from step 2
I tried too to select HP devices with blacklist regex and properties of this device are well loaded. I don't tried to do a scan from the HP device in these log.
King regards
Hello,
Addition to my previous message.
Even blacklisted HP device remain available and I can scan from it after refreshing devices (step 3).
I tried to force gscan2pdf to open the ADS-2800W device using the following command line:
It seems that device is well discovered but properties can't be loaded.
You can find the log included.
Thanks for your help.
Kind regards
Hello,
Last addition for today :)
I have another old stock Linux Mint 18.x (Xenial) on another computer that I would like to update to Ubuntu 18.04 and before and I will try to install brother ADS-2800W and gscan2pdf from your ppa on it this evening.
I will post my result in case of success of all install (because this computer was never used and never updated after it os installation).
Kind Regards
Hello,
I made a new install on a fresh Ubuntu 18.04 install with following components only:
This is exactly the same error. ADS-2800W is discovered but no properties are loaded.
You can find log included.
Thanks for your help
Kind Regards
What happens on this new machine if you
with your normal user?
Hello,
Thanks for your reply.
I don't understand what do you mean
with scanimage > image.pnm
I have search in all menu and the only thing I found is under
preference > scan option > frontend
but when I select scanimage or sanadf gscan2pdf is exiting.At relaunch it ask me to open a previous crashed session.
Otherwise as the scanner disappears I can not scan anything.
Kr,
Hello,
Ok, I apologize ! scanimage cli tool.
Using the following command line
scanimage -d brother5:net1:dev0 > image.pnm
on the new computer and the old one is fully working.I get a scanned document with all contents.
Kr,
Last edit: MooCan 2018-10-18
What do you get if you
?
I have a fix for the crash you discovered switching frontend in Edit/Preferences. Can you use a patch, or would you prefer a .deb?
Thanks for your patience debugging this. It is tricky finding the cause of bugs like this when I don't have access to the scanner.
Hello,
I understand well ! These type of device can't be vitualized !
I prefer a deb file if it does not represent a work supplement as it I'm sure I have a working binary.
About your first question:
scanimage -d brother5:net1:dev0 --help
You can find the outputn in sane-scanimage.brother5.txt in the included zip.
It seems there is a trouble :(
I tried to made some search and I have generated some trace.
There is in this zip too a trace made with
SANE_DEBUG_DLL=128
and backtrace made with gdb.I don't understand why xsane is working well.
Kr,
You seem to be running the scanner over the network. Can you plug it directly into the computer?
What happens if you
?
Here is says you should quote the device name:
Hello,
Many thanks for your help.
I made scanimage tests on the two computers and each time on the computer which has HP and Brother devices I ran the tests on the twice devices. I see that the HP due to it's syntax required to be quoted so I quoted too the Brother. I tried with and without sudo and directly as root # the scanimage test.
Last 2 days I made many tests (xsane, scaneimage, simple-scan, gscan2pdf, ...) using the network connection and then the USB connection. I tested scan using each available options, 300dpi, 600 dpi ... 1200 dpi, color, grey, true-grey, 24-bits color, .... single sided, from ADF, duplex .... and each time documents are scanned fine. Then I updated the sane packages on Ubuntu 18.04 to the last version available for Ubunt 18.10 and ran whole tests. Always the same results ...
SANE_DEBUG_DLL=128 scanimage -d 'brother5:net1:dev0' --help
is ending with aSegmentation fault
always at the same step[dll] sane_get_option_descriptor(handle=0x564116ba9560,option=5)
I tried to be be sure to install an Ubuntu 18.10 and ran the whole test with the same results at each step.
Xsane and simple-scan are working. Scanimage is working too for scanning when I'm specifying all the options from the command line ... so I don't know which
option descriptor
labelled asoption=5
is causing the segmentation fault.I send an inquiry to the Linux Brother Support with all debug text files but I don't know if I will have an answer.
Do you know if it's possible to contact the SANE developpers (and how) ... for help ?
I will test using another linux ditrib as Fedora or OpenSuse because brother drivers are available as rpm package too. I will update you with my test.
I would like to thank you another time for your support and help.
Kr,
Are you saying then, that with Ubuntu 18.04, gscan2pdf and scanimage fetch the
options and scan without problem?
If so, please give me a log file from that version of gscan2pdf so that I can compare.
That will also allow me to see which is option 5.
Are you also saying that with 18.10, gscan2pdf then produces the error, even if
connect directly via USB?
The SANE project is here:
http://www.sane-project.org/
The devs read this mailing list:
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/sane-devel
Perhaps I should make gscan2pdf more tolerant of the invalid argument error,
either just stopping and displaying the options fetched up to that point, or
ignoring the option in question and trying to fetch the rest.
Hello,
I apologize because english is not my primary language.
I tried with many version of ubuntu (17.10, 18.04, 18,10) and updated version of SANE package from 18.10 on Ubuntu 18.04. Using an USB connection or a Network connection regardless of the Ubuntu or SANE package version here what I have (and always the same result)
WORKING:
=> tested scan using each available options displayed for the Brother ADS-2800W (color, grey, B&W, 300, 600, 1200 dpi, ADF, Single, duplex ...)
- XSane
- Simple Scan
- Scanimage (using full command line) as scanimage -d 'brother5:net1:dev0' --mode '24bit Color' --resolution 600 --source 'Automatic Document Feeder(left aligned,Duplex)' > output.pnm
NOT WORKING:
- gscan2pdf => Error retreiving scanner options: error getting option 5: invalid argument
- scanimage -d 'brother5:net1:dev0' -h => [dll] sane_get_option_descriptor(handle=0x564116ba9560,option=5)
This is why I said I would like to know what is this
option 5
... What is hiding behindBefore contacting SANE developers I would like to test it on another linux ditribution as Fedora or Opensuse (maybe a true Debian too) to see if this is a bug in the SANE ubuntu package or a SANE error with the Brother Driver.
I saw on your web site that you provide a rpm package version of gscan2pdf (ouf :) ).
Kr,
Last edit: MooCan 2018-10-25
I used to proved rpms, but as I couldn't test them myself, I stopped.
I wouldn't be afraid of contacting the SANE developers. I very much doubt that this is a problem with Ubuntu. I expect, however, that they will say that it is a problem with the Brother driver.
Having said that, scanimage should not segfault, even if the Brother driver passes on an error. But if the SANE developers can't reproduce the problem (because they don't have a Brother scanner) it will be difficult for them to work on it.
I can try and add an option to gscan2pdf that errors when retrieving the options should be ignored. I will need some help testing this, because there is only so much I can simulate with the hardware.
When I have something for you to test, can you work with a patch, or would you prefer a .deb?
Hello,
I have suscribed to the SANE devs mailing list.
I will write my mail when I get suscription confirmation.
I will add this thread as reference too (I think that this is public so thay can have access to the attachements).
I hope they will reply because Ubuntu is not a "real" Debian !
it would be very nice of you.
You can count on my help for any test that you will need.
Mail to the SANE devs mailing list has been sent.
Do you want a copy ?
Kr,
Last edit: MooCan 2018-10-26
I have something for you to test. Do you know how to apply a patch, or would you prefer a .deb?
Hello,
Wow so quick ... :) I'm ready !
I prefer a deb because my VM with all build tools and libs are old (Xenial) and I need to take time to reinstall an 18.04 with all required tools and lib. And I'm not so an expert in build process :(
I got a response from SANE devs.
it appears that (Here is a summury from his answer) :
Kr,