xsane only scans as root

Bug #217571 reported by Aaron Sarna
108
This bug affects 17 people
Affects Status Importance Assigned to Milestone
sane-backends (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Following instructions in bug #180794:

I have a Brother DCP-130C multifunction printer-scanner-copier. I can only scan as root.

lsusb:
Bus 004 Device 002: ID 413c:8103 Dell Computer Corp. Wireless 350 Bluetooth
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 002: ID 04f9:01a8 Brother Industries, Ltd
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000

sane-find-scanner:
 # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x04f9, product=0x01a8) at libusb:003:002
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

  # You may want to run this program as root to find all devices. Once you
  # found the scanner devices, be sure to adjust access permissions as
  # necessary.

sudo sane-find-scanner:
  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x04f9, product=0x01a8) at libusb:003:002
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

output of lshal attached

Revision history for this message
Aaron Sarna (shoofy) wrote :
Revision history for this message
Akkana Peck (akkzilla) wrote :

Probably the same problem as bug #121082 -- the udev scanner rules have been removed and whatever hal is supposed to be doing instead isn't working. Try getting a copy of /etc/udev/rules.d/45-libsane.rules from a gutsy machine (and I'll attach a copy here) -- that fixed it here.

Revision history for this message
Aaron Sarna (shoofy) wrote :

Thanks for the suggestion. I just left my scanner in storage at school for the summer, so I won't be able to test it until late August.

Revision history for this message
Aaron Sarna (shoofy) wrote :

Actually Brother has now posted specific instructions for Ubuntu 8.04 on their website (http://solutions.brother.com/linux/sol/printer/linux/linux_faq.html#9):

1. Open "/etc/udev/rules.d/40-basic-permissions.rules" file.
2. Edit "0664" to "0666" in "USB devices" section.

Before the edit --------------------------
# USB devices (usbfs replacement)
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"
SUBSYSTEM=="usb_device", MODE="0664"

After the edit --------------------------
# USB devices (usbfs replacement)
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
SUBSYSTEM=="usb_device", MODE="0666"

3. Restart the system.

I can't test it, but I'm assuming they have.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 or 9.04?

Changed in sane-backends:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Aaron Sarna (shoofy) wrote :

I'm still seeing it on 8.10

Revision history for this message
Barneyonfire (ikearegal) wrote :

I am using 8.10 and it is not working.
The workaround by Brother didn't help, because the suggested changes were already done.
That is what it looked like right from the start.
    # USB devices (usbfs replacement)
    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
    SUBSYSTEM=="usb_device", MODE="0666"
Also see my comments here: https://bugs.launchpad.net/ubuntu/+bug/324783
I am going to contact their support and maybe we can get something out of it :)

Revision history for this message
Aaron Sarna (shoofy) wrote :

I made the change you mention (from http://solutions.brother.com/linux/en_us/instruction_scn1c.html#9) and it is working for me as a normal user.

Revision history for this message
spiral (perfectdrug) wrote :

I still have this problem with jaunty,
the above mentioned method worked for me in older Ubuntuversions, but the /etc/udev/rules.d/40-basic-permissions.rules file isn't present anymore to edit.

Revision history for this message
Fabián Rodríguez (magicfab) wrote :

In /etc/udev/rules.d/README I noticed this:

[...] Packages do not generally install rules here, this directory is for
local rules. If you want to override behaviour of package-supplied
rules, which can be found in /lib/udev/rules.d, you can do one of
two things:

 1) Write your own rules in this directory that assign the name,
    symlinks, permissions, etc. that you want. Pick a number higher
    than the rules you want to override, and yours will be used.

 2) Copy the file from /lib/udev/rules.d and edit it here; you
    should generally only do this if you want to prevent a program
    from being run.
[...]

I didn't have much time to experiment with a local rules files, so I went ahead and edited directly this file:
/lib/udev/rules.d/50-udev-default.rules

And it worked for me. So my workaround for this problem is:
1) Open a terminal window
2) gksudo gedit /lib/udev/rules.d/50-udev-default.rules
3) Make sure the following line has MODE=" 0666" at the end:

# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0666"

4) Restart the computer

I am not familiar with udev rules and as such I am not sure what other problems this may introduce, I'd appreciate if anyone else can elaborate on this.

Changed in sane-backends (Ubuntu):
importance: Low → Medium
status: Incomplete → Confirmed
Revision history for this message
Fabián Rodríguez (magicfab) wrote :

My scanner is part of a multi-function DCP 7020 Brother printer/scanner.

lsusb reports:
04f9:0183 Brother Industries, Ltd DCP-7020

Revision history for this message
solar3 (solar3) wrote :

[Solved for Jaunty]
My solution to only being able to use a scanner as root in Jaunty, much simpler than udev.rules, is:
  1) lsusb
.......
Bus 002 Device 002: ID 04f9:0182 Brother Industries, Ltd Composite Device

(but see also sudo xsane , where the xsane top panel says 0.996 DCP-7010:bus3;dev2 )

2) sudo pcmanfm
go to /dev/bus/usb/002/002
(Might want to try /dev/bus/usb/003/002 as well if this bus no. confusion exists)
Right mouse click > properties > permissions
Allow Run for Group and Other Users.

3) Reboot. I can now scan as a normal user.

Revision history for this message
Otto Kekäläinen (otto) wrote : Re: [Bug 217571] Re: xsane only scans as root

solar3:

Your solution works of course, but it is manual work and we want to
avoid setting permissions manually to invidivual devices. Therefore the
correct solution would be to fix udev rules so that the device's
permissions are correct by default.

I hope somebody with access to the upstream udev rules would fix this
now, please.

Revision history for this message
Bugsy (carlo-suomi24-deactivatedaccount) wrote :

I can also confirm that this still is a problem with Jaunty and Epson V100 scanner.

Revision history for this message
Kristian Frank Erikson (kristian-erikson) wrote :

This issue has re-appeared in 9.04 release for me.

Revision history for this message
VPablo (villumar) wrote :

In 9.04 we must edit /lib/udev/rules.d/50-udev-default.rules and change:

# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0664"

to

# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0666"

and restart.

Revision history for this message
Ludovic Claude (ludovicc) wrote :

Fix from VPablo works well for me. Thanks!
Ubuntu 9.04 x64, Brother printer/scanner DCP 7025

Revision history for this message
bastafidli (h-launchpad-bastafidli-com) wrote :

The VPablos fix doesn't work for me on Ubuntu Jaunty 9.04, because it disables both of my USB mice multiseat setup. What I had to do for my Fujitsu 4120c is to add file
/etc/udev/rules.d/45-libsane.rules
with the following content

# Fujitsu fi-4120C
SYSFS{idVendor}=="04c5", SYSFS{idProduct}=="1041", MODE="664", GROUP="scanner"

I also had to add group scanner

sudo addgroup scanner

and add myself and other users which should have access to the scanner to this group

sudo adduser some_username scanner

After reboot scanning works beautifully. This rule came from
http://forum.ubuntu-fr.org/viewtopic.php?pid=2707917
but the venfor and product can by discovered simply by running

xxx@yyy:~$ sane-find-scanner
...
found USB scanner (vendor=0x04c5, product=0x1041) at libusb:002:002
...

Revision history for this message
Mau (maugarta-cc) wrote :

bastafidli fix is good and I think it's the best because only acts on the device we need and allow limit users can use the scanner.
It works fine for my kubuntu 9.04
Thanks.

Revision history for this message
Øyvind Harboe (oyvind-harboe) wrote :

I'm experiencing the same problem with MFC-7820N but then as a network printer.

gscan2pdf (very nice app! covers what I do 99.999% of the time, scan
a mulitpage doc to a pdf) exhibits the same problem.

Any ideas on how to debug this problem for a network scanner?

Revision history for this message
Fabián Rodríguez (magicfab) wrote :

@bastafidli thank you, your fix also works for me and I'd favor it as it allows control of who scans.

I initially suspected Policy Kit so I used polkit-gnome-authorization to set proper scanner access but it didn't have any effect.

Revision history for this message
Mark Garrow (scunizi) wrote :

