[edgy-backports] Error in libgphoto2 udev rules

Bug #91250 reported by Evgeny Kuznetsov
62
Affects Status Importance Assigned to Milestone
libgphoto2 (Ubuntu)
Invalid
High
Martin Pitt
Edgy
Won't Fix
High
Martin Pitt

Bug Description

Binary package hint: libgphoto2-2

The file /etc/udev/rules.d/45-libgphoto2.rules says in line 3:

BUS!="usb*", GOTO="libgphoto2_rules_end"

while recenly updated udev doesn't produce BUS properties in corresponding event. Thus this line makes the whole file useless, because BUS!="usb*" is never true.

Something like

SUBSYSTEM!="usb_device", GOTO="libgphoto2_rules_end"

instead would work.

Related branches

Revision history for this message
Jesús García Sáez (blaxter) wrote :

U rocks!, it works fine for me. thanks!

Revision history for this message
Marcus Meissner (meissner) wrote :

Use:

packaging/generic/print-camera-list udev-rules version 0.98 ....whatever is here for ubuntu...

for newer udev versions.

Revision history for this message
Martin Pitt (pitti) wrote :

Current Feisty uses:

SUBSYSTEM!="usb*", GOTO="libgphoto2_rules_end"

and uses the udev 0.98 rules, so it should actually work. Can you confirm that you are using latest Feisty?

Changed in libgphoto2:
status: Unconfirmed → Needs Info
Revision history for this message
Martin Pitt (pitti) wrote :

Ah, do you happen to use Edgy and the Feisty backport?

Revision history for this message
Evgeny Kuznetsov (nekr0z) wrote :

I happen to use Edgy with backport repos enabled. I don't know whether the package with wrong rules came from backports or not, but in any case those rules have to be altered, at least for Edgy (because it is actually Edgy that gets broken about this).

Revision history for this message
Peter Toft (petoft) wrote :

I had exactly this problem with Edgy during the last approx 5 days, and the solution of editing line 3 of /etc/udev/rules.d/45-libgphoto2.rules did the trick.

Martin Pitt (pitti)
Changed in libgphoto2:
assignee: nobody → pitti
importance: Undecided → High
status: Needs Info → In Progress
Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Martin, is this also Bug #90978 ?

Revision history for this message
Martin Pitt (pitti) wrote :

Thomas: yes, most probably.

Revision history for this message
Tobias (tobias-frech) wrote :

Worked for me. Also using Edgy with backports. Thanks!

Revision history for this message
2gunsup (2gunsup) wrote :

this didnt seem to do the trick for my canon sd600 =\

Revision history for this message
chrisecob (chrisecob) wrote :

Worked for me too

replaced
BUS!="usb*", GOTO="libgphoto2_rules_end"

in
/etc/udev/rules.d/45-libgphoto2.rules

with
SUBSYSTEM!="usb_device", GOTO="libgphoto2_rules_end"

Thankyou!

Revision history for this message
Alexandre Racine (alexandreracine) wrote : Can't transfert photos except as root

I confirm the comment by Chrisecob works.

I could detect the camera, but I could not access the photos except as root.

Revision history for this message
Guillermo Gutiérrez (capitanterrex) wrote : Re: [Bug 91250] Can't transfert photos except as root

El dom, 18-03-2007 a las 15:18 +0000, Alexandre Racine escribió:
> I confirm the comment by Chrisecob works.
>
> I could detect the camera, but I could not access the photos except as
> root.

Are you in the 'plugdev' group? Type «id» to see; if not, type:

sudo adduser `whoami` plugdev

I hope this will be helpful for you.

--
Guillermo Gutiérrez Herrera www.xiterrex.net
La madera de tu casa, en enero sea cortada.

Revision history for this message
Francesco Potortì (pot) wrote : Error in libgphoto2 udev rules confirmed

Same problem here with a Canon Powershot A70 which used to work. Solved as suggested by Chrisecob. I have edgy, edgy-updates and edgy-backports.

Revision history for this message
Daniel Lombraña González (teleyinex) wrote :

I'm in edgy without backports and I have the same problem. After modifying the line as you said I can import the photos, but Ubuntu stills not auto-detect-import my camera photos as with Dapper. I don't know what could be but this issue is happening to me since I have installed Edgy.

Thanks ;)

Revision history for this message
Blu (blutack) wrote :

