Ubuntu software center crashes on first launch

Asked by Renardo

I am running Ubuntu 15.10 with daily updates. Some time ago I noticed that Ubuntu Software Center would always crash when I first tried to launch it within a session. On second try it works without problems. When that started I first let the "send error report" checkbox checked but now I uncheck it -- there should be enough reports about this problem.

I found a recommendation to look for "self.progress.set_data" in /usr/share/software-center/softwarecenter/ui/gtk3/views/appdetailsview.py but my copy of this file does not contain that string. The recommendation was about Ubuntu 12, so it may be outdated.

Syslog does not show anything I can relate to the problem. Any ideas what I could do? I have a workaroung (try again) but it is somewhat annoying.

I am starting Ubuntu Software Center by clicking on the suit case icon in the dash (or on the column of icons under the dash, not sure about the terminology).

Thanks in advance.
Renardo

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Is it OK if you run:

gksudo software-center

Do you get the error message?

Revision history for this message
Renardo (renardo) said :
#2

Thanks for the suggestion. I did not have gksudo installed (the difference to sudo seems marginal) so I first tried sudo. There was an interesting message:

File "/usr/share/software-center/softwarecenter/region.py", line 114, in _get_region_dumb
    countrycode = loc.split("_")[1]
IndexError: list index out of range

This did not happen on a second try. I now see that the given line in region.py contains the statement "countrycode = loc.split("_")[1].

Calling "locale" shows that all my settings use a language of "eo" (my Ubuntu UI is in Esperanto), and it looks like region.py is expecting a two-part language code, such as "fr_CA". Esperanto has no country-specific variants, and so there is no underscore in my locale. Too bad.

Which does not, however, explain why the second call works. I see from region.py that there are two ways of determining the country code: _get_region_geoclue() and _get_region_dumb(). It looks like for some reason the "geoclue" method fails in the first try (falling back to "dumb") but succeeds in the second.

Any idea why software center needs a country? Legal stuff? But determining it from the locale says nothing about the geographic location, just about the user's linguistic preferences. So an Italian from Italy living in Canada but using Italian Ubuntu would still have a country of "IT".

I guess I could patch region.py but now I am in doubt whether that would be legal.

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#3

Three remarks:

1. You might try completely reinstalling software-center by following step 10 in https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure#Step_10_Ubuntu_Software_Center_fails_to_open

2. Your reasoning about language codes with and without underscore is understandable.
As a workaround you mighty try changing your locale settings to eo_US.UTF-8 (see contents of /var/lib/locales/supported.d/eo)

3. You might consider creating a bug report about your problem.

Revision history for this message
Renardo (renardo) said :
#4

Thank you, Manfred. I just completed step 10 from your first proposal. The problem persists but I haven't rebooted yet -- I have backintime running (strange problems since last week but that's a different story), and that takes half a day. I will try again when I get a chance to reboot.

I am hesitating about your second proposal. It certainly is a viable workaround but as long as I do not know what the country information is used for i don't want to indicate a wrong one.

I think I shall file a bug since locale data without a country are a fact, and so software-center should be prepared to handle them. I consider this the "solution" of my problem.

Revision history for this message
Renardo (renardo) said :
#5

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

As an additional workaround for the case that a program consistently fails for language setting "eo"
(language code without underscore leading to "countrycode = loc.split("_")[1] IndexError: list index out of range" error messages or similar):

prepend the command with "LANG=C"

e.g.
LANG=C software-center

Revision history for this message
Renardo (renardo) said :
#7

Manfred, thanks for the idea but software-center evaluates LC_MONETARY, and "LANG=C" causes LC_MONETARY also to be set to "C", which does not contain an underscore. So software-center crashes at the same place in _get_region_dumb(). I just could not find out why _get_region_dumb() is called on the first call after system start and not upon subsequent tries. As I said I suspect some relationship with _get_region_geoclue().

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

An interesting question: What currency should be related to a 'global' language like Esperanto?
Maybe setting your local currency different to the language code works, perhaps something like

LC_MONETARY=de_DE.UTF-8 software-center

If you start software-center from the command line, do you see warning/error messages about geoclue?

Let's see what comments the bug report is going to get.