I too have a networked Brother MFC-7440N with the same problem.. nothing Brother suggested worked.. their last suggestion was to reinstall my os. Works with sudo xsane, doesn't work with standard user.. Ubuntu 8.10 & 8.04 (two different machines.

Revision history for this message
Markus Wolff (markus-wolff-hamburg) wrote :

I can confirm that his bug persists within Ubuntu 9.10 (Karmic Koala). I use a Brother DCP 7010, which is only recognized by both lsusb and sane-find-scanner when executed as root.

The solution proposed by bastafidli *does not work* in 9.10 !!!

Revision history for this message
Markus Wolff (markus-wolff-hamburg) wrote :

While the minmal-invasive solution for just a single device does not work, the solution provided by VPablo works in 9.10 as well. Since there does not seem to be a default rules file anymore, I added the file /etc/udev/rules.d/95-udev-late.rules, having the following content:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
SUBSYSTEM=="usb_device", MODE="0666"

This makes the scanner work in 9.10.

Revision history for this message
Alesh Slovak (alesh-slovak) wrote :

The udev rules file in 9.10 is located here: /lib/udev/rules.d/40-libsane.rules

Revision history for this message
wordsmyth2 (wordsmyth2) wrote :

        Thanks for this.
        Xsane works fine with HewlettPackhard multi-functions - right
        out of the box.
        Brother is waaay behind here.

        Cheers,

        wordsmyth

Alesh Slovak @avasys wrote:
> The udev rules file in 9.10 is located here:
> /lib/udev/rules.d/40-libsane.rules
>
>

Revision history for this message
dave grape (bogusgrape) wrote :

I search the i-net and found on http://forum.ubuntu-nl.org/hardware-en-drivers/9-10-en-brother-dcp-135c-no-way!/msg503627/ the following for my scanner.

We gaan het bestand /lib/udev/rules.d/40-libsane.rules aanpassen met de editor nano. Gebruik geen gedit, daar deze een backup achterlaat en dit is niet de bedoeling. Dus:

We are going to ajust the file /lib/udev/rules.d/40-libsane.rules with the editor nano. Don't use gedit because it left a backup file. We don't want that.

  sudo nano /lib/udev/rules.d/40-libsane.rules

Ga met de cursor helemaal naar beneden en voeg de 2 Brother regels toe, onder "Dell 1600n" en voor "The following rule will disable USB autosuspend for the device"

Go all the way down en add the following rule under "Dell 1600n and before "The following rule will disalbe USB autosuspend for the device"

# Brother scanners
ATTRS{idVendor}=="04f9", ENV{libsane_matched}="yes"

# The following rule will disable USB autosuspend for the device
ENV{libsane_matched}=="yes", RUN+="/bin/sh -c 'test -e /sys/$env{DEVPATH}/power$
LABEL="libsane_rules_end"

Bewaar het bestand door CTRL+x te drukken, dan Y of J (naargelang de taal) en dan op Enter te drukken.
Save the file by CTRL + x, then Y or J, (Related to your langeauge) then hit Enter.

I restarted my system and the scanner works without have to use root.

Herstart je systeem en probeer te scannen en te printen.

I use Ubuntu 9.10 with a Brother DCP 357c
Also lsusb let me see the printer without the use of sudo.

Revision history for this message
Øyvind Harboe (oyvind-harboe) wrote :

I just upgraded to Ubuntu 9.10 and I can not even scan as root(Brother MFC-7820N) anymore.

1. when I run "sudo xsane" => no devices are found

2. when I try just "xsane" I get a SEGFAULT

I'll try to reinstall the drivers to see if that helps...

Revision history for this message
Øyvind Harboe (oyvind-harboe) wrote :

Here's what I had to do to get scanning working again after upgrading from Ubuntu 9.04 to Ubuntu 9.10:

- uninstall drivers (sudo apt-get remove brscan2)
- reinstall

=> voila! I can scan as root using "sudo gscan2pdf"

When I try to run "gscan2pdf" as non-root, it never completes the "Fetching list of scanners" operation...

Revision history for this message
Akkana Peck (akkzilla) wrote :

