jockey-gtk crashed with AttributeError: 'tuple' object has no attribute 'getSections'

Bug #215027 reported by John Kozyrakis
180
Affects Status Importance Assigned to Milestone
jockey (Ubuntu)
Fix Released
Undecided
klee1001
Nominated for Hardy by cgoddard

Bug Description

this appears when running jockey-gtk, ubuntu hardy beta with latest updates as of today.

$ jockey-gtk
Traceback (most recent call last):
  File "/usr/bin/jockey-gtk", line 300, in <module>
    sys.exit(u.run())
  File "/usr/lib/python2.5/site-packages/jockey/ui.py", line 266, in run
    self.ui_init()
  File "/usr/bin/jockey-gtk", line 93, in ui_init
    self.update_tree_model()
  File "/usr/bin/jockey-gtk", line 240, in update_tree_model
    is_enabled = handler.enabled()
  File "/usr/share/jockey/handlers/nvidia.py", line 50, in enabled
    devices = self.xorg_conf.getSections('device')
AttributeError: 'tuple' object has no attribute 'getSections'

The gpu is nvidia geforce fx 5200.

Revision history for this message
Inkwina (phsi) wrote :

I have the exact same problem

Changed in jockey:
status: New → Confirmed
Revision history for this message
Nicolai (nicojorg) wrote :

same for me

Revision history for this message
Thorsten (ungesaeuertesbrot) wrote :

the api in guidance-backends, namely in /usr/share/python-support/guidance-backends/xorgconfig.py seems to have changed. This causes self.xorg_conf to be a tuple of XorgConfig and bool rather than a simple XorgConfig.

Changing line 60 in /usr/lib/python2.5/site-packages/jockey/xorg_driver.py from
                self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)
to
                self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)[0]

fixes the problem. I'm not sure what one could use the boolean value in the tuple for since it looks like an XorgConfig instance is created anyways or an Exception raised. And in anyy case xorg_driver.py simply fills in None if there was an exception. Anyway it might still be bad style to simply ignore that bool. Yet it seems to work. diff -Nurp is attatched.

Revision history for this message
Jeff Strunk (jstrunk-math) wrote :

This problem exists with versions 0.3.3-0ubuntu6 and 0.3.3-0ubuntu7.

I get the same exception in a different file though:

Traceback (most recent call last):
  File "/usr/bin/jockey-gtk", line 300, in <module>
    sys.exit(u.run())
  File "/usr/lib/python2.5/site-packages/jockey/ui.py", line 266, in run
    self.ui_init()
  File "/usr/bin/jockey-gtk", line 93, in ui_init
    self.update_tree_model()
  File "/usr/bin/jockey-gtk", line 240, in update_tree_model
    is_enabled = handler.enabled()
  File "/usr/lib/python2.5/site-packages/jockey/xorg_driver.py", line 77, in enabled
    devices = self.xorg_conf.getSections('device')
AttributeError: 'tuple' object has no attribute 'getSections'

This occurs in a system with an ATI Radeon HD 2400 XT. It does not occur on my ATI Rage 128 Pro Ultra TF or my Intel 82Q35 Express systems.

Revision history for this message
Jeff Strunk (jstrunk-math) wrote :

Throsten's patch fixes my problem.

Thank you.

Revision history for this message
Chafnan (chafnan) wrote :

I had the same issue.

Throsten's patch fixes it for me.

Thanks

Revision history for this message
peter b (b1pete) wrote :

subject: bug #215171
message from: Thorsten Shoel

*** This bug is a duplicate of bug 215027 ***
    https://bugs.launchpad.net/bugs/215027

** This bug has been marked a duplicate of bug 215027*** This bug is a duplicate of bug 215027 ***
    https://bugs.launchpad.net/bugs/215027

made the change suggested above; still no success when system-->admin-->hardware drivers called; no display. bug notification still pops up as before (when bug reported).

thank you,
peter b

Revision history for this message
peter b (b1pete) wrote :

ran also

sudo jockey-gtk

Traceback (most recent call last):
  File "/usr/bin/jockey-gtk", line 300, in <module>
    sys.exit(u.run())
  File "/usr/lib/python2.5/site-packages/jockey/ui.py", line 266, in run
    self.ui_init()
  File "/usr/bin/jockey-gtk", line 93, in ui_init
    self.update_tree_model()
  File "/usr/bin/jockey-gtk", line 240, in update_tree_model
    is_enabled = handler.enabled()
  File "/usr/lib/python2.5/site-packages/jockey/xorg_driver.py", line 77, in enabled
    devices = self.xorg_conf.getSections('device')
