Crash on startup when trophy icons files are missing.

Bug #1031876 reported by Chris Wilson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Accomplishments Viewer
Fix Released
Low
Rafał Cieślak

Bug Description

This bug is partnered with bug #1031908.

After installing the latest daily build, I followed the instructions on this part of the wiki (https://wiki.ubuntu.com/Accomplishments/GetInvolved/Testing#Development_Testing) to clean out my settings before starting, which included the deletion on several files and folders. When subsequently trying to start accomplishments-viewer, I get the following output:

notgary@ubuntu ~/Other Projects/ubuntu-accomplishments-viewer % quickly run (08-01 16:10)
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `Window' can't be set after construction
  Gtk.Window.__init__(self, type=type, **kwds)
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `EditExtrainfoDialog' can't be set after construction
  Gtk.Window.__init__(self, type=type, **kwds)
Traceback (most recent call last):
  File "/home/notgary/Other Projects/ubuntu-accomplishments-viewer/accomplishments_viewer/AccomplishmentsViewerWindow.py", line 851, in opp_app_updated
    self.update_views(None)
  File "/home/notgary/Other Projects/ubuntu-accomplishments-viewer/accomplishments_viewer/AccomplishmentsViewerWindow.py", line 741, in update_views
    icon = GdkPixbuf.Pixbuf.new_from_file_at_size(str(acc["iconpath"]), 90, 90)
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 72, in constructor
    return info.invoke(cls, *args, **kwargs)
gi._glib.GError: Failed to open file '/home/notgary/.cache/accomplishments/trophyimages/ubuntu-community/askubuntu-bronze-locked.png': No such file or directory
Traceback (most recent call last):
  File "bin/accomplishments-viewer", line 42, in <module>
    accomplishments_viewer.main()
  File "/home/notgary/Other Projects/ubuntu-accomplishments-viewer/accomplishments_viewer/__init__.py", line 40, in main
    window = AccomplishmentsViewerWindow.AccomplishmentsViewerWindow()
  File "/home/notgary/Other Projects/ubuntu-accomplishments-viewer/accomplishments_viewer_lib/Window.py", line 35, in __new__
    new_object.finish_initializing(builder)
  File "/home/notgary/Other Projects/ubuntu-accomplishments-viewer/accomplishments_viewer/AccomplishmentsViewerWindow.py", line 235, in finish_initializing
    self.check_and_ask_for_info()
  File "/home/notgary/Other Projects/ubuntu-accomplishments-viewer/accomplishments_viewer/AccomplishmentsViewerWindow.py", line 291, in check_and_ask_for_info
    self.check_for_extra_info_required()
  File "/home/notgary/Other Projects/ubuntu-accomplishments-viewer/accomplishments_viewer/AccomplishmentsViewerWindow.py", line 1020, in check_for_extra_info_required
    self.libaccom.write_config_file_item("config", "extrainfo_seen", 1)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.IOError: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.7/dist-packages/accomplishments/daemon/dbusapi.py", line 284, in write_config_file_item
    return self.api.write_config_file_item(section, item, value)
  File "/usr/lib/python2.7/dist-packages/accomplishments/daemon/api.py", line 519, in write_config_file_item
    with open(cfile, 'wb') as configfile:
IOError: [Errno 2] No such file or directory: '/home/notgary/.config/accomplishments/.accomplishments'

The last line indicates that there should be some sort of check carried out for the existence of the .accomplishments file before attempting to open it, creating it if it fails.

Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

I'll take this as it seems like an easy thing to start with.

Changed in ubuntu-accomplishments-viewer:
assignee: nobody → Chris Wilson (notgary)
Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

I misread the error message and there seems to be three Tracebacks in there. I'm assuming the first one was triggered first, meaning it's the absence of the accomplishments directory in ~/.cache that's the problem.

summary: - Crash on startup when no ~/.config/accomplishments/.accomplishments
- present
+ Crash on startup when certain files or folders are missing from the
+ user's config settings.
Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote : Re: Crash on startup when certain files or folders are missing from the user's config settings.

After some testing I've found that manually running the daemon, either from the daily build with the twistd command or from the installed package with the accomplishments-daemon command, rectifies the problem. There are two lines printed to the terminal when running either of them:

Accomplishments install paths: /home/notgary/accomplishments:/usr/share/accomplishments
Trophies path: /home/notgary/.local/share/accomplishments/trophies

Examining the daemon source code just before these two lines are printed show that the test for creating the directories is already taking place when it is started up. The problem appears to be that the daemon is already running when the the dirs are deleted so it doesn't have the chance to recreate them before the viewer starts and crashes.

summary: - Crash on startup when certain files or folders are missing from the
- user's config settings.
+ Crash on startup when certain files or folders are missing.
Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote : Re: Crash on startup when certain files or folders are missing.

I've filed bug #1031908 as a partner to this one. There are two issues I see here: the daemon not being able to recreate the configuration directories, and the viewer not handling the absence of those files with grace.

description: updated
description: updated
summary: - Crash on startup when certain files or folders are missing.
+ Crash on startup when configuration files are missing.
Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote : Re: Crash on startup when configuration files are missing.

Thanks for this bug report!

All these tracebacks seem to me as if there was a version mismatch between your viewer and daemon. This may be the case just after updates - since the daemon does not get restarted manually (you can do it manually by running killall -9 twistd and then restarting the viewer, or by simply logging off your system and then logging back in). Moreover, the GwibberGtk import error looks like something we've already fixed a day or two before. Therefore I recommend you to ensure the packages you are using are indeed the latest available (or if you wish, getting the source from branches), and that the daemon gets restarted after any updates.

If this still fails, it would be helpful if you provided us with the exact versions of the packages you are using (both viewer and daemon).

Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

I've updated the error report with one from the daily build.

description: updated
Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

Output of dpkg -l | grep accomplishments

accomplishments-daemon 0.2+119~precise1
accomplishments-lens 0.2
accomplishments-viewer 0.2+154~precise1
ubuntu-community-accomplishments 0.2.1precise1+204~precise1
ubuntu-desktop-accomplishments 0.2+50~precise1

Revision history for this message
Jono Bacon (jonobacon) wrote :

Do you consider this bug to be Invalid, Chris?

Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

Yes, as per Rafal's comment on bug #1031908.

Changed in ubuntu-accomplishments-viewer:
status: New → Invalid
assignee: Chris Wilson (notgary) → nobody
summary: - Crash on startup when configuration files are missing.
+ Crash on startup when trophy icons files are missing.
Changed in ubuntu-accomplishments-viewer:
status: Invalid → Confirmed
assignee: nobody → Chris Wilson (notgary)
Changed in ubuntu-accomplishments-viewer:
milestone: none → 0.3
assignee: Chris Wilson (notgary) → Rafal Cieślak (rafalcieslak256)
importance: Undecided → Low
Changed in ubuntu-accomplishments-viewer:
status: Confirmed → Fix Committed
Changed in ubuntu-accomplishments-viewer:
status: Fix Committed → 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.