race when calling ClearCredentials because we don't wait until sso is finished

Bug #986117 reported by Michael Vogt on 2012-04-20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Michael Vogt
Michael Vogt
ubuntu-sso-client (Ubuntu)

Bug Description

When testing software-center (https://code.launchpad.net/~gary-lasker/software-center/recommendations-sso-login-lp973612/+merge/102044/comments/221596 to be precise) I ran accross the following error:

2012-04-20 12:22:41,584:584.547042847 - ubuntu_sso.keyring.linux - DEBUG - Parsing secret.
2012-04-20 12:22:41,723:723.773002625 - ubuntu_sso.main - INFO - 'CredentialsManagement': emitting 'CredentialsCleared' with args (dbus.String(u'Ubuntu Software Center'),) and kwargs {}
2012-04-20 12:22:41,724:724.128961563 - ubuntu_sso.main - DEBUG - ref_count is 2, changing value to 1.
2012-04-20 12:22:41,724:724.632978439 - ubuntu_sso.credentials - ERROR - find_credentials (app_name: Ubuntu Software Center): Problem while getting credentials from the keyring.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/ubuntu-sso-client/ubuntu_sso/credentials.py", line 98, in inner
    result = yield f(self, *a, **kw)
DBusException: org.freedesktop.Secret.Error.NoSuchObject: The '/org/freedesktop/secrets/collection/login/542' object does not exist
2012-04-20 12:22:41,725:725.495100021 - ubuntu_sso.credentials - ERROR - register (app_name: Ubuntu Software Center): Problem while performing register.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/ubuntu-sso-client/ubuntu_sso/credentials.py", line 98, in inner
    result = yield f(self, *a, **kw)
DBusException: org.freedesktop.Secret.Error.NoSuchObject: The '/org/freedesktop/secrets/collection/login/542' object does not exist
2012-04-20 12:22:41,725:725.873947144 - ubuntu_sso.main - ERROR - 'CredentialsManagement': emitting 'CredentialsError' with args (dbus.String(u'Ubuntu Software Center'), DBusException(dbus.String(u"The '/org/freedesktop/secrets/collection/login/542' object does not exist"),)) and kwargs {}
2012-04-20 12:22:41,726:726.111888885 - ubuntu_sso.main - DEBUG - ref_count is 1, changing value to 0.
2012-04-20 12:22:41,726:726.2840271 - ubuntu_sso.main - DEBUG - Setting up timer with <function timeout_func at 0x1ed3398> (10000, <bound method CredentialsManagement.shutdown of <ubuntu_sso.main.CredentialsManagement object at 0x1ee3e10>>).
2012-04-20 12:22:50,244:244.35710907 - ubuntu_sso.main - DEBUG - shutdown!, ref_count is 0.
2012-04-20 12:22:50,244:244.682073593 - ubuntu_sso.main - INFO - Shutting down, calling <function shutdown_func at 0x1ed3410>.

Related branches

Natalia Bidart (nataliabidart) wrote :

This seems to be a race condition caused by the same app asking to clear the credentials, and before the CredentialsCleared signal is sent, the same app asks for the credentials again.

mvo, I will set as Invalid, if you keep having this after connecting (and waiting on) CredentialsCleared, please re-open.


Changed in ubuntu-sso-client (Ubuntu):
status: New → Invalid
Michael Vogt (mvo) on 2012-04-25
Changed in software-center (Ubuntu):
status: New → Incomplete
status: Incomplete → In Progress
importance: Undecided → Medium
summary: - odd (?) crash
+ race when calling ClearCredentials because we don't wait until sso is
+ finished
Changed in software-center (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
status: In Progress → Fix Committed

Hello Michael, or anyone else affected,

Accepted software-center into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in ubuntu-sso-client (Ubuntu Precise):
status: New → Invalid
Changed in software-center (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Gary Lasker (gary-lasker) wrote :

I verified this fix in software-center version 5.2.1 in precise-proposed. The crash described in the description no longer occurs.

Many thanks!

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 5.2.1

software-center (5.2.1) precise-proposed; urgency=low

  [ Michael Vogt ]
  * lp:~mvo/software-center/lp977179:
    - make the review UI react correctly to conditions of network
      availability (LP: #977179)
  * lp:~mvo/software-center/fix-crash-deb-file-size-calc:
    - fix crash when installing a deb file that is not found in
      the current apt cache
  * lp:~mvo/software-center/lp981992:
    - fix a crash in the new a11y code if there is a row that has
      no data or is not yet preloaded (LP: #981992)
  * lp:~mvo/software-center/fix-gmenu-searcher:
    - fix the menu searcher for non-Unity configurations after
      the app-install-data-ubuntu file layout changed
  * lp:~mvo/software-center/lp808455:
    - trivial fix for crash on downstream distros (LP: #808455)
  * lp:~mvo/software-center/lp927262:
    - fix crash when get_vadjustment() returns None (LP: #927262)
  * lp:~mvo/software-center/utf8-fixes:
    - fix various utf8-related crashes (LP: #943500, LP: #922225,
      LP: #917755)
  * lp:~mvo/software-center/gwibber-utf8-lp985255:
    - fix a utf8 crash in the gwibber integration (LP: #985255)
  * lp:~mvo/software-center/workaround-gtk-regression-lp986186:
    - workaround performance issue with the Gtk.TreeView.set_model()
      call when there is a cell_data_func attached. Not every user is
      affected (settings dependant somehow), but when affected it causes
      a massive performance degration for huge list models like "System"
      (LP: #986186). This branch works around the problem by disconnecting
      the cell_data_func before setting the new model.
  * lp:~mvo/software-center/fix-clear-credentials-race:
    - fix an incorrect use of the sso dbus backend, we now correctly
      wait until it emits a CredentialsCleared signal (LP: #986117)

  [ Gary Lasker ]
  * lp:~gary-lasker/software-center/add-to-launcher-after-auth-lp972710:
    - fix bug where an application will be added to the Unity launcher
      in the case where the user cancels the installation auth dialog
      (LP: #972710)
  * lp:~gary-lasker/software-center/recommendations-sso-login-lp973612:
    - fix bug where the recommendations opt-in panel is hidden if
      the user declines the SSO dialog after opting in (LP: #973612)
    - fix the user experience if the user has previously opted-in to
      recommendations and their SSO token is found have been removed
      or revoked or otherwise found to be invalid (LP: #967064)
    - improve the responsiveness of the spinner in the recommendations
 -- Michael Vogt <email address hidden> Thu, 26 Apr 2012 09:47:19 +0200

Changed in software-center (Ubuntu Quantal):
status: Fix Committed → Fix Released
Changed in software-center (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers