quinta-feira, 30 de março de 2017

Software-center crash problems on Ubuntu 14.04 Trusty Tahr 32bits

I believe this is the best solution ever (tested on different Ubuntu base systems with the same problem) for software-center crash bug.

The typical crash log (if you start software-center from terminal):
2014-10-01 14:08:35,558 - softwarecenter.ui.gtk3.app - INFO - setting up proxy 'None'
2014-10-01 14:08:35,681 - softwarecenter.fixme - WARNING - logs to the root logger: '('/usr/lib/python2.7/dist-packages/dbus/proxies.py', 410, '_introspect_error_handler')'
2014-10-01 14:08:35,681 - dbus.proxies - ERROR - Introspect error on com.ubuntu.sso:/com/ubuntu/sso/credentials: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Process /usr/lib/ubuntu-sso-client/ubuntu-sso-login exited with status 1
Traceback (most recent call last):
  File "/usr/bin/software-center", line 130, in <module>
    app = SoftwareCenterAppGtk3(options, args)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 338, in __init__
    self.icons)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/session/appmanager.py", line 66, in __init__
    self.oauth_token = helper.find_oauth_token_sync()
  File "/usr/share/software-center/softwarecenter/backend/ubuntusso.py", line 141, in find_oauth_token_sync
    sso.find_credentials()
  File "/usr/share/software-center/softwarecenter/backend/login_impl/login_sso.py", line 74, in find_credentials
    self.proxy.find_credentials(self.appname, self._get_params())
  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 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Process /usr/lib/ubuntu-sso-client/ubuntu-sso-login exited with status 1
The solution that I have found to solve this bug, after many months of research, and many misleading information found on the web/google/blogs/forums is very simple, but difficult to understand for newbies and non-coders.

CAUTION: The Internet is full of 'false solution' (ie. or very case specific situations) to software-center bug affecting ubuntu users, and that lead to make your system even more corrupted and buggier than before, so please do take your time to understand what you are intending to "sudo" with or you will be in trouble.

After reading around quite a bit on several similar and somewhat related bug reports, the following 2 steps solved it for me (or seem to have solved it for all the systems I could identify with same crash log - which is also misleading - caution reading logs!).

Does not need to purge software-center or upgrade distribution or worst: DO NOT REINSTALL YOUR SYSTEM! Does not have to do with dbus or proxy or hardware problems, these are just side effects.

I diagnosed the problem as a 'pip' bug or 'pip configuration' corruption and its consequence on python subsystem.

So I targeted it as the result of a python 'pip' installation bug after a wrong 'pip' installation of a non standard package repository.

The solution is in part found for the 'pip' problem here:

REF: https://github.com/pypa/pip/issues/2686
User: jayachar88 commented on Apr 15, 2015

The solution is very simple at the end, just do this:
$ sudo python -m pip install --upgrade --force setuptools
$ sudo python -m pip install --upgrade --force pip
Not only does this solves python exception error with pip upgrade, but also a greater bug of Ubuntu community, which is the software-center crash bug.

Cheers!