"Invalid argument" when trying to scan

Bug #844582 reported by Dave Webb on 2011-09-08
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gscan2pdf (Ubuntu)
Undecided
Unassigned
sane-backends (Ubuntu)
Undecided
Unassigned

Bug Description

I'm using a Fujitsu M3091DCd scanner with SANE. From the command line it works more or less well with Ubuntu.

I can't use it with gscan2pdf v0.9.31, but gscan2pdf works with another scanner.

All I get is a meaningless "Invalid argument" when I hit the scan button.

When I start gscan2pdf from the command line I see these lines appearing when I hit the scan button:

Error running process: Died at (eval 39) line 7.

  $device->start;
  $shash{$sane_thread}{status} = $Sane::STATUS+0;
  if ($Sane::STATUS != SANE_STATUS_GOOD) {
   print "$prog_name: sane_start: $Sane::STATUS\n" if $debug;
   $shash{$sane_thread}{go} = 0;
   die; # quickest way out of the eval block
  }

  my $path = $shash{$sane_thread}{data};
  if (not open($fh, ">", $path)) {
   $device->cancel;
   $shash{$sane_thread}{status} = SANE_STATUS_ACCESS_DENIED;
   $shash{$sane_thread}{go} = 0;
   die; # quickest way out of the eval block
  }
  scan_page($device, $fh);
  $shash{$sane_thread}{status} = $Sane::STATUS+0;
  close $fh;
  printf "Scanned page %s.", $path if $debug;
  printf " (scanner status = %d)\n", $Sane::STATUS if $debug;
  $shash{$sane_thread}{status} = $Sane::STATUS+0;
  $shash{$sane_thread}{go} = 0;

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: gscan2pdf 0.9.31-2
ProcVersionSignature: Ubuntu 2.6.38-11.48-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic x86_64
NonfreeKernelModules: fglrx
Architecture: amd64
Date: Thu Sep 8 09:44:25 2011
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=
 PATH=(custom, no username)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gscan2pdf
UpgradeStatus: Upgraded to natty on 2011-06-01 (98 days ago)

Dave Webb (davewebb8211) wrote :

I have complete rewritten this code in the upcoming version. Please
try the new version as soon I release it.

Launchpad Janitor (janitor) wrote :

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

Changed in gscan2pdf (Ubuntu):
status: New → Confirmed

Please start gscan2pdf with the --log=log option from the command line, reproduce the problem, quit, and post the log file.

Changed in gscan2pdf (Ubuntu):
status: Confirmed → Incomplete
Damiön la Bagh (kat-amsterdam) wrote :

I have a similar problem with a different scanner. The Epson GT-S80. When I choose Doublesided scanning also Invalid Argument.

I'm using Ubuntu 14.04.2LTS with the PPA running version 1.3.0

I've run a log file and attached it here below.

These Entries in the log seem odd.

WARN - Argument "" isn't numeric in numeric ne (!=) at /usr/share/perl5/Gscan2pdf/Dialog/Scan/Sane.pm line 731.

WARN - Argument "" isn't numeric in subroutine entry at /usr/share/perl5/Gscan2pdf/Frontend/Sane.pm line 430.

INFO - sane_set_option 51 (auto-eject) to returned status Success with info 0

Launchpad Janitor (janitor) wrote :

[Expired for gscan2pdf (Ubuntu) because there has been no activity for 60 days.]

Changed in gscan2pdf (Ubuntu):
status: Incomplete → Expired

Sorry for the delay. Please try this patch.

Changed in gscan2pdf (Ubuntu):
status: Expired → Incomplete

The attachment "0001-Suppress-warnings-when-passed-boolean-as-empty-strin.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Damiön la Bagh (kat-amsterdam) wrote :

After applying the patch and restarting I'm still receiving Invalid Argument (see screenshot)

Here is the new output of gscan2pdf --log=log with the patch applied.

You are using the libsane-perl frontend in gscan2pdf, which is generally the preferred one.

Please change this to scanimage in Edit/Preferences and post another log file.

As requested a new log file and screenshot using scanimage instead of libsane-perl
The error message says "Unknown Message: scanimage: sane_start: Invalid Argument"

And because you can't post multiple attachments here is the log file using scanimage

The fact that you can reproduce this with the scanimage frontend tells me that this is a problem with Epson SANE backend, and not with gscan2pdf. If you look at the bottom the last log you posted, you will see that this is the command gscan2pdf used:

 scanimage --device-name='epkowa:interpreter:001:005' -x 210 -y 297 --adf-mode='Duplex' --resolution='200' --batch --progress --batch-start=1 --batch-increment=2

