saned not find scanner that scanimage -L finds

Bug #1632183 reported by mike Bernson on 2016-10-11
This bug affects 2 people
Affects Status Importance Assigned to Milestone
sane-backends (Ubuntu)

Bug Description

When running scanimage -L on a remote system no scanner is found.
when running scanimage -L on local system (where saned is run) finds the scanners.

when running scaned in debug mode I can see the remote system request a list of scanner but no list is returned to scanimge -L. This tell me the network setups are working and access control is also working. It just does not find the scanner under saned but finds it under scanimage -L

I have remove saned stuff from systemd so I can run saned by hand

output from scanimage on local system (where saned is run)
root@cups:~# scanimage -L
device `hpaio:/net/HP_Color_LaserJet_CM2320nf_MFP?ip=' is a Hewlett-Packard HP_Color_LaserJet_CM2320nf_MFP all-in-one
device `hpaio:/net/Photosmart_Prem_C410_series?zc=HPF3B712' is a Hewlett-Packard Photosmart_Prem_C410_series all-in-one
device `hpaio:/net/photosmart_prem_c410_series?ip=' is a Hewlett-Packard photosmart_prem_c410_series all-in-one

output from saned with debug turned on:
root@cups:~# saned -d128
[saned] main: starting debug mode (level 128)
[saned] read_config: searching for config file
[saned] read_config: data port range: 10000 - 10100
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.25git starting up
[saned] do_bindings: trying to get port for service "sane-port" (getaddrinfo)
[saned] do_bindings: [1] socket () using IPv6
[saned] do_bindings: [1] setsockopt ()
[saned] do_bindings: [1] bind () to port 6566
[saned] do_bindings: [1] listen ()
[saned] do_bindings: [0] socket () using IPv4
[saned] do_bindings: [0] setsockopt ()
[saned] do_bindings: [0] bind () to port 6566
[saned] do_bindings: [0] bind failed: Address already in use
[saned] run_standalone: spawning Avahi process
[saned] run_standalone: waiting for control connection
[saned] saned_avahi_callback: AVAHI_CLIENT_S_RUNNING
[saned] saned_create_avahi_services: adding service 'saned'
[saned] saned_avahi_group_callback: service 'saned' successfully established
[saned] handle_connection: processing client connection
[saned] check_host: detected an IPv4-mapped address
[saned] check_host: access by remote host: ::ffff:
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: cups
[saned] check_host: local hostname(s) (from DNS):
[saned] check_host: local hostname(s) (from DNS): (null)
[saned] check_host: local hostname(s) (from DNS): (null)
[saned] check_host: remote host doesn't have same addr as local
[saned] check_host: opening config file: /etc/hosts.equiv
[saned] check_host: can't open config file: /etc/hosts.equiv (No such file or directory)
[saned] check_host: opening config file: saned.conf
[saned] check_host: config file line: `# saned.conf'
[saned] check_host: config file line: `# Configuration for the saned daemon'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `## Daemon options'
[saned] check_host: config file line: `# Port range for the data connection. Choose a range inside [1024 - 65535].'
[saned] check_host: config file line: `# Avoid specifying too large a range, for performance reasons.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# ONLY use this if your saned server is sitting behind a firewall. If your'
[saned] check_host: config file line: `# firewall is a Linux machine, we strongly recommend using the'
[saned] check_host: config file line: `# Netfilter nf_conntrack_sane connection tracking module instead.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `data_portrange = 10000 - 10100'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `## Access list'
[saned] check_host: config file line: `# A list of host names, IP addresses or IP subnets (CIDR notation) that'
[saned] check_host: config file line: `# are permitted to use local SANE devices. IPv6 addresses must be enclosed'
[saned] check_host: config file line: `# in brackets, and should always be specified in their compressed form.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# The hostname matching is not case-sensitive.'
[saned] check_host: config file line: `'
[saned] check_host: subnet with base IP =, CIDR netmask = 24
[saned] check_host: access granted from IP address (in subnet
[saned] init: access granted
[saned] init: access granted to batch@::ffff:
[saned] process_request: waiting for request
[saned] process_request: got request 1
[saned] process_request: waiting for request
[saned] process_request: got request 10
[saned] bailing out, waiting for children...
[saned] bail_out: all children exited

output from remote system access scaned
batch@ltcd-root:~$ scanimage -L

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).

WORKAROUND: Patch saned.c via:

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: sane-utils 1.0.25+git20150528-1ubuntu2
ProcVersionSignature: Ubuntu 4.4.0-38.57-generic 4.4.19
Uname: Linux 4.4.0-38-generic x86_64
NonfreeKernelModules: binfmt_misc ipmi_devintf veth iptable_filter ip_tables x_tables bridge stp llc zfs zunicode zcommon znvpair spl zavl gpio_ich intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ipmi_ssif aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd serio_raw lpc_ich input_leds joydev i2c_ismt ipmi_si ipmi_msghandler 8250_fintek shpchp mac_hid nfsd auth_rpcgss nfs_acl lockd grace sunrpc lp parport autofs4 igb dca ast ttm drm_kms_helper syscopyarea sysfillrect hid_generic sysimgblt fb_sys_fops uas ptp ahci pps_core libahci i2c_algo_bit drm usb_storage usbhid fjes hid
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Mon Oct 10 22:56:40 2016
 PATH=(custom, user)
SourcePackage: sane-backends
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.default.saned: 2016-10-09T21:44:20.500603
mtime.conffile..etc.sane.d.saned.conf: 2016-10-10T12:26:22.069621

mike Bernson (mike-mlb) wrote :

mike Bernson, thank you for reporting this and helping make Ubuntu better.

To advise, the saned documentation has been rewritten. Hence, could you please advise if it helps following ?

Changed in sane-backends (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Rolf Leggewie (r0lf) on 2017-02-08
description: updated
description: updated
description: updated
Launchpad Janitor (janitor) wrote :

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

Changed in sane-backends (Ubuntu):
status: Incomplete → Expired
mike Bernson (mike-mlb) wrote :

The problem still exists

I needed to patch saned.c:

I needed to change SANE_TRUE to SANE_FALSE

at line 1830:
         reply.status =
          sane_get_devices ((const SANE_Device ***) &reply.device_list,

Changed in sane-backends (Ubuntu):
status: Expired → New
description: updated

The attachment "Here is the patch I need to get saned to find all the scanners" 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
Launchpad Janitor (janitor) wrote :

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

Changed in sane-backends (Ubuntu):
status: New → Confirmed

As I understand it, this is an upstream design choice. saned doesn't let users select which scanners to share, it just shares any scanners that it can see. I think if network scanners were shared, then 2 saned instances on the same network get into a loop sharing the same scanner(s) recursively.

Nothing in the SaneDaemonTutorial points out this issue and it certainly wasn't clear to me from the saned manpage that this would be a problem.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers