/usr/lib/unity-lens-photos/unity-lens-photos:TypeError:<module>:__init__:__init__:_get_accounts_for_service:constructor

Bug #1058061 reported by Evan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Online Accounts: libaccounts-glib
Invalid
Undecided
Alberto Mardegan
Photos Lens
Fix Released
High
Iain Lane
libaccounts-glib (Ubuntu)
Invalid
Undecided
Unassigned
unity-lens-photos (Ubuntu)
Fix Released
Undecided
Unassigned
Quantal
Fix Released
Undecided
Unassigned

Bug Description

https://errors.ubuntu.com/bucket/?id=/usr/lib/unity-lens-photos/unity-lens-photos:TypeError:<module>:__init__:__init__:_get_accounts_for_service:constructor

[Impact]
This is one of the most reported error on errors.ubuntu.com, probably related to dbus not being responsive when libaccounts needs it. This properly handles the error and avoid a lens crash by disabling the failing scope.

[Test case]
No clear test case to trigger this failure.

[Regression potential]
Minimal.

Related branches

Revision history for this message
Robert Ancell (robert-ancell) wrote :

I think this bug is in libaccounts-glib:libaccounts-glib/ag-manager.c:
static GObject *
ag_manager_constructor (GType type, guint n_params,
                        GObjectConstructParam *params)
{
    GObjectClass *object_class = (GObjectClass *)ag_manager_parent_class;
    AgManager *manager;
    GObject *object;

    object = object_class->constructor (type, n_params, params);

    g_return_val_if_fail (object != NULL, NULL);

    manager = AG_MANAGER (object);
    if (G_UNLIKELY (!open_db (manager) || !setup_dbus (manager)))
    {
        g_object_unref (object);
        return NULL;
    }

    return object;
}

i.e. the database has failed to open or dbus not worked.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Trace from errors.ubuntu.com:

Traceback (most recent call last):
  File "/usr/lib/unity-lens-photos/unity-lens-photos", line 162, in <module>
    daemon = Daemon()
  File "/usr/lib/unity-lens-photos/unity-lens-photos", line 98, in __init__
    flickr (self._lens)
  File "/usr/lib/unity-lens-photos/flickr_scope.py", line 60, in __init__
    self._get_accounts_for_service ('flickr')
  File "/usr/lib/unity-lens-photos/flickr_scope.py", line 97, in _get_accounts_for_service
    self._account_manager = Accounts.Manager.new_for_service_type("sharing")
  File "/usr/lib/python3/dist-packages/gi/types.py", line 76, in constructor
    return info.invoke(cls, *args, **kwargs)
TypeError: constructor returned NULL

Changed in online-accounts-libaccounts-glib:
assignee: nobody → Alberto Mardegan (mardy)
Revision history for this message
Iain Lane (laney) wrote :

Yeah this is the same as the other one. I don't think it's a bug in libaccounts-glib; we just need to handle it.

Changed in libaccounts-glib (Ubuntu):
status: New → Incomplete
status: Incomplete → Invalid
Changed in unity-lens-photos:
assignee: nobody → Iain Lane (laney)
status: New → In Progress
David Callé (davidc3)
Changed in unity-lens-photos:
status: In Progress → Fix Committed
David Callé (davidc3)
Changed in unity-lens-photos:
importance: Undecided → High
David Callé (davidc3)
description: updated
David Callé (davidc3)
description: updated
Revision history for this message
Iain Lane (laney) wrote :

there is an easy test case that I know of:

laney@raleigh> chmod a-r ~/.config/libaccounts-glib/accounts.db
laney@raleigh> killall unity-lens-photos; ./unity-lens-photos

crashes if bad, errors but doesn't crash if good

David Callé (davidc3)
Changed in unity-lens-photos:
milestone: none → 0.9
no longer affects: libaccounts-glib (Ubuntu Quantal)
David Callé (davidc3)
Changed in unity-lens-photos:
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Evan, or anyone else affected,

Accepted unity-lens-photos into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/unity-lens-photos/0.9-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in unity-lens-photos (Ubuntu Quantal):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

I've been running the fixed version for some time now and now from the -proposed, now regressions (or crashes) observed.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

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

This bug was fixed in the package unity-lens-photos - 0.9-0ubuntu1

---------------
unity-lens-photos (0.9-0ubuntu1) quantal-proposed; urgency=low

  * New upstream release.
    - [SRU] Default lenses results should appear above the shopping category
      (LP: #1066957)
    - TypeError:<module>:__init__:__init__:_get_accounts_for_service:constructor
      (LP: #1058061)
    - geeqie-standard crashes on start with SIGSEGV in editor_command_parse()
      when unity-lens-photos is installed (LP: #1056532)
 -- Lukasz 'sil2100' Zemczak <email address hidden> Fri, 19 Oct 2012 10:09:51 +0200

Changed in unity-lens-photos (Ubuntu Quantal):
status: Fix Committed → Fix Released
Changed in unity-lens-photos (Ubuntu):
status: New → Fix Released
Revision history for this message
Alberto Mardegan (mardy) wrote :

Removing libaccounts-glib from this released bug report.

Changed in libaccounts-glib:
status: New → 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.