Please try this from the command line and confirm that it throws the same error.

If so, this bug should also be attached to the libsane package, where the epson and epson2 backends are.

I get the exact same error from gscan2PDF with my HP 7510 all-in-one scanner. (see attached Video). On two different computers. (note using the HP scan utility works)

For the earlier Epson. The Epson ScanImage for Linux also works normally.

Is there a better explanation what "Invalid Argument" is referring to in the error handling?

I'll make a log of the HP output later today.

~$ scanimage --device-name='epkowa:interpreter:001:005' -x 210 -y 297 --adf-mode='Duplex' --resolution='200' --batch --progress --batch-start=1 --batch-increment=2
scanimage: open of device epkowa:interpreter:001:005 failed: Invalid argument

Bus 001 Device 004: ID 04b8:0136 Seiko Epson Corp. ES-D400 [GT-S80]

When I use Epson's own scan software it works fine. I notice that the epkow:interpreter selected is different than the one gscan2pdf is choosing.

gscan2pdf chooses: epkowa:interpreter:001:005
epson proprietary chooses: epkowa:interpreter:001:004 see screenshot

As you have noted, the 001:005 refers to the usb device. However this can change between boots. Did you reboot between the gscan2pdf/scanimage and epson sessions?

As you can reproduce this from the commandline with scanimage, I am transferring this bug to sane-backends, as the bug must be in the epson/epkowa backend in SANE.

"Invalid argument", is simply the error code that libsane returns. Unfortunately, it does not provide any more information that that by default.

However, you can run scanimage with debugging turned on. I would ask on the SANE mailing list for more help.

Rolf Leggewie (r0lf) wrote :

Dave, are you still experiencing this problem?

tags: removed: patch
Changed in sane-backends (Ubuntu):
assignee: nobody → Rolf Leggewie (r0lf)
Launchpad Janitor (janitor) wrote :

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

Changed in sane-backends (Ubuntu):
status: New → Confirmed
Hans Deragon (deragon) wrote :

I had a similar problem with the default version of gscan2pdf available from the default Ubuntu 16.04 repositories. I would scan, but the error message would arrive after the scan was completed.
 gscan2pdf version 1.3.8.

I then installed the following PPA to get the latest version, 1.8.3:

sudo add-apt-repository --yes ppa:jeffreyratcliffe/ppa

The problem was gone. I suggest you upgrade gscan2pdf to the latest and report your findings. We might be able to close this ticket.

Rolf Leggewie (r0lf) wrote :

Please do not suggest to install third-party packages, even if from the upstream developper. It is a very bad idea in almost all situations. The real problem is how to distinguish those situations from the ones where it might be OK (for the ordinary user). Thus, the normal user should stick to the official packages. We need to get rid of the impulse to install random stuff from the internet to quickly "fix" a problem.

Rolf Leggewie (r0lf) wrote :

Dave, are you still experiencing this problem?

Hans Deragon (deragon) wrote :

Rolf, I would agree with you if bugs would be fixed in a timely manner, but that is not the case. In the meantime, people go months if not years with a scanner that does not work. That is unacceptable by any standard. People should see my previous comment as a work around to get things done. This bug was opened in 2011 and still affects people.

Rolf Leggewie (r0lf) wrote :

Hans, we can certainly disagree. But it seems you as well as some of the upstream devs do not understand much about packaging. If you want timely fixes, pay someone to do it. If you want to make a mess of your system, install random packages. I'm fine with any of that. I'm not fine if then such person comes back and waste Ubuntu devs time with a problem they did not create or gives Ubuntu a bad name that they did not deserve in this case. I hope that makes sense.

BTW, scanner support is the responsibility of the manufacturer, don't you think? Have you complained to them about lack of FOSS support? Have you taken this into consideration when you purchased your scanner? Or have you simply purchased whatever was cheapest? IMO, what is not acceptable is buying cheap, unsupported stuff and then complaining to people doing a LOT of work for you for free. Last comment, if you feel that all of this is so unacceptable then have you rolled up your sleeve and provided a patch or at least tried to?

Changed in sane-backends (Ubuntu):
status: Confirmed → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for gscan2pdf (Ubuntu) because there has been no activity for 60 days.]

Changed in gscan2pdf (Ubuntu):
status: Incomplete → Expired
Rolf Leggewie (r0lf) on 2018-05-20
Changed in gscan2pdf (Ubuntu):
status: Expired → Invalid
Changed in sane-backends (Ubuntu):
status: Incomplete → Opinion
assignee: Rolf Leggewie (r0lf) → nobody
To post a comment you must log in.