In contrast to what wordsmyth2 says, it doesn't work in karmic with my HP F4280 multifunction (details in bug 121082). It's not just a Brother problem.

Revision history for this message
Douglas Hubler (douglas-hubler) wrote :

9.10, here's how i got my MFC-7820N to work again
1.) I uninstalled brscan2 (NOTE: apt-get remove complained about missing directories so i created them so it could finish uninstall)
2.) ran brsaneconfig2
 see http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/instruction_scn1b.html
3.) launch xsane and now it found the device

I am a big fan of brother, there linux support has been great

Revision history for this message
Douglas Hubler (douglas-hubler) wrote :

oops. i forgot a step.
1.5) Reinstall brscan2 after downloading from here
   http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_scn.html

Revision history for this message
Xavier Guillot (valeryan-24) wrote :

HEllo,

Same issue in Karmic : all worked fine in Jaunty, but I was unable to install Brother Scanner DCP-7030 on a fresh Karmic Koala (printing and driver are OK).

I donwloaded sane-utils / Brscan3 : http://solutions.brother.com/linux/en_us/download_scn.html#brscan3
Scanner Driver USB scan-key-tool : http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/instruction_scn3.html

I did : sudo gedit /lib/udev/rules.d/50-udev-default.rules
in section "libusb device nodes", I replaced 0664 by 0666

But no scanner was identified by xsane.

I used "sudo lsusb" command to see my scanner, it was on Bus 004 Device 003: Brother Industries, Ltd DCP-130C

Reason of impossible use was that device 3 was root owned.

So I opened Nautilus as root, went to dev/bus/usb/004 and device 3 (003 file) was with root permission only.
I modified it for my user name and now xsane works well, scanner is recognized.

Revision history for this message
Ludovic Claude (ludovicc) wrote :

Fix from Dave Grape works well on Karmic 9.10 amd64, with a Brother DCP-7025 printer/scanner.

Revision history for this message
Mark Garrow (scunizi) wrote :

Brother has new instructions and a .deb for Ubuntu. It's not the easiest thing to wade through their instructions to piece everything together for a distro and for each function. I recently did a fresh install of Kubuntu 9.10 and installed the driver(s). So far printing and scanning work like a charm. I've yet to get the faxing to work. I've attached step by step instructions as to what I did to get things working.. This should work the same on ubuntu as it does on kubuntu. I should note that in Brothers instructions there is mention that Ubuntu releases prior to (one I forgot) need to follow the instructions differently.

Revision history for this message
kamik-aze (kamik-aze) wrote :

Same problem here with xubuntu 9.10 and a Mustek 600 II N scanner. I'm able to scan when doing a sudo xsane but not as normal user. Creating such a rules file (as mentioned in former posts) is not an option for me because the scanner is not a USB scanner (it has on own ISA card which seems to be a kind of parallel port - the scanner is also powered by this card). At least I don't have an idea which kind of port numbers or vendor numbers I need to add.

Revision history for this message
nerdy_kid (nerdy-kid) wrote :

same problem here with Kubuntu 10.10 and a microtek scanmaker V6UPL.

creating /lib/udev/rules.d/50-scanner.rules with the line: ATTRS{idVendor}=="05da", ATTRS{idProduct}=="00b6", MODE="664",GROUP="scanner" and creating the group "scanner" and adding myself to that group fixed it.

Revision history for this message
Xavier Guillot (valeryan-24) wrote :
Revision history for this message
8200 (8200) wrote :

This bug still persist in ubuntu 12.10 amd64.

I had to change the following lines of "/lib/udev/rules.d/50-udev-default.rules"
from

# 'libusb' device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"

to
# 'libusb' device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"

Now the Borther DCP 7065 DN Scanner connected via usb is working.

Revision history for this message
penalvch (penalvch) wrote :

Aaron Sarna, thank you for reporting this and helping make Ubuntu better.

As per https://wiki.ubuntu.com/Releases your release is EOL.

If you have an issue in a supported release (ex. 16.04) please file a new report, and feel free to subscribe me to it.

Changed in sane-backends (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.