Need to run the application with sudo first after it closes or crashes (after installing)

Bug #1381616 reported by SacredCrumb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Polly
Incomplete
Undecided
Unassigned

Bug Description

Initially, I thought I had to reinstall the program after it closes (or crashes due to "segmentation fault"). It seems I have to run the program with sudo to get it to start back up again, close it, then run normally.

-- For some reason this also completely erases the settings for accounts, panes, etc. (I'm still getting the hang of Ubuntu, so I wonder if it has to do with overriding user settings..?)

It goes as:

 - Run Polly with sudo.
 - Close the program after it opens to be ran without sudo.
 - Run Polly normally.

Those three steps I repeat every time I close the application. (or otherwise due to a crash) OS is 64-bit Ubuntu 14.10.

Since I have to otherwise run it through Terminal (using GUI does not work), this is the ouput:

$ sudo polly

Polly 0.93.11 (pre-alpha 3.11)
Copyright (C) 2011 Marcelo Hashimoto
cache path: /home/user/.cache/polly
config path: /home/user/.config/polly
data home: /home/user/.local/share/polly
initializing.../usr/local/lib/python2.7/dist-packages/polly/gui/theme.py:91: GtkWarning: Theme directory of theme Azenis Icons (Blue) has no size field

  self.window.realize()

(polly:30608): IBUS-WARNING **: The owner of /home/user/.config/ibus/bus is not root!
done
DEBUG: ASSISTANT DELETED
finalizing... done
clearing... done
Thank you for using Polly!
To contribute please visit https://launchpad.net/polly.

user@userPC:~/Downloads/Polly-0.93.11 (pre-alpha 3.11)$ polly

Polly 0.93.11 (pre-alpha 3.11)
Copyright (C) 2011 Marcelo Hashimoto
cache path: /home/user/.cache/polly
config path: /home/user/.config/polly
data home: /home/user/.local/share/polly
initializing.../usr/local/lib/python2.7/dist-packages/polly/gui/theme.py:91: GtkWarning: Theme directory of theme Azenis Icons (Blue) has no size field

  self.window.realize()
/usr/local/lib/python2.7/dist-packages/polly/gui/header/media.py:60: GtkWarning: Attempting to read the recently used resources file at `/home/user/.local/share/recently-used.xbel', but the parser failed: Failed to open file '/home/user/.local/share/recently-used.xbel': Permission denied.
  self.path_filechooserbutton = Gtk.FileChooserButton(TITLE, None)
 done

(process:30674): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 45, in set_password
    _keyring_backend.set_password(service_name, username, password)
  File "/usr/lib/python2.7/dist-packages/keyring/backends/SecretService.py", line 62, in set_password
    collection = self.get_default_collection()
  File "/usr/lib/python2.7/dist-packages/keyring/backends/SecretService.py", line 45, in get_default_collection
    collection.unlock()
  File "/usr/lib/python2.7/dist-packages/secretstorage/collection.py", line 71, in unlock
    return exec_prompt_glib(self.bus, prompt)[0]
  File "/usr/lib/python2.7/dist-packages/secretstorage/util.py", line 121, in exec_prompt_glib
    from gi.repository import GLib
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 32, in <module>
    raise ImportError('When using gi.repository you must not import static '
ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".

Additionally, upon the initial install of Polly, I had to grab a few different Python modules from repos. I'm not sure if that is relevant or not. I don't know if they are (or should have been) included in the actual Py package(s).

I'm in the dark about Python error messages, so I can only speculate about what this is saying.

Revision history for this message
Conscious User (conscioususer) wrote :

Do NOT start applications like Polly as sudo. Please describe the issues you are having while running it as a regular user and we'll focus on fixing those. But do not start as sudo, that should not be the solution.

Changed in polly:
status: New → Incomplete
Revision history for this message
SacredCrumb (sneezingdust-deactivatedaccount) wrote :

I realise running sudo is a bad idea. However, I was seeing what would get it running again/at all.

That being said, I cannot actually start it without doing that first. I just get these messages endlessly until I run sudo:

$ polly
Polly 0.93.11 (pre-alpha 3.11)
Copyright (C) 2011 Marcelo Hashimoto
cache path: /home/User/.cache/polly
config path: /home/User/.config/polly
data home: /home/User/.local/share/polly
initializing.../usr/local/lib/python2.7/dist-packages/polly/gui/theme.py:91: GtkWarning: Theme directory of theme Azenis Icons (Blue) has no size field

  self.window.realize()

Traceback (most recent call last):
  File "/usr/local/bin/polly", line 303, in <module>
    account_manager = gui.twitter.account.Manager(NAME, config_path, config_path_lock, setting_factory, proxy_controller, font_scheme, identifier_factory, status_bar)
  File "/usr/local/lib/python2.7/dist-packages/polly/gui/twitter/account.py", line 486, in __init__
    subtoken_secret = keyring.get_password(self.name, subtoken)
  File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 39, in get_password
    return _keyring_backend.get_password(service_name, username)
  File "/usr/lib/python2.7/dist-packages/keyring/backends/SecretService.py", line 53, in get_password
    collection = self.get_default_collection()
  File "/usr/lib/python2.7/dist-packages/keyring/backends/SecretService.py", line 45, in get_default_collection
    collection.unlock()
  File "/usr/lib/python2.7/dist-packages/secretstorage/collection.py", line 71, in unlock
    return exec_prompt_glib(self.bus, prompt)[0]
  File "/usr/lib/python2.7/dist-packages/secretstorage/util.py", line 121, in exec_prompt_glib
    from gi.repository import GLib
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 32, in <module>
    raise ImportError('When using gi.repository you must not import static '
ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".

I had tested something else a day or two ago, and I found out if it is started with permissions I can keep restarting the program normally like there isn't a problem. It seems to be only after I connect an account that it starts bugging out with those (above) errors.

Revision history for this message
Conscious User (conscioususer) wrote :

The error message refers to the fact that recent versions of the python-keyring library directly clash with GTK2, so both cannot be used at the same time. I solved this some time ago by bundling an older version of python-keyring with Polly. However, this bundled version is not being used in your installation, I'm not sure why.

I cannot test this myself since I don't have 14.10 installed. Once I do (no predictions on when I'll have the free time to install it), I might get some more info.

Revision history for this message
SacredCrumb (sneezingdust-deactivatedaccount) wrote :

Ah. I'll mess around with it in a VM to see if I can figure out what exactly happened, if anything. I don't know if it is expected, but I know I was missing a lot of dependency stuff during the very first installation. Maybe there was something I missed?

Also, I was mistaken. I have 14.04. My apologies on that.

Revision history for this message
SacredCrumb (sneezingdust-deactivatedaccount) wrote :

Update:

Here is the output on a fresh install in VM after getting the system up to date: http://pastebin.com/QgVV2QVy -- Posted to pastebin due to size.

Toward the bottom you'll see I also had to install python-keyring. I see Polly does install with a keyring module, but it will just give this error if I do not install it from the repos:

Traceback (most recent call last):
  File "/usr/local/bin/polly", line 241, in <module>
    from polly import setting, gui
  File "/usr/local/lib/python2.7/dist-packages/polly/__init__.py", line 344, in <module>
    import external, setting, proxy, shortener, iconset, twitter, gui
  File "/usr/local/lib/python2.7/dist-packages/polly/gui/__init__.py", line 177, in <module>
    import frontend, dialog, color, font, theme, basic, status, twitter, header, indicator, stream, shell
  File "/usr/local/lib/python2.7/dist-packages/polly/gui/twitter/__init__.py", line 992, in <module>
    import lead, post, topic, shelf, database, account
  File "/usr/local/lib/python2.7/dist-packages/polly/gui/twitter/account.py", line 40, in <module>
    from polly.external import keyring
  File "/usr/local/lib/python2.7/dist-packages/polly/external/keyring/__init__.py", line 9, in <module>
    from keyring.core import set_keyring, get_keyring, set_password, get_password
ImportError: No module named keyring.core

--
I only got it working normally one time on my VM. I'm not too sure on what I did specifically. I had just installed 14.04LTS, I had not updated the package lists, nor installed anything else. I installed Polly, the missing packages, then I updated the system. Somehow that caused it to work properly(?).

Also, it raises that same GObject error in Terminal once I authorise an account with the program. I'm not sure if that is worth mentioning or not.

Hope this all helps in some way!

Revision history for this message
Conscious User (conscioususer) wrote :

Gah, when building the packages for Utopic I realized that the bundled keyring module was not working in the unstable packages, only in the daily packages. Which were you using?

I now updated the unstable packages too, please update and test.

Revision history for this message
SacredCrumb (sneezingdust-deactivatedaccount) wrote :

I was using the pre-alpha 2 Polly-0.93.12.tar.gz version from the downloads.

I did not seem to have any trouble installing the unstable release in my VM. It just asks me now for a keyring password. I have to unlock it after rebooting, as well. Is that a regular thing?

That being said, I think the previous Polly version is gumming things up a bit on my physical machine. I installed the unstable package "polly_0.93.12~ubuntu14.04.1.tar.gz" from the PPA and uninstalled the newer keyring version, but now I get this error once I authorise an account:

ERROR:dbus.proxies:Introspect error on :1.7:/org/freedesktop/secrets/aliases/default: dbus.exceptions.DBusException: org.freedesktop.Secret.Error.NoSuchObject: The '/org/freedesktop/secrets/aliases/default' object does not exist
ERROR:dbus.connection:Unable to set arguments ({'org.freedesktop.Secret.Item.Label': '2660863200-qxq4aXdSJBHUaj6xnx8DJvk69RS4J9ycKcS5pDo @ polly', 'org.freedesktop.Secret.Item.Attributes': {'username': '2660863200-qxq4aXdSJBHUaj6xnx8DJvk69RS4J9ycKcS5pDo', 'service': 'polly'}}, dbus.Struct((dbus.ObjectPath('/org/freedesktop/secrets/session/s15'), '', dbus.ByteArray('qBZxNsxXbIVk6t93PetIdjwAeUhnHHgpLU37VyTQf44MQ'), 'text/plain'), signature=None), True) according to signature None: <type 'exceptions.TypeError'>: Expected a string or unicode object
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/polly/external/keyring/core.py", line 42, in set_password
    _keyring_backend.set_password(service_name, username, password)
  File "/usr/local/lib/python2.7/dist-packages/polly/external/keyring/backend.py", line 234, in set_password
    True)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  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 641, in call_blocking
    message.append(signature=signature, *args)
TypeError: Expected a string or unicode object

--

I can open Polly just fine, though. It only erases the account(s) I add. If there are files still lingering from the other version that I need to delete, I'll do that. As well as reinstalling the OS, if necessary. I just don't know what I would be looking for.

Revision history for this message
Conscious User (conscioususer) wrote :

"I installed the unstable package polly_0.93.12~ubuntu14.04.1.tar.gz from the PPA" makes no sense. Why are you installing a tarball from the PPA instead of simply adding the PPA to your repository list?

The error message indicates that GNOME Keyring might not be properly installed or running in your machine. This is outside Polly's scope, so I can't help on this.

Revision history for this message
SacredCrumb (sneezingdust-deactivatedaccount) wrote :

It was just a simple curiosity to install it that way, I suppose. Probably not the best idea, I admit.

 I'll take care of my system now that I know what went wrong. Thank you for answering my questions, though I do apologise for having caused all the fuss due to simple user error.

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.