[syncpackage] crashed with AttributeError in get_password(): 'NoneType' object has no attribute 'keyDoesNotExist'

Bug #1027900 reported by Scott Kitterman
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-keyring (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I've used syncpackage without --bug or --sponsor as recently as yesterday with no problems, so I doubt this is a local system issue. I do have kwallet set to ask every time if it's OK to give access and it didn't even ask. It was like it doesn't even wait for an answer. In any case, this error should be caught and a more helpful, user friendly error message provided.

$ syncpackage --bug=1027775 --sponsor=logan python-pylibacl
Traceback (most recent call last):
  File "/usr/bin/syncpackage", line 742, in <module>
    main()
  File "/usr/bin/syncpackage", line 642, in main
    Launchpad.login(**kwargs)
  File "/usr/lib/python2.7/dist-packages/ubuntutools/lp/lpapicache.py", line 66, in login
    version=api_version)
  File "/usr/lib/python2.7/dist-packages/launchpadlib/launchpad.py", line 539, in login_with
    credential_save_failed, version)
  File "/usr/lib/python2.7/dist-packages/launchpadlib/launchpad.py", line 342, in _authorize_token_and_login
    authorization_engine.unique_consumer_id)
  File "/usr/lib/python2.7/dist-packages/launchpadlib/credentials.py", line 282, in load
    return self.do_load(unique_key)
  File "/usr/lib/python2.7/dist-packages/launchpadlib/credentials.py", line 336, in do_load
    'launchpadlib', unique_key)
  File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 34, in get_password
    return _keyring_backend.get_password(service_name, username)
  File "/usr/lib/python2.7/dist-packages/keyring/backend.py", line 240, in get_password
    if wallet.keyDoesNotExist(network, 'Python', key):
AttributeError: 'NoneType' object has no attribute 'keyDoesNotExist'

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: ubuntu-dev-tools 0.141
ProcVersionSignature: Ubuntu 3.2.0-26.41-generic-pae 3.2.19
Uname: Linux 3.2.0-26-generic-pae i686
ApportVersion: 2.0.1-0ubuntu11
Architecture: i386
Date: Mon Jul 23 07:45:57 2012
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/syncpackage
InstallationMedia: Kubuntu 11.04 "Natty Narwhal" - Beta i386 (20110330)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/syncpackage -s --bug=1027775 -s logan -f python-pylibacl
ProcEnviron:
 SHELL=/bin/bash
 TERM=xterm
 LANG=en_US.UTF-8
 LANGUAGE=
PythonArgs: ['/usr/bin/syncpackage', '-s', '--bug=1027775', '-s', 'logan', '-f', 'python-pylibacl']
SourcePackage: ubuntu-dev-tools
Title: syncpackage crashed with AttributeError in get_password(): 'NoneType' object has no attribute 'keyDoesNotExist'
UpgradeStatus: Upgraded to precise on 2012-04-09 (104 days ago)
UserGroups: adm admin audio cdrom dialout lpadmin plugdev sambashare syslog wireshark

Revision history for this message
Scott Kitterman (kitterman) wrote :
tags: removed: need-duplicate-check
Changed in ubuntu-dev-tools (Ubuntu):
importance: Undecided → Medium
Benjamin Drung (bdrung)
summary: - syncpackage crashed with AttributeError in get_password(): 'NoneType'
+ [syncpackage] crashed with AttributeError in get_password(): 'NoneType'
object has no attribute 'keyDoesNotExist'
Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1027900] Re: [syncpackage] crashed with AttributeError in get_password(): 'NoneType' object has no attribute 'keyDoesNotExist'

This turns out to be at least in part system configuration/user error. Somehow
my kwallet had gotten set to automatically denying these requests. Once I
fixed that, then it works.

This looks like a case that ought to be handled better though.

Revision history for this message
Adam Stokes (adam-stokes) wrote :

I agree, for whatever reason kwallet won't even start and the description is the same error received when attempting to use any application that relies on python-keyring. (e.g. launchpadlib)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-keyring (Ubuntu):
status: New → Confirmed
Changed in ubuntu-dev-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Adam Stokes (adam-stokes) wrote :

The easiest way I can reproduce this is running KDE4, killing kwalletd, and attempting to access launchpadlib:

(18967)/kdeui (Wallet): The kwalletd service has been disabled
(18967)/kdeui (Wallet): The kwalletd service has been disabled
(18967)/kdeui (Wallet): The kwalletd service has been disabled
(18967)/kdeui (Wallet): The kwalletd service has been disabled
(18967)/kdeui (Wallet): The kwalletd service has been disabled
(18967)/kdeui (Wallet): The kwalletd service has been disabled
Traceback (most recent call last):
  File "./bin/shadow-db", line 77, in <module>
    app = Application()
  File "./bin/shadow-db", line 42, in __init__
    self.lp = LP(self.logger, self.args)
  File "/usr/lib/python2.7/dist-packages/ShadowDatabase/lp.py", line 50, in __init__
    max_failed_attempts=self.retry)
  File "/usr/lib/python2.7/dist-packages/launchpadlib/launchpad.py", line 539, in login_with
    credential_save_failed, version)
  File "/usr/lib/python2.7/dist-packages/launchpadlib/launchpad.py", line 342, in _authorize_token_and_login
    authorization_engine.unique_consumer_id)
  File "/usr/lib/python2.7/dist-packages/launchpadlib/credentials.py", line 305, in load
    return self.do_load(unique_key)
  File "/usr/lib/python2.7/dist-packages/launchpadlib/credentials.py", line 359, in do_load
    'launchpadlib', unique_key)
  File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 37, in get_password
    return _keyring_backend.get_password(service_name, username)
  File "/usr/lib/python2.7/dist-packages/keyring/backend.py", line 301, in get_password
    if wallet.keyDoesNotExist(network, 'Python', key):
AttributeError: 'NoneType' object has no attribute 'keyDoesNotExist'

Note that gnome-keyring is running

~/.kde/share/apps » ps -ef |grep keyring
zef 3148 1 0 12:59 ? 00:00:00 /usr/bin/gnome-keyring-daemon --start --foreground --components=secrets

But it won't fallback to that either.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Should no longer be an issue with python-keyring ≥ 1.2.2 (i.e. the current version in Saucy).

no longer affects: ubuntu-dev-tools (Ubuntu)
Changed in python-keyring (Ubuntu):
status: Confirmed → Fix Released
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.