Works with a Nikon Coolpix L4 in conjunction with bug #64146.
Also, on my Dell Inspiron 2200, when I modified the line 3 and restarted udev the music playing from Banshee increased in volume quite substantially, despite all other settings remaining the same. I assume this is something to do with Banshee's dependency on libgphoto.

Revision history for this message
Michael (michaeljt) wrote :

Another can't transfer photos except as root problem. I am using Edgy with backports enabled. It worked until recently. Now, if I change the permissions of /proc/bus/usb/002/005 (that is where the camera is currently plugged in) to make it world read and writable, then I can use digikam as user to get the photos, otherwise I can only do it as root. The camera is detected as user even with the standard permissions though. And yes, I am a member of the plugdev group. Here are the old permissions of the device:
crw-rw-r-- 1 root root 189, 132 2007-03-22 20:49 /proc/bus/usb/002/005

(Just checked, when I change the 'BUS!="usb*"...' line to 'SUBSYSTEM!="usb_Device"...'. it works again).

Revision history for this message
djayeff (jfvs45) wrote :

Hi all,
Thanks for this bug report.
Just to say that:

The file /etc/udev/rules.d/45-libgphoto2.rules says in line 3:
BUS!="usb*", GOTO="libgphoto2_rules_end"
while recenly updated udev doesn't produce BUS properties in corresponding event. Thus this line makes the whole file useless, because BUS!="usb*" is never true.
Something like
SUBSYSTEM!="usb_device", GOTO="libgphoto2_rules_end"

is working fine with my Canon EOS 350D...

Revision history for this message
leo antony (leo-antony) wrote :

This worked for me also. The camera in question was a Canon Ixus 330.

Thank you!

Revision history for this message
HarmonicaGoldfish (patricia-rosen) wrote :

I am not a developer, I am very new to Linux. I was told to look here to get an answer to this bug. I tried to follow the instructions above and this is what happened.

harmonicagoldfish@harmonicagoldfish:~$ /etc/udev/rules.d/45-libgphoto2.rules
bash: /etc/udev/rules.d/45-libgphoto2.rules: Permission denied
harmonicagoldfish@harmonicagoldfish:~$ sudo /etc/udev/rules.d/45-libgphoto2.rules
Password:
sudo: /etc/udev/rules.d/45-libgphoto2.rules: command not found
harmonicagoldfish@harmonicagoldfish:~$

I have a feeling that my inexperience has caused me to leave out a step...can someone point me in the right direction?

This is very much appreciated! I have a few hundred images that are waiting to be processed!

thanks,
HG

Canon powershot sd400
recent upgrade from 6.06 to 6.10

Revision history for this message
HarmonicaGoldfish (patricia-rosen) wrote :

I have fixed my error and made the change. My camera is not automatically detected when it is plugged in, however. I need to import through gthumbs.

I thought that was great feature of 6.06!

Revision history for this message
Martin Pitt (pitti) wrote :

Does not affect Feisty, opening Edgy task.

Changed in libgphoto2:
assignee: nobody → pitti
importance: Undecided → High
status: Unconfirmed → In Progress
status: In Progress → Rejected
Revision history for this message
Evgeny Kuznetsov (nekr0z) wrote :
Revision history for this message
Evgeny Kuznetsov (nekr0z) wrote :

Who said it affected Feisty? I was reporting this bug for CURRENT Ubuntu release, which is still Edgy, as far as I know!

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 91250] Re: [edgy-backports] Error in libgphoto2 udev rules

Hi Evgeny,

Evgeny nekr0z Kuznetsov [2007-04-02 15:06 -0000]:
> Who said it affected Feisty? I was reporting this bug for CURRENT Ubuntu
> release, which is still Edgy, as far as I know!

Don't worry, this change was just for internal bookkeeping. Since
Feisty is not affected by this issue, I marked it as such.

Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in Feisty, will backport once it's in the archive.

Changed in libgphoto2:
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

 * Trying to backport libgphoto2...
  - <libgphoto2_2.3.0.orig.tar.gz: downloading from librarian>
  - <libgphoto2_2.3.0-0ubuntu4.diff.gz: downloading from librarian>
  - <libgphoto2_2.3.0-0ubuntu4.dsc: downloading from librarian>
I: Extracting libgphoto2_2.3.0-0ubuntu4.dsc ... done.
I: Building backport of libgphoto2-2.3.0 as 2.3.0-0ubuntu4~edgy1 ... done.

Changed in libgphoto2:
status: Fix Committed → Fix Released
Revision history for this message
Tobias (tobias-frech) wrote :

I just received libgphoto2-2 Version 2.3.0-0ubuntu4~edgy1 via the update service.
This update reintroduced the "broken" line once again so that I had to fix this by hand once again.
Am I doing something wrong? Do I need to update anything else?

Revision history for this message
Evgeny Kuznetsov (nekr0z) wrote :

I confirm: the update has the same line, which doesn't work.

Revision history for this message
Martin G Miller (mgmiller) wrote :

I also confirm this problem with Edgy and backports enabled. I had fixed it a while back and after this mornings update, the same problem had reappeared. Edited the file again and it now works.

Revision history for this message
Martin Pitt (pitti) wrote :

Please give me the output of these commands:

  udevinfo -V
  sudo sh -ex /var/lib/dpkg/info/libgphoto2-2.postinst configure

Changed in libgphoto2:
status: Fix Released → Needs Info
Revision history for this message
Tobias (tobias-frech) wrote :

Martin,
do you need that info with or without the "fix" applied?
Should the camera be attached or not?

Revision history for this message
Frank Siegert (fsiegert) wrote :

Martin, same problem here, the postinst configure of 2.3.0-0ubuntu4~edgy1 adds the wrong line to the udev rules. Output you asked for:

$ udevinfo -V
udevinfo, version 093
$ sudo sh -ex /var/lib/dpkg/info/libgphoto2-2.postinst configure
Password:
+ set -e
+ [ configure = configure ]
+ ldconfig
+ PACKAGE=libgphoto2
+ mkdir -p /usr/share/hal/fdi/preprobe/10osvendor/
+ /usr/lib/libgphoto2/print-camera-list hal-fdi
+ rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-libgphoto2.fdi
+ rm -f /usr/share/hal/fdi/information/20thirdparty/libgphoto2.fdi
+ rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-libgphoto2-device.fdi
+ [ -d /etc/udev/ ]
+ which udevinfo
+ udevinfo -V
+ awk {if ($3 >= 98) exit 1}
+ /usr/lib/libgphoto2/print-camera-list udev-rules mode 0660 group plugdev
+ exit 0

Revision history for this message
Tobias (tobias-frech) wrote :

Ok, my questions seem to be irrelevant here ;-)
I have the same results like Frank does.

Using the parameter udev-rules-0.98 instead of just udev-rules would produce the proper output BTW.

Revision history for this message
Evgeny Kuznetsov (nekr0z) wrote :

Same here.

Revision history for this message
Martin Pitt (pitti) wrote :

Argh, I see the error. udev-rules-0.98 is supposed and documented to produce rules for udev >= 0.98, and udev-rules for udev < 0.98. But in fact it behaves exactly the other way round. Gah...

Changed in libgphoto2:
status: Needs Info → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Needs the same fix in Feisty.

Changed in libgphoto2:
status: Rejected → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Closing Feisty again; it is not swapped around.

Changed in libgphoto2:
status: In Progress → Rejected
Revision history for this message
Martin Pitt (pitti) wrote :

So, summary of Edgy situation:

- Original Edgy uses the old rules with BUS (but if BUS is broken, then the structure of the rules would ignore that).
- The original backport 2.3.0-0ubuntu3~edgy1 used udev-rules-0.98 which broke for many people
- The manual version 2.3.0-0ubuntu3~edgy2 uploaded by Colin (bug 90724) used udev-rules which apparently fixed it for some people
- The latest backport 2.3.0-0ubuntu4~edgy1 also uses udev-rules, and now it is apparently broken again for some people.

So please do the following:

  - Confirm that you use standard Edgy udev
  - Do

      /usr/lib/libgphoto2/print-camera-list udev-rules mode 0660 group plugdev | sudo tee /etc/udev/rules.d/45-libgphoto2.rules

    and test whether it works with your camera

  - Do

     /usr/lib/libgphoto2/print-camera-list udev-rules-0.98 mode 0660 group plugdev | sudo tee /etc/udev/rules.d/45-libgphoto2.rules

  and test whether it works with your camera

Changed in libgphoto2:
status: In Progress → Needs Info
Revision history for this message
Lionel Besson (lionel-besson) wrote :

The first solution didn't work for me, the second one did
(and the latest backport was no use)

I don"t know if I'm using standard Edgy udev, I've 093-0ubuntu18.0edgy2 version

