Bug 1546433

Summary: saned: libsane-imagescan.so.1 missing
Product: [Fedora] Fedora Reporter: Todd <ToddAndMargo>
Component: sane-backendsAssignee: Nils Philippsen <nphilipp>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: nphilipp, thibault.north, ToddAndMargo, zdohnal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-05 17:12:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
journalctl -efx -t saned > saned.log.txt
none
My configuration
none
journalctl -efx -t saned > saned.log.epson.txt
none
journalctl -efx -t saned > /home/temp/saned.log.epson2.txt none

Description Todd 2018-02-17 11:21:29 UTC
Created attachment 1397367 [details]
journalctl -efx -t saned > saned.log.txt

Hi All,

Fedora 26 x 64
Xfce 4.12

sane-backends-1.0.27-9.fc27.x86_64
sane-backends-drivers-scanners-1.0.27-9.fc27.x86_64
sane-backends-drivers-cameras-1.0.27-9.fc27.i686
sane-backends-libs-1.0.27-9.fc27.i686
sane-backends-daemon-1.0.27-9.fc27.x86_64
sane-backends-drivers-scanners-1.0.27-9.fc27.i686
sane-backends-libs-1.0.27-9.fc27.x86_64
sane-backends-drivers-cameras-1.0.27-9.fc27.x86_64

I am trying to get xsane to work with systemd and saned.  When I run
    $ xsane net:localhost

I get the following error pop up:
   Error: Failed to open device `net:localhos': Error during device I/0

In saned@.service, I have debug set to the following:
Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255 SANE_DEBUG_BJNP=5 
SANE_DEBUG_NET=128

And this error pops up in my debug log:
# journalctl -efx -t saned > saned.log.txt

   996: 032]: [dll] load: searching backend `imagescan' in `/usr/lib64/sane'
Feb 17 02:59:12 rn4.rent-a-nerd.local saned[4032]: [dll] load: trying to load `/usr/lib64/sane/libsane-imagescan.so.1'
   Feb 17 02:59:12 rn4.rent-a-nerd.local saned[4032]: [dll] load: couldn't open `/usr/lib64/sane/libsane-imagescan.so.1' (No such file or directory)
   Feb 17 02:59:12 rn4.rent-a-nerd.local saned[4032]: [dll] load: couldn't find backend `imagescan' (No such file or directory)
   Feb 17 02:59:12 rn4.rent-a-nerd.local saned[4032]: [dll] sane_get_devices: found 0 devices
   Feb 17 02:59:14 rn4.rent-a-nerd.local saned[4032]: saned exiting

I will attach the whole debug and the configuration I am using

Many thanks,
-T

Comment 1 Todd 2018-02-17 11:23:36 UTC
Created attachment 1397368 [details]
My configuration

The instructions I am following to set up saned

Comment 2 Todd 2018-02-17 11:30:19 UTC
# find / -iname \*libsane-imagescan\*
<nothing>

# dnf repoquery --whatprovides libsane-imagescan
<nothing>

# dnf repoquery --whatprovides */libsane-imagescan
<nothing>

pbone had nothing either

Comment 3 Todd 2018-02-17 11:39:08 UTC
I should have mentioned that 

   scanimage -L   finds the scanner
   xsane without the net:localhost also finds the scanner
   simple-scan also finds the scanner

Comment 4 Zdenek Dohnal 2018-02-19 09:37:29 UTC
Hi,

