[sane-devel] Scanner works, but networking does not

E. Liddell ejlddll at googlemail.com
Fri Jul 9 03:28:34 BST 2021


Background:  I have a Canon LiDE 200 scanner, tested and confirmed to
work with the genesys backend.  It's hooked up to a headless Raspberry Pi 
running Gentoo (*not* Raspbian, and it uses OpenRC, not systemd, for 
init) with a fairly minimal set of packages installed.  I want to share this 
scanner to another machine on my LAN.

I have saned running.  The problem is that no matter how I configure it,
it won't accept connections from anything but localhost.  This includes
the host itself attempting to contact it by IP, which happens to be
192.168.1.51.

Debug gives the error "argument marshalling error (Connection reset 
by peer)" regardless of what machine scanimage -L is running on, or
what user it's running under.

The problem is not likely to be general-networking or firewall-related 
(sshd works fine without having to drill holes anywhere, and I can see the 
open saned port when running nmap from a different machine).  

/proc/sys/net/ipv6/bindv6only contains a 0, so that isn't an issue (and sshd
would be broken if it were).

avahi support is not compiled into sane (it causes errors), but I don't see 
why that would cause this type of breakage.

The saned user is in the usb and scanner groups.

What have I missed?

====

saned.conf, minus comments:

192.168.1.55
192.168.1.51
192.168.1.52
192.168.1.0/24
localhost

====

net.conf, minus comments:

connect_timeout = 60

192.168.1.51
localhost

====

output of "SANE_DEBUG_NET=128 scanimage -L" as root on the Pi:

[13:50:19.645264] [sanei_debug] Setting debug level of net to 128.
[13:50:19.645509] [net] sane_init: authorize != null, version_code != null
[13:50:19.645593] [net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6) from sane-backends 1.0.31
[13:50:19.645749] [net] sane_init: Client has little endian byte order
[13:50:19.645932] [net] sane_init: searching for config file
[13:50:19.646231] [net] sane_init: connect timeout set to 60 seconds
[13:50:19.646426] [net] sane_init: trying to add 192.168.1.51
[13:50:19.646605] [net] add_device: adding backend 192.168.1.51
[13:50:19.666538] [net] add_device: backend 192.168.1.51 added
[13:50:19.666779] [net] sane_init: trying to add localhost
[13:50:19.666961] [net] add_device: adding backend localhost
[13:50:19.686596] [net] add_device: backend localhost added
[13:50:19.686868] [net] sane_init: done reading config
[13:50:19.687044] [net] sane_init: evaluating environment variable SANE_NET_HOSTS
[13:50:19.687423] [net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
[13:50:19.687614] [net] sane_init: done
[13:50:19.687788] [net] sane_get_devices: local_only = 0
[13:50:19.687973] [net] connect_dev: trying to connect to localhost
[13:50:19.689383] [net] connect_dev: [0] connection succeeded (IPv6)
[13:50:19.689742] [net] connect_dev: sanei_w_init
[13:50:19.690341] [net] connect_dev: net_init (user=eliddell, local version=1.0.3)
[13:50:19.702864] [net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
[13:50:19.703110] [net] connect_dev: done
[13:50:19.769640] [net] sane_get_devices: got localhost:genesys:libusb:001:004
[13:50:19.770660] [net] connect_dev: trying to connect to 192.168.1.51
[13:50:19.772581] [net] connect_dev: [0] connection succeeded (IPv4)
[13:50:19.773756] [net] connect_dev: sanei_w_init
[13:50:19.774830] [net] connect_dev: net_init (user=eliddell, local version=1.0.3)
[13:50:19.804498] [net] connect_dev: argument marshalling error (Connection reset by peer)
[13:50:19.805434] [net] connect_dev: closing connection to 192.168.1.51
[13:50:19.806245] [net] sane_get_devices: ignoring failure to connect to 192.168.1.51
[13:50:19.806971] [net] sane_get_devices: finished (1 devices)
device `genesys:libusb:001:004' is a Canon LiDE 200 flatbed scanner
device `net:localhost:genesys:libusb:001:004' is a Canon LiDE 200 flatbed scanner
[13:50:19.810312] [net] sane_exit: exiting
[13:50:19.811157] [net] sane_exit: closing dev 0x1a4fe80, ctl=7
[13:50:19.812197] [net] sane_exit: closing dev 0x1a4f760, ctl=-1
[13:50:19.812984] [net] sane_exit: finished.

===

output of "SANE_DEBUG_NET=128 scanimage -L" as any user on the separate client 
machine 192.168.1.55:

[22:07:52.289556] [sanei_debug] Setting debug level of net to 128.
[22:07:52.289593] [net] sane_init: authorize != null, version_code != null
[22:07:52.289599] [net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6) from sane-backends 1.0.31
[22:07:52.289604] [net] sane_init: Client has little endian byte order
[22:07:52.289609] [net] sane_init: searching for config file
[22:07:52.289644] [net] sane_init: connect timeout set to 60 seconds
[22:07:52.289651] [net] sane_init: trying to add 192.168.1.51
[22:07:52.289658] [net] add_device: adding backend 192.168.1.51
[22:07:52.291183] [net] add_device: backend 192.168.1.51 added
[22:07:52.291196] [net] sane_init: done reading config
[22:07:52.291200] [net] sane_init: evaluating environment variable SANE_NET_HOSTS
[22:07:52.291205] [net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
[22:07:52.291210] [net] sane_init: done
[22:07:52.291216] [net] sane_get_devices: local_only = 0
[22:07:52.291222] [net] connect_dev: trying to connect to 192.168.1.51
[22:07:52.291734] [net] connect_dev: [0] connection succeeded (IPv4)
[22:07:52.291742] [net] connect_dev: sanei_w_init
[22:07:52.291782] [net] connect_dev: net_init (user=eliddell, local version=1.0.3)
[22:07:52.324139] [net] connect_dev: argument marshalling error (Connection reset by peer)
[22:07:52.324154] [net] connect_dev: closing connection to 192.168.1.51
[22:07:52.324169] [net] sane_get_devices: ignoring failure to connect to 192.168.1.51
[22:07:52.324174] [net] sane_get_devices: finished (0 devices)

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).
[22:07:52.324496] [net] sane_exit: exiting
[22:07:52.324507] [net] sane_exit: closing dev 0x5610789e98a0, ctl=-1
[22:07:52.324517] [net] sane_exit: finished.

===



More information about the sane-devel mailing list