AttributeError: 'tuple' object has no attribute 'getSections'

and crash report again pops up.

thank you
peter b

Revision history for this message
peter b (b1pete) wrote :

video adapter ati x1300

Revision history for this message
tavella (tony-avella) wrote :

The fix worked for me. Ubuntu Hardy x86_64 Nvidia 7400.

Revision history for this message
Kai Stempfle (kai-stempfle) wrote :

Supplied patch worked for me, too.

nVIDIA GeForce 8600 GTS

# uname -a
Linux Wingthor 2.6.24-15-generic #1 SMP Tue Apr 8 00:33:51 UTC 2008 i686 GNU/Linux

Revision history for this message
lolzlolz (lolzlolz) wrote :

fixed for me as well
on a x86_64
nvidia 8600gt
thanks

Revision history for this message
BC7333 (brian-abtrafco) wrote :

Could someone point me to the directions how to apply the patch? Sorry linux newbie here.

Revision history for this message
peter b (b1pete) wrote :

latest packages installed, file rechecked, reboot twice --> everything OK, working.

thank you

Revision history for this message
jesmago (jesmago) wrote :

it also works for me.
Thank you!

Revision history for this message
Anmar Oueja (anmar) wrote :

I can confirm that this also works for me.

Revision history for this message
Matija Polajnar (matija-polajnar) wrote :

I can also confirm the existence of this bug and that the posted patch fixes the problem.

Revision history for this message
John S. Gruber (jsjgruber) wrote :

Nice work, Thorsten. The fix worked for me for installing a proprietary driver.

Removing a driver still gave me a similar problem with a UI traceback below the tuple problem. Using your research I found another call of readConfig later in the code and made the same change you made above. Then I was able to go back and forth.

Here's the total change:

--- xorg_driver.py 2008-04-08 21:06:25.000000000 -0400
+++ xorg_driver.py.new 2008-04-10 16:36:07.000000000 -0400
@@ -57,7 +57,7 @@

         if os.path.exists(OSLib.inst.xorg_conf_path):
             try:
- self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)
+ self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)[0]
             except (IOError, xorgconfig.ParseException, AttributeError):
                 self.xorg_conf = None
         else:
@@ -156,7 +156,7 @@
         elif os.path.exists(oldconf):
             open(OSLib.inst.xorg_conf_path, 'w').write(open(oldconf).read())
             os.unlink(oldconf)
- self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)
+ self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)[0]
         else: # no backup, so mangle current config manually
             device = self.xorg_conf.getSections('device')[0]
             device.driver = self.alt_free_driver

Revision history for this message
Daniel Morales (danielmorales) wrote :

The patch to fix the problem works for me too. Thanks :)

Zaneris (dstrike)
Changed in jockey:
assignee: nobody → dstrike
assignee: dstrike → nobody
Revision history for this message
gjw (gjw) wrote :

it works for me. thanks!

Revision history for this message
BC7333 (brian-abtrafco) wrote :

Nothing has worked for me here so far, updated, tried editing .py lines as above, uninstalled jockey, reinstalled..

brian@brian-laptop:~$ sudo jockey-gtk
[sudo] password for brian:
ERROR: could not open /proc/asound/cards: [Errno 2] No such file or directory: '/proc/asound/cards'
Traceback (most recent call last):
  File "/usr/bin/jockey-gtk", line 300, in <module>
    sys.exit(u.run())
  File "/usr/lib/python2.5/site-packages/jockey/ui.py", line 266, in run
    self.ui_init()
  File "/usr/bin/jockey-gtk", line 93, in ui_init
    self.update_tree_model()
  File "/usr/bin/jockey-gtk", line 240, in update_tree_model
    is_enabled = handler.enabled()
  File "/usr/share/jockey/handlers/nvidia.py", line 50, in enabled
    devices = self.xorg_conf.getSections('device')
AttributeError: 'tuple' object has no attribute 'getSections'

brian@brian-laptop:~$ lspci | grep VGA
01:00.0 VGA compatible controller: nVidia Corporation NV31M [GeForce FX Go5600] (rev a1)
brian@brian-laptop:~$

jockey-gtk --list --debug 2>&1|tee /tmp/jockey-dbg.txt results attached.

Revision history for this message
xtknight (xt-knight) wrote :

John S. Gruber:

Thank you, it fixes the problem for me as well. I haven't thoroughly tested the operation of jockey though to be sure.

While we're at it, here's a debdiff. And anyone can try the new packages at my PPA: https://launchpad.net/~xt-knight/+archive

Revision history for this message
John S. Gruber (jsjgruber) wrote :

@BC7333

