Epson GT-S50 scanner not working after upgrade to 18.04 from 16.04

Since the upgrade, my Epson scanner GT-S50 (Epkowa driver). It gets detected (dmesg) when plugged in:

[ 3755.680091] usb 3-4.4.1: new high-speed USB device number 8 using ehci-pci
[ 3755.789893] usb 3-4.4.1: New USB device found, idVendor=04b8, idProduct=0137
[ 3755.789895] usb 3-4.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3755.789896] usb 3-4.4.1: Product: EPSON Scanner
[ 3755.789897] usb 3-4.4.1: Manufacturer: EPSON

But when starting either "Image Scan!" or "Simple scan", no scanner can be detected.

Image Scan! Error

It still somehow gets detected by Sane, because when running sane-find-scanner, it "sees" it:

...
found USB scanner (vendor=0x04b8 [Language Error], product=0x0137 [Language Error]) at libusb:003:008
...

However, scanimage -L fails to detect it!

No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate). Please read the documentation which came with this software (README, FAQ, manpages).

If I can't find a solution, I'll consider downgrading back to 16.04.

Extra information after some extra investigation: it seems that the upgrade to Ubuntu 18.04 broke something within the Sane setup. Calling iscan or other sane related applications lead all to fail discovering my scanner due to the following error from syslog:

iscan: io/hpmud/pp.c 627: unable to read device-id ret=-1

Other calls to sane utilities fail for the same reason:

colord-sane: io/hpmud/pp.c 627: unable to read device-id ret=-1
scanimage: io/hpmud/pp.c 627: unable to read device-id ret=-1
xsane: io/hpmud/pp.c 627: unable to read device-id ret=-1

EDIT 2: Ok, found & solved the origin of the io/hpmud/pp.c 627: unable to read device-id ret=-1 messages; it is caused by the hplip's (libsane's) hpio module. I've disabled it (= commented out in /etc/sane.d/dll.d/hplip file) and the message is now gone.

Besides, I've tried to specify my scanner to sane by adding usb 0x04b8 0x0137 in the /etc/sane.d/epkowa.conf file and added the following UDEV rules in /etc/udev/rules.d/ as file 55-libsane.rules:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE=="0666"
SUBSYSTEM=="usb_device", MODE=="0666"
ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0137", MODE="0666", 
GROUP="scanner", ENV{libsane_matched}="yes"

But, so far still no avail... scanner stubbornly undetected :'(

Side note: don't know if that matters, but when disconnecting the scanner, I see the following message appear in /var/log/syslog:

May 16 09:37:40 hades kernel: [22174.197243] usb 3-4.4.1: USB disconnect, device number 7
May 16 09:37:40 hades upowerd[1809]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:1c.5/0000:05:00.0/0000:06:00.2/usb3/3-4/3-4.4/3-4.4.1
May 16 09:37:40 hades colord-sane[7678]: failed to receive list of devices: Failed to connect to missing device /org/freedesktop/ColorManager/devices/sysfs_EPSON_EPSON_Scanner

I found a word an affective workaround in the comments of the Ubuntu's sane-backends bug #1728012. I documented it as a comment on the bug report.

The problem seems to reside in missing symlinks to the epkowa (SEIKO EPSON) libraries in the /usr/lib/x86_64-linux-gnu/sane (or, more generically, /usr/lib/$(uname -m)-linux-gnu/sane) folder.

I thus did the following:

  1. sudo ln -sfr /usr/lib/sane/libsane-epkowa* /usr/lib/x86_64-linux-gnu/sane

  2. Removed the usb 0x04b8 0x0137 entry I had added to /etc/sane.d/epkowa.conf

  3. Added a 55-epson-libsane.rules file to /etc/udev/rules.d/ with the following text:

    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE=="0666"
    SUBSYSTEM=="usb_device", MODE=="0666"
    
    ATTRS{manufacturer}=="EPSON", DRIVERS=="usb", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="*", MODE="0666"
    
    ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0137", MODE="0666", GROUP="scanner", ENV{libsane_matched}="yes"
    
  4. Finally I unplugged / plugged my scanner and tried

    scanimage -L
    

    and got this encouraging answer:

    device `epkowa:interpreter:003:011' is a Epson GT-S50 flatbed scanner
    
  5. Then I started iscan (Image Scan!) and it immediately detected my scanner. I then could successfully scan a page. Yipee! :-)

UPDATE: (Ubuntu 20.04) I suddenly got the issue back after upgrading to Ubuntu 20.04. I searched quite a bit because nothing seemingly changed in my config... and all of a sudden I noticed that somehow my /etc/sane.d/epkowa.conf file's permissions had been altered and that the file was only readable for root !

After changing it back to "world" readable (chmod +r /etc/sane.d/epkowa.conf ) everything went back to normal and both iscan and scanimage would again be able to detect the scanner properly without having to be invoked using "sudo".