[sane-devel] Warnings from SNMP (was Epson Perfection)

Charles Lindsey chl at clerew.man.ac.uk
Sun Oct 18 23:24:20 BST 2020



On 18/10/2020 01:33, Olaf Meeuwissen wrote:
> Hi Ralph, Charles,

>>> Also, when running xsane and even simple-scan, it produced massive
>>> warnings of the form:
>>> MIB search path:
>>> /home/chl/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
>>> Cannot find module (SNMPv2-MIB): At line 1 in (none)
>>> Cannot find module (IF-MIB): At line 1 in (none)
>>> Cannot find module (IP-MIB): At line 1 in (none)
>>> Cannot find module (TCP-MIB): At line 1 in (none)
>>> Cannot find module (UDP-MIB): At line 1 in (none)
>>> Cannot find module (HOST-RESOURCES-MIB): At line 1 in (none)
>>> Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
>>> Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
>>> Cannot find module (DISMAN-SCHEDULE-MIB): At line 1 in (none)
>>> Cannot find module (HOST-RESOURCES-TYPES): At line 1 in (none)
>>> Cannot find module (MTA-MIB): At line 1 in (none)
>>> Cannot find module (NETWORK-SERVICES-MIB): At line 1 in (none)
>>> Cannot find module (SNMPv2-TC): At line 15 in
>>> /usr/share/snmp/mibs/UCD-DISKIO-MI
>>> and much more. But I did not see them when using my own compiled
>>> backend-plustek.
>>>
>> Sorry, don't know about that.
> 
> Those warnings are courtesy of libsnmp and I think you compiled without.
> 
> The Ubuntu bug report you mentioned talks about the possibility that
> colord-sane may be causing this.  FWIW, we fixed a couple of backends a
> few months ago so that they no longer generate network traffic when the
> local-only option is used.  See
> 
>    https://gitlab.com/sane-project/backends/-/issues/130
> 
> for details.
> 
I have followed up that link, and also earlier discussions on this list 
referenced there. It all seems to boil down to the function
     SANE_Status sane_get_devices (const SANE_Device *** device_list,
                                   SANE_Bool local_only);
and the exact meaning of local_only, and even the developers on this list can't 
seem to agree on what that means. Note that there are more than one 
implementation of that function throughout the whole system. So here is my take 
on it:

Every usage of Sane starts from some frontend.

For example xsane (of which I have the code in front of me) has to decide what 
backend it is going to use. If a backend is specified on the command line (and 
you specify it by a Name (e.g. "Alice's Scanner"), then all is straightforward. 
Otherwise, xsane calls
    sane_get_devices(&xsane.devlist, SANE_FALSE /* local and network devices */);
which presumably looks at every SCSI Bus, and then any available Usb, and then 
any server on the LAN which is running saned (with proper authorisation for 
you), and then any such server on the internet; so if all it can find is a 
server in Timbuktu, you will have to hire a camel to take your document to 
Timbuktu to be scanned.

Now I have run xsane under gdb, and observe that by the time that call returns, 
the deluge of warnings from snmp has already appeared, and note also that at 
that stage all that xsane is aware of is a list of [name/vendor/model/type]; NO 
specific device has been chosen, so the instance of sane_get_devices obeyed must 
have been the generic one in libsane. We don't have a specific SANE_Handle 
available, and therefore we cannot have obeyed and code in any SANE_handler.

Therefore this is not a backend problem. The culprit for the deluge of warnings 
about snmp MUST be that sane_get_devices function in libsane, and that is where 
you should look.

Now it is quite reasonable for a backend to seek advice from colord as to how to 
process the stuff it scans (and I see that I do have a colord running, though 
nothing in /etc/init.d), but that is for later when an actual backend has been 
activated.

The plustek backend, which my scanner uses, has no interest in colord. It Does 
seem to envisage that is may have several devices of the same type under 
control, and it Does have a local implementation of sane_get_devices (which 
merely ignores its local_only parameter and returns a list of devices it has 
already been asked to activate). Who calls that local implementation is entirely 
unknown.

The colord-sane daemon is a more interesting problem. It is known known that it 
incorporates a call of sane_get_devices, but I am not running colord-sane (that 
I know of). And why it should get involved when sane_get_devices gets called 
from xsane I cannot imagine.

I would suggest that some investigation of what the sane_get_devices in libsane 
actually does and likewise what colord-sane is up to would lead to the solution 
for this deluge.

-- 
Charles H. Lindsey ---------At my New Home, still doing my own thing------
Tel: +44 161 488 1845                    Web: http://www.cs.man.ac.uk/~chl
Email: chl at clerew.man.ac.uk              Snail-mail: Apt 40, SK8 5BF, U.K.
PGP: 2C15F1A9 Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5



More information about the sane-devel mailing list