Did you change both lines in /usr/lib/python2.5/site-packages/jockey/xorg_driver.py when you made the changes or just the one suggested by Thorsten earlier? I don't know when you read the error report and did your test.

If you made them both you might try it again against the reinstalled jockey, adding a print line before line 50 in /usr/share/jockey/handlers/nvidia.py and after the two changes above to print a comment and self.xorg_conf

     I looked again and can't find any more places where that variable is incorrectly set, so it looks to my naive eye like that should do it.

As Thorsten pointed out above, this is about a software interface problem, not about your specific hardware. That might be why there are so many people reporting it.

Revision history for this message
John S. Gruber (jsjgruber) wrote :

I see that the diff I posted got changed by the launchpad software. It looks like embedded whitespace is deleted. The indentation is off
and indentation is all important in python programs.

Attached is the diff.

Let me try again, (gambling that initial whitespace will be respected by the posting process)

In line 60 of /usr/lib/python2.5/site-packages/jockey/xorg_driver.py (16 spaces start each line)

                self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)
->
                self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)[0]

and in line 159 of the same file (12 spaces start each line)

            self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)
->
            self.xorg_conf = xorgconfig.readConfig(OSLib.inst.xorg_conf_path)[0]

@xtknight: Thanks. Thorsten Schoel did the work. I just robotically copied Thorsten and then bumbled my posting.

Revision history for this message
Junior (juniorperes) wrote :

Throsten,

Thank you! Your modification fixed also my problem. By the way I believe this should be corrected by an update to all users because this can happens with newbie.

Best regards,
Adilson

Revision history for this message
xtknight (xt-knight) wrote :

OK then, updated debdiff crediting Thorsten. Thank you for bringing it to our attention though.

Revision history for this message
xtknight (xt-knight) wrote :

I believe this fix is eligible for a Freeze Exception.

First, the hardware driver dialog is broken for everyone (AFAIK), and this patch has only fixed it so far for several folks.
I don't know Python or the jockey architecture that well, so I don't know the impact of it. Maybe someone else can elaborate on this. It looks like a small fix to me. I doubt it makes anything worse.

Revision history for this message
Michał Karnicki (karni) wrote :

Thanks Thorsten Schoel, it solved my problem.

Revision history for this message
cgoddard (chrismatic) wrote :

Thorsten's patch worked for me. Unless anyone encountered any problems with this patch it seems like this should be applied in an update.

Revision history for this message
samhassell (samhassell) wrote :

Fixed for me too. This needs to be pushed next update.

Revision history for this message
Andreas Schröder (mangkorn) wrote :

Thanks Thorsten Schoel, it solved my problem, too

Revision history for this message
klee1001 (k-merk) wrote :

Throsten's patch fixes my problem.

Thank you.

Changed in jockey:
assignee: nobody → k-merk
Revision history for this message
John Greenleaf-Maple (jandmgm) wrote :

Another confirmation of Thorsten's patch fixing jockeky-gtk crash after upgrade. Thanks!

Revision history for this message
g009 (g009) wrote :

Thorstens fix worked for me to.
amd64 athlon
nvidia geforce4 32mb

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

Those are all (even more) duplicates of bug 214914.

Changed in jockey:
status: Confirmed → Fix Released
Revision history for this message
keulieminogue (superkeule) wrote :

Greate!!! it works

Thanx a lot

Revision history for this message
chessepuff (paganjosh43130) wrote :

the patch works great thank Thorstens

Revision history for this message
coocoo (coocoo) wrote :

OK, I'm a TOTAL noob to this, I only installed ubuntu hardy heron at 10pm last night. I have no idea how to apply this fix because opening the referenced file and trying to change the line doesn't work because I'm not the owner of the file.

Please help, I'm trying to rid myself of the Windows shackles and things like this make me wonder what I've let myself in for!

Simply put, what do I do to apply this fix?

Revision history for this message
xtknight (xt-knight) wrote :

This bug must have been fixed elsewhere because the -ubuntu7 version works again now.

Revision history for this message
coocoo (coocoo) wrote :

aye, works for me now too...

Steve Langasek (vorlon)
Changed in jockey:
milestone: none → ubuntu-8.04
Revision history for this message
Thorsten (ungesaeuertesbrot) wrote : Re: [Bug 215027] Re: jockey-gtk crashed with AttributeError: 'tuple' object has no attribute 'getSections'

See #214914. They reverted the change in guidance-backends that caused
the problem for jockey in the first place.

Revision history for this message
thefuzz4 (jason-hamilton) wrote :

Thank you this fix worked great.

Revision history for this message
1+1=2 (dbzhang800) wrote :

It works.Thanks!!

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.