Revision history for this message
Nathan (tomato7) wrote :

I can confirm this problem on Edgy with a Canon PowerShot SD550. I have universe, multiverse, updates, and backports enabled. The fix suggested in the original bug report worked.

Revision history for this message
Glauco Chiyaki Sesta (glauco-sesta) wrote :

Thanks a lot, you made my day man! I can finally import my pics again, after a morning spent googling around for a solution!

Revision history for this message
Pieterjan Lansbergen (pj) wrote :

My Nikon coolpix 990 is being detected but I still get errors from libgphoto2.

Any other suggestion?

Revision history for this message
Pieterjan Lansbergen (pj) wrote :

The error message I am getting is:
"Si è verificato un errore nella libreria di I/O ("Errore durante l'aggiornamento delle impostazioni della porta"): Impossibile rilasciare l'interfaccia 0 (Argomento non valido)."
(translated from Italian) is "an I/O error has occurred during port update. Impossible to release interface 0 (unvalid argument)

Hope this helps

Revision history for this message
larini (pflarini) wrote :

I return to ubuntu Dapper and both my nikon 880 and canon sd800 works
greate.

Now I still using dapper until another ubuntu LTS.

----- Original Message -----
From: "Pieterjan Lansbergen" <email address hidden>
To: <email address hidden>
Sent: Monday, April 16, 2007 11:16 AM
Subject: [Bug 91250] Re: [edgy-backports] Error in libgphoto2 udev rules

My Nikon coolpix 990 is being detected but I still get errors from
libgphoto2.

Any other suggestion?

** Attachment added: "gphoto2 autodetect log"
   http://librarian.launchpad.net/7336584/gphoto2-autodetect.log

--
[edgy-backports] Error in libgphoto2 udev rules
https://bugs.launchpad.net/bugs/91250
You received this bug notification because you are a direct subscriber
of a duplicate bug.

Revision history for this message
David Tangye (davidtangye) wrote :

larini, and anyone with Edgy still not getting photos found in gthumb: Try running "sudo gthumb". If it imports photos (like it does for me), change ownership of the jpg files and copy them to your normal user file area.

Revision history for this message
larini (pflarini) wrote :

Hi, I just try this with ubuntu feisty final and I get the same error:
Invalid Argument.

----- Original Message -----
From: "David Tangye" <email address hidden>
To: <email address hidden>
Sent: Wednesday, April 18, 2007 10:47 PM
Subject: [Bug 91250] Re: [edgy-backports] Error in libgphoto2 udev rules

larini, and anyone with Edgy still not getting photos found in gthumb:
Try running "sudo gthumb". If it imports photos (like it does for me),
change ownership of the jpg files and copy them to your normal user file
area.

--
[edgy-backports] Error in libgphoto2 udev rules
https://bugs.launchpad.net/bugs/91250
You received this bug notification because you are a direct subscriber
of a duplicate bug.

Revision history for this message
Dale (quail-linux) wrote :

Hi Martin

<quote>
/usr/lib/libgphoto2/print-camera-list udev-rules-0.98 mode 0660 group plugdev | sudo tee /etc/udev/rules.d/45-libgphoto2.rules
</quote>

The above command string fixed the problem with my Canon PowerShot A410

Regards
Dale

Revision history for this message
jimmy (jubxie) wrote :

the original fix worked for me on my two week old feisty install. The line was/is:

SUBSYSTEM!="usb*", GOTO="libgphoto2_rules_end"

and I changed it to:

SUBSYSTEM!="usb_device*", GOTO="libgphoto2_rules_end"

thanks

Revision history for this message
exactt (giesbert) wrote :

changing:

BUS!="usb*", GOTO="libgphoto2_rules_end"

to

SUBSYSTEM!="usb_device*", GOTO="libgphoto2_rules_end"

in

/etc/udev/rules.d/45-libgphoto2.rules

did it for the Canon PowerShot A95.

I found many different typings in this bug report. so check for typos.

Thx

Revision history for this message
Daniel Lombraña González (teleyinex) wrote :

Hi, I have upgraded to Feisty and now seems to be fixed. The only problem is that when I plug in the camera it doesn't pop-up the gthumb dialog for importing the photos.

Thx

Revision history for this message
HarmonicaGoldfish (patricia-rosen) wrote :

All through Edgy I did not get the pop-up for importing the photos, and this continued with my upgrade to Fesity.