imagescan is not a part of sane-backends - it should be in epson official driver (I guess you use epson scanner - this driver is proprietary, so it can't be in official Fedora repo) or I saw someone packaged it in some unofficial repo - all can be found by 'fedora epson scanner driver' in google.
Try to install it and let me know.

Comment 5 Todd 2018-02-20 06:18:08 UTC
I downloed Epson's drivers from

http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX
http://support.epson.net/linux/en/iscan.php?model=gt-f720&version=1.0.1

Peaking inside iscan-gt-f720-bundle-1.0.1.x64.rpm.tar.gz, I can see no imagescan or libsane-imagescan.

There is one over on

https://ftp.gwdg.de/pub/opensuse/repositories/home:/zhonghuaren/Fedora_27/x86_64/imagescan-3.32.0-8.1.x86_64.rpm

Please excuse this following tech support question, but is the a list and instructions somewhere that explains saned@.service's 

Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255 SANE_DEBUG_EPKOWA=HEX SANE_DEBUG_NET=128

specification?

Comment 6 Todd 2018-02-20 21:55:27 UTC
Created attachment 1398456 [details]
journalctl -efx -t saned > saned.log.epson.txt

This is a new log with the debug set to find espon stuff and the libsane-imagescan from SUSE.

The second to the last line is:

Feb 20 13:49:21 rn4.foo.local saned[14165]: [dll] sane_get_devices: found 0 devices

Comment 7 Zdenek Dohnal 2018-02-21 07:37:43 UTC
From log:

Feb 20 13:49:21 rn4.foo.local saned[14165]: [net] add_device: error while getting address of host 192.168.255.0/24: Name or service not known

I tried it only with host IP... are you sure that subnet IP works? And saned is in that subnet?

Comment 8 Todd 2018-02-21 20:05:17 UTC
Created attachment 1398984 [details]
journalctl -efx -t saned > /home/temp/saned.log.epson2.txt

This is a fresh scan after I corrected /etc/hosts and named's hosts and hosts.rev.

I removed suse's imagescan

# journalctl -efx -t saned > /home/temp/saned.log.epson2.txt
$ xsane net:192.168.255.10

The error log created by PDF Studio was exactly the same as with "xsane net"

Comment 9 Todd 2018-02-21 22:29:31 UTC
After fix:

# host 192.168.255.10
10.255.168.192.in-addr.arpa domain name pointer localhost.foo.local.
10.255.168.192.in-addr.arpa domain name pointer rn6.foo.local.

# host localhost
localhost.foo.local has address 192.168.255.10

# host 127.0.0.1
1.0.0.127.in-addr.arpa domain name pointer localhost.

# host rn6.foo.local.
rn6.foo.local has address 192.168.255.10

$ hostname
rn6.foo.local


$ nmap -p 6566 192.168.255.0/24
Nmap scan report for rn6.foo.local (192.168.255.10)
PORT     STATE SERVICE
6566/tcp open  sane-port
Nmap done: 256 IP addresses (1 host up) scanned in 3.05 seconds

$ nmap -p 6566 192.168.255.10
Nmap scan report for rn6.foo.local (192.168.255.10)
PORT     STATE SERVICE
6566/tcp open  sane-port
Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds

$ nmap -p 6566 localhost
rDNS record for 127.0.0.1: rn6.foo.local
PORT     STATE SERVICE
6566/tcp open  sane-port

$ nmap -p 6566 127.0.0.1
Nmap scan report for rn6.foo.local (127.0.0.1)
PORT     STATE SERVICE
6566/tcp open  sane-port

Comment 10 Zdenek Dohnal 2018-03-01 09:23:31 UTC
Still same info in logs:

error while getting address of host 192.168.255.0/24: Name or service not known

It would probably take more time to set it up ... I'll try to reproduce it with my HP scanner, if saned correctly takes network address.

Comment 11 Todd 2018-03-01 17:43:36 UTC
(In reply to Zdenek Dohnal from comment #10)
> error while getting address of host 192.168.255.0/24: Name or service not
> known

Can you tell from the source code what mechanism saned is using to resolve the "name or service"?

$ grep 6566 /etc/services
sane-port       6566/tcp                # SANE Control Port
sane-port       6566/udp                # SANE Control Port

Comment 12 Zdenek Dohnal 2018-03-02 09:22:08 UTC
saned uses classic glibc function getaddrinfo.

Comment 13 Todd 2018-03-02 19:17:44 UTC
(In reply to Zdenek Dohnal from comment #10)
> error while getting address of host 192.168.255.0/24: Name or service not
> known

Wait a minute!  192.168.255.0/24 is the entire network. Not a single address.  Of course it won't resolve!

Comment 14 Todd 2018-03-02 21:44:09 UTC
Does this help?

# getaddrinfo --host 192.168.255.0/24
Cannot getaddrinfo() - Name or service not known

^^^^^^ that was expected ^^^^^^^


# getaddrinfo -4 --service 6566 --host 192.168.255.10
Resolved host '192.168.255.10', service '6566'

socket(AF_INET , SOCK_STREAM, IPPROTO_TCP) + '192.168.255.10:6566'
socket(AF_INET , SOCK_DGRAM , IPPROTO_UDP) + '192.168.255.10:6566'
socket(AF_INET , SOCK_RAW   , IPPROTO_IP ) + '192.168.255.10:6566'


# getaddrinfo -4 --service 6566 --host 192.168.255.10
Resolved host '192.168.255.10', service '6566'

socket(AF_INET , SOCK_STREAM, IPPROTO_TCP) + '192.168.255.10:6566'
socket(AF_INET , SOCK_DGRAM , IPPROTO_UDP) + '192.168.255.10:6566'
socket(AF_INET , SOCK_RAW   , IPPROTO_IP ) + '192.168.255.10:6566'


# getaddrinfo -4 --service 6566 --host localhost
Resolved host 'localhost', service '6566'

socket(AF_INET , SOCK_STREAM, IPPROTO_TCP) + '127.0.0.1:6566'
socket(AF_INET , SOCK_DGRAM , IPPROTO_UDP) + '127.0.0.1:6566'
socket(AF_INET , SOCK_RAW   , IPPROTO_IP ) + '127.0.0.1:6566'
socket(AF_INET , SOCK_STREAM, IPPROTO_TCP) + '127.0.0.1:6566'
socket(AF_INET , SOCK_DGRAM , IPPROTO_UDP) + '127.0.0.1:6566'
socket(AF_INET , SOCK_RAW   , IPPROTO_IP ) + '127.0.0.1:6566'

Comment 15 Zdenek Dohnal 2018-03-05 17:12:07 UTC
>Add you Local Host name, Network, and Connect Timeout to /etc/sane.d/net.conf.
>For Example (substitute your actual network for the one shown):
>
># The hostname matching is not case-sensitive. 
>192.168.255.0/24
>localhost
>connect_timeout=60

From /etc/sane.d/net.conf:
## saned hosts
# Each line names a host to attach to.

I think the saned hosts (servers) are meant as host addresses (host IP's) - so it is expected to not work with network address (subnet IP) and it is not explicitly mentioned in the file (as in saned.conf).
Plus net.conf is for configuration where server (machine, which provides scanner) is, so IMHO it doesn't make sense to have subnet IP there (I don't recall any network service which defines server's whereabouts by subnet IP, not host IP).

If I remove subnet IP from net.conf, the scanner is discovered and scans fine. I tried it for localhost and for subnet IP too (my subnet IP was 192.168.122.0/24), on one machine (VM) and on two machines (VM+desktop).
Because of reasons above, closing as NOTABUG.