Bug 20037 - USB MFP printers not detected, because /usr/lib/udev/rules.d/60-libsane.rules modifies all "scanners", including MFPs, to be in group "scanner"
Summary: USB MFP printers not detected, because /usr/lib/udev/rules.d/60-libsane.rules...
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18367
  Show dependency treegraph
 
Reported: 2016-12-28 17:39 CET by Marc Krämer
Modified: 2022-09-23 22:29 CEST (History)
8 users (show)

See Also:
Source RPM: cups-2.2.1-1.mga6.src.rpm, sane, libusb
CVE:
Status comment:


Attachments

Description Marc Krämer 2016-12-28 17:39:19 CET
cups reports it can't open device, but the rights on the device are ok.
Enabling debug output of cups didn't tell which device it can't open. In mga5 the printer was working fine.

Here is some output, please tell if anything is missing:

[root@localhost marc]# /usr/lib/cups/backend/usb
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Bad line: Vim�UnDo
DEBUG: Loaded 134 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=9
DEBUG2: Printer found with device ID: MFG:Brother;CMD:PJL,PCL,PCLXL;MDL:DCP-8060;CLS:PRINTER; Device URI: usb://Brother/DCP-8060?serial=000G9J899943
direct usb://Brother/DCP-8060?serial=000G9J899943 "Brother DCP-8060" "Brother DCP-8060" "MFG:Brother;CMD:PJL,PCL,PCLXL;MDL:DCP-8060;CLS:PRINTER;" ""

[root@localhost marc]# lsusb
Bus 001 Device 004: ID 04f9:01a3 Brother Industries, Ltd Composite Device
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 192f:0416 Avago Technologies, Pte. ADNS-5700 Optical Mouse Controller (3-button)
Bus 002 Device 002: ID 046a:0023 Cherry GmbH CyMotion Master Linux Keyboard G230
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

[root@localhost marc]# ll /dev/bus/usb/004/001
crw-rw-rw- 1 root lp 189, 384 Dez 28 16:30 /dev/bus/usb/004/001
 
[root@localhost marc]# journalctl -r|head
-- Logs begin at Fr 2015-10-09 14:18:13 CEST, end at Mi 2016-12-28 17:06:26 CET. --
Dez 28 17:06:26 localhost cupsd[5083]: Warte darauf dass der Drucker verfügbar wird.
Dez 28 17:06:26 localhost cupsd[5083]: Failed to open device, code: -3
Dez 28 17:06:26 localhost cupsd[5083]: Expiring subscriptions...
Dez 28 17:06:26 localhost cupsd[5083]: libusb_get_device_list=9
Dez 28 17:06:22 localhost cupsd[5083]: Expiring subscriptions...
Dez 28 17:06:21 localhost cupsd[5083]: Warte darauf dass der Drucker verfügbar wird.
Dez 28 17:06:21 localhost cupsd[5083]: Failed to open device, code: -3
 
[root@localhost marc]# grep DeviceURI /etc/cups/printers.conf
DeviceURI usb://Brother/DCP-8060?serial=000G9J899943
Marja Van Waes 2016-12-30 09:38:40 CET

CC: (none) => marja11
Assignee: bugsquad => thierry.vignaud

Comment 1 Marc Krämer 2017-01-08 13:47:57 CET
is there anything I can do to make the printer work again?
Comment 2 Kristoffer Grundström 2017-01-08 15:01:35 CET
(In reply to Marc K from comment #1)
> is there anything I can do to make the printer work again?

I suppose you could always try to debug the driver if it's open source.

CC: (none) => hamnisdude

Comment 3 Marc Krämer 2017-01-08 15:52:13 CET
this is not the driver it is libusb backend which has the problem

I did some builds and keep you informed about it.

Nevertheless I suggest to disable silent output of libusb_open (will post this in a ticket).
Comment 4 Marc Krämer 2017-01-08 17:25:18 CET
Ok, found it.

/usr/lib/udev/rules.d/60-libsane.rules
modifies all "scanners" to be in group "scanner". This is true for all MultiFunctionPrinters too. So I expect all MFP devices will have trouble after update.

For me I added a rule which gave full access to all users on the device. I think this might work, if lp is a member of group scanner too.

For libusb I suggest to generally enable debug output of libusb_open : function _get_usbfs_fd parameter "silent" (from op_open) which states the device which can't be opened.

I think this output would be MUCH more help than "Failed to open device, code: -3
"
Comment 5 Marja Van Waes 2017-01-08 17:44:18 CET
Thanks for debugging the issue, M K :-)

@ Zézinho

CC'ing you, because, sane-backends provides /usr/lib/udev/rules.d/60-libsane.rules
and afaik you're the maintainer.

Summary: USB printers not detected => USB MFP printers not detected, because /usr/lib/udev/rules.d/60-libsane.rules modifies all "scanners", including MFPs, to be in group "scanner"
Source RPM: cups-2.2.1-1.mga6.src.rpm => cups-2.2.1-1.mga6.src.rpm, sane, libusb
CC: (none) => lists.jjorge

Marja Van Waes 2017-01-08 17:45:30 CET

Blocks: (none) => 18367

Florian Hubold 2018-04-13 18:38:18 CEST

CC: (none) => doktor5000

Comment 6 Lewis Smith 2019-11-06 10:12:51 CET
See also bug 25660 (re scanner access rights).

CC: (none) => lewyssmith

Comment 7 Lloyd Osten 2022-09-20 16:33:42 CEST
I have an old Samsung SCX-4200 USB printer/scanner. I don't use it as a printer, so that's not a problem. Here's what happens when I use it as a scanner.

If I try using a scanning program (Xsane, for example) the scanner is only detected as soon as the scanner comes to the "ready" state. (scanner is set NOT to go into energy saving mode)

After about 10 minutes, Xsane (or other scanning programs) do not find the scanner (there are no devices)

For a test, I have another computer with Windows 11 installed. I also have VirtualBox 
 for Windows (6.1.38) installed on it. I installed Fedora Spin KDE-Live 37 beta under VirtualBox. The scanner works perfectly with Xsane and the other scanning programs, no matter how long it sits at the "ready" state.

CC: (none) => lloyd.osten

Comment 8 Morgan Leijström 2022-09-22 09:33:07 CEST
Anything better with update in
Bug 30703 - Update the complete sane stack
?

CC: (none) => fri

Comment 9 Lloyd Osten 2022-09-22 14:11:48 CEST
I have discovered a simple workaround that fixed my problem. I simply added myself to the groups "usb" and "scanner." It worked perfectly after that....even if the scanner was in power-saving mode.
Comment 10 Morgan Leijström 2022-09-22 14:18:52 CEST
Thank you for the quick reply and the tip :)

First thought is if this should be needed or automated, leaving for someone who knows better before closing.

Second thought is we should have wiki pages with tips for scanners and printers...
Comment 11 Lloyd Osten 2022-09-22 14:32:35 CEST
I know pretty much zero about programming. But it seems to me that if that's really the cause, then the scanner installation program should handle that automatically.

As for your second suggestion, I totally agree with you. The goal is to make Mageia as user-friendly and bug-free as possible.
Comment 12 Julien Moragny 2022-09-23 22:29:45 CEST
Regarding the original bug, doesn't the patch for bug #17593, which add the group lp in RW to the device fix the issue?
(see: http://svnweb.mageia.org/packages/cauldron/sane/current/SOURCES/sane-backends-1.0.25-udev-add-lp-group-rw.patch?view=log )

CC: (none) => julien.moragny


Note You need to log in before you can comment on or make changes to this bug.