Phogy, on the ubuntu forums suggested this:

rm -rf ~/.gconf/desktop/gnome/volume_manager

I did it, restarted, and it now works like a charm.

Revision history for this message
Evgeny Kuznetsov (nekr0z) wrote :

Upgraded to Feisty, so I cannot keep tracking this bug in Edgy any longer, sorry. And yes, I used the default udev on Edgy.

Revision history for this message
Lorenzo De Tomasi (lorenzo-detomasi) wrote :

I have a Canon Powershot A430 with Ubuntu 7.04 and I have the import problem.
I have tried both
SUBSYSTEM!="usb_device*", GOTO="libgphoto2_rules_end"
and
SUBSYSTEM!="usb_device", GOTO="libgphoto2_rules_end"

but nothing changes

Revision history for this message
Josh Burdick (jburdick-gradient) wrote :

I'm using 6.10, with no backports enabled that I know of.

Like, it appears, several other people, gthumb pops something up, but the.n complains about not being able to access the device. Running "sudo gphoto" works swimmingly well.

I too tried the 'SUBSYSTEM!="usb_device", GOTO="libgphoto2_rules_end"' hack, but that didn't help.

I am in the "plugdev" group; however, the device is created as owned by root, as shown by ls -l in /proc/bus/usb/003

total 0
crw-rw-r-- 1 root root 189, 256 2007-05-12 18:48 001
crw-rw-r-- 1 root root 189, 259 2007-05-13 19:43 004

After I "chgrp plugdev 004", it reads:
...
crw-rw-r-- 1 root plugdev 189, 259 2007-05-13 19:46 004

and I can run gphoto from the menu and it works fine.

The workaround of running sudo gphoto / photo-app-of-choice is slightly painful, but not a showstopper. It would be nice to know why it's being created as the wrong group, though. (That seems to be the issue, and not users accidentally being left out of the "plugdev" group.)

Revision history for this message
Neil Woolford (neil-neilwoolford) wrote :

Regression problem with my Nikon Coolpix 990, which works under Dapper (with a long wait for the camera driver to load).

Now doesn't work at all under 7.04/Feisty release.

Camera Import starts as soon as the camera is plugged in to the USB port but I get an error message in the Import Photos window. It is
" An error occurred in the io-library ('Error updating the port settings'): Could not release interface 0 (Invalid argument)."

I appear to have the up to date udev rules, the first four lines are;

# udev rules file for libgphoto2 devices (udev >= 0.98)
#
SUBSYSTEM!="usb*", GOTO="libgphoto2_rules_end"
ACTION!="add", GOTO="libgphoto2_rules_end"

Running "sudo gthumb" appeared to succeed once, but once only. Subsequent attempts have not worked, giving either the error above or attempting to look for the camera at incorrect addresses on the USB bus.

Revision history for this message
Martin Stechert (martin-stechert) wrote :

similar bug is #67532

The BUS to SUBSYSTEM change solved my permission problem with a Nikon D70, too.

By the way: allthough accessing my camera as normal user now works files in
/sys/bus/usb/devices/3-1/
/sys/devices/pci0000:00/0000:00:1e.0/0000:02:0b.0/usb3/3-1/

are still owned by root.
Confusing.

Regards,
Martin.

Revision history for this message
Marcus Meissner (meissner) wrote :

The devices that are opened live in /dev/bus/usb/XXX/YYY , not under /sys

Revision history for this message
PeteJ (vendors07) wrote :

On edgy, 6.10, with Nikon Coolpix 4600 (E4600 4600a), I got the error
Could not claim the USB device

lsusb showed my Nikon info, but that info was already in
/etc/udev/rules.d/45-libgphoto2.rules

This worked for me:

replaced
BUS!="usb*", GOTO="libgphoto2_rules_end"
in
/etc/udev/rules.d/45-libgphoto2.rules
with
SUBSYSTEM!="usb_device", GOTO="libgphoto2_rules_end"

Revision history for this message
Josh Burdick (jburdick-gradient) wrote :

I upgraded to Feisty (7.04), and it works.

Revision history for this message
Martin Pitt (pitti) wrote :

Edgy goes out of support in a month, and we could never quite figure out this confusing bug, which seems to work for some people and fail for others. Given that it pretty consistently works in newer releases, we won't invest effort into this any more.

Changed in libgphoto2:
status: Incomplete → Won't Fix
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.