software-center crashed with IOError in _open()

Bug #688682 reported by Joda
608
This bug affects 60 people
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Fix Released
High
Michael Vogt
Natty
Fix Released
High
Michael Vogt

Bug Description

Binary package hint: software-center

WORKAROUND:

This bug can happen if the directory ~/.cache/software-center is created with root ownership somehow (see bug 652151 for some possible scenarios for how this might happen).

The fix is to set the ownership if this directory back to your user account. You can do this by typing the following into a terminal window (be sure to substitute your own username as noted below):

    sudo chown -R yourusername:yourusername ~/.cache/software-center

After this, Software Center should launch correctly.

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: software-center 3.0.4
ProcVersionSignature: Ubuntu 2.6.35-22.33-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic i686
Architecture: i386
Date: Fri Dec 10 20:37:24 2010
ExecutablePath: /usr/share/software-center/software-center
InterpreterPath: /usr/bin/python2.6
LiveMediaBuild: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/software-center
ProcEnviron:
 LANG=ru_UA.utf8
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/software-center']
SourcePackage: software-center
Title: software-center crashed with IOError in _open()
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
Joda (sithjoda) wrote :
Revision history for this message
Apport retracing service (apport) wrote : Possible regression detected

This crash has the same stack trace characteristics as bug #652151. However, the latter was already fixed in an earlier package version than the one in this report. This might be a regression or because the problem is in a dependent package.

tags: removed: need-duplicate-check
tags: added: regression-retracer
Revision history for this message
Joda (sithjoda) wrote :

So will you please tell me how can i fix this crach? Im i newbie in linux and entangled in this launchpad ;)

visibility: private → public
Revision history for this message
František Zatloukal (zatloukal-frantisek) wrote :

Here is error log from terminal:

fanys@fanys-netbook:~$ software-center
WARNING:root:trying to fix not writable cache directory
ERROR:root:failed to fix not writable cache directory
Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/paths.py", line 59, in try_to_fixup_root_owned_dir_via_remove
    os.rmdir(directory)
OSError: [Errno 39] Adresář není prázdný: '/home/fanys/.cache/software-center'
Traceback (most recent call last):
  File "/usr/bin/software-center", line 47, in <module>
    import softwarecenter.log
  File "/usr/share/software-center/softwarecenter/log.py", line 94, in <module>
    backupCount=5)
  File "/usr/lib/python2.7/logging/handlers.py", line 118, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/handlers.py", line 65, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/__init__.py", line 893, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 912, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Operace zamítnuta: '/home/fanys/.cache/software-center/software-center.log'
fanys@fanys-netbook:~$

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hey Joda and other reporters. This bug can happen if the directory ~/.cache/software-center is created with root ownership somehow (see bug 652151 for some possible scenarios for how this might happen).

The fix is to set the ownership if this directory back to your user account. You can do this by typing the following into a terminal window (be sure to substitute your own username as noted below):

    sudo chown -R yourusername:yourusername ~/.cache/software-center

After this, Software Center should launch correctly. Please let us know if you have any troublem and thanks for your report!

Changed in software-center (Ubuntu):
status: New → Incomplete
Revision history for this message
František Zatloukal (zatloukal-frantisek) wrote :

thanks, but, it still doesn't work, terminal log:

fanys@fanys-netbook:~$ sudo chown -R fanys:fanys ~/.cache/software-center
[sudo] password for fanys:
fanys@fanys-netbook:~$ software-Center
No command 'software-Center' found, did you mean:
 Command 'software-center' from package 'software-center' (main)
software-Center: command not found
fanys@fanys-netbook:~$ sudo chown -R fanys:fanys ~/.cache/software-centerfanys@fanys-netbook:~$ software-center
Neoprávněný přístup do paměti (SIGSEGV) (core dumped [obraz paměti uložen])
fanys@fanys-netbook:~$

Neoprávněný přístup do paměti (SIGSEGV) (core dumped [obraz paměti uložen]) mean Unallowed access to memory

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi František Zatloukal, thanks for reporting back. Looking at your terminal output, it seems that you may be encountering a separate issue as there is currently a known SIGSEGV crash with software-center in Natty (bug 259219).

Please try launching software center from the terminal as shown:

  LD_PRELOAD=/usr/lib/libstdc++.so.6 software-center

Software Center should start normally. After this, you can quit Software Center and it should launch normally (from the launcher, etc.) after that.

If this doesn't solve the problem, then this is a different issue. Please report back here and we will try to help.

Thanks!
Gary

Revision history for this message
František Zatloukal (zatloukal-frantisek) wrote :

Thanks gary, but
if i use your LD preload, it works PERFECTLY, but launcher must be modified to your command, by normal software-center, there is same error, terminal log (i tried your command without and with sudo )

fanys@fanys-netbook:~$ LD_PRELOAD=/usr/lib/libstdc++.so.6 software-center
2011-03-11 14:48:51,027 - softwarecenter.fixme - WARNING - logs to the root logger: '('/usr/share/software-center/softwarecenter/db/database.py', 142, 'open')'
2011-03-11 14:48:51,027 - root - WARNING - failed to add sca db Couldn't stat '/home/fanys/.cache/software-center/software-center-agent.db' (Adresář nebo soubor neexistuje)
/usr/share/software-center/softwarecenter/app.py:1114: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  self.window_main.show_all()
/usr/share/software-center/softwarecenter/SimpleGtkbuilderApp.py:50: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  gtk.main()
2011-03-11 14:49:01,780 - softwarecenter.app - INFO - software-center-agent finished with status 1
fanys@fanys-netbook:~$ LD_PRELOAD=/usr/lib/libstdc++.so.6 software-center
2011-03-11 14:50:47,311 - softwarecenter.fixme - WARNING - logs to the root logger: '('/usr/share/software-center/softwarecenter/db/database.py', 142, 'open')'
2011-03-11 14:50:47,310 - root - WARNING - failed to add sca db Couldn't stat '/home/fanys/.cache/software-center/software-center-agent.db' (Adresář nebo soubor neexistuje)
/usr/share/software-center/softwarecenter/app.py:1114: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  self.window_main.show_all()
/usr/share/software-center/softwarecenter/SimpleGtkbuilderApp.py:50: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  gtk.main()
2011-03-11 14:50:56,395 - softwarecenter.app - INFO - software-center-agent finished with status 1
fanys@fanys-netbook:~$ software-center
Neoprávněný přístup do paměti (SIGSEGV) (core dumped [obraz paměti uložen])
fanys@fanys-netbook:~$ sudo LD_PRELOAD=/usr/lib/libstdc++.so.6 software-center
2011-03-11 14:51:41,881 - softwarecenter.fixme - WARNING - logs to the root logger: '('/usr/share/software-center/softwarecenter/db/database.py', 142, 'open')'
2011-03-11 14:51:41,880 - root - WARNING - failed to add sca db Couldn't stat '/root/.cache/software-center/software-center-agent.db' (Adresář nebo soubor neexistuje)
/usr/share/software-center/softwarecenter/app.py:1114: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  self.window_main.show_all()
/usr/share/software-center/softwarecenter/SimpleGtkbuilderApp.py:50: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  gtk.main()
2011-03-11 14:51:48,091 - softwarecenter.backend.scagent - WARNING - error in query_info 'Operace není podporována'
2011-03-11 14:51:48,093 - softwarecenter.db.update - WARNING - error: Operace není podporována
2011-03-11 14:51:48,684 - softwarecenter.app - INFO - software-center-agent finished with status 1

tags: added: bugpattern-needed
Revision history for this message
Kiwinote (kiwinote) wrote :

I've pushed a fix for this to my branch which will unblock startup. Considering that this bug has had 16+ duplicates in the last 10 days, we should try to investigate why we get a non-writeable log file in the first place..

Changed in software-center (Ubuntu):
importance: Undecided → High
status: Incomplete → In Progress
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Kiwinote, thanks a lot for the nice, clean fix! It does the trick perfectly. It's merged to trunk and will be available in the next development release of Software Center which should appear at the very early part of next week.

Regarding the question about why we have seen a spate of duplicates of this problem in recent days, the timing seems to indicate that this is likely a side-consequence of the recent SIGSEGV crasher that so many people experienced (bug 259219). One possible scenario is that that many people, in an attempt to work around the SIGSEGV crash, attempted to launch software-center with root privileges. That said, I'm still not entirely sure of the exact conditions that would have resulted in this problem as I myself have not been able to reproduce this issue.

However, the fact is that, very soon after the fix for bug 259219 was released, we saw a spike in reports of this bug. Now, a few days later, we no longer see these reports.

The good news is that your fix will prevent this particular issue from being a problem in the future. Thanks again for that!

Changed in software-center (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Gary Lasker (gary-lasker) wrote :

P.S. If any of the reporters could identify the things that they did that might have caused this (launching software-center as sudo, etc.), it might be very helpful to know about it. This would go a long way toward helping us to identify the root cause for how this may have happened.

Thanks!

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

This bug was fixed in the package software-center - 3.1.24

---------------
software-center (3.1.24) natty; urgency=low

  [ Gary Lasker ]
  * softwarecenter/view/widgets/thumbnail.py:
    - add missing logger definition to fix name error on
      a thumbnail download error
  * softwarecenter/utils.py,
    softwarecenter/view/appdetailsview_gtk.py,
    softwarecenter/view/softwarepane.py:
    - update Unity launcher integration implementation per
      revised approach (see LP: #670403)
  * test/test_unity_launcher_integration.py,
    test/data/<many>:
    - update unit tests per the revised approach

  [ Michael Vogt ]
  * merged lp:~mmcg069/software-center/rtl-work, many thanks
    to Matthew McGowan
  * merged lp:~mmcg069/software-center/desc-tweaks
  * merged lp:~weblive-dev/software-center/weblive-by-default, thanks
    to Stephane Graber (LP: #736227)
  * softwarecenter/view/widgets/thumbnail.py:
    - fix show/hide issue in download_and_display()
  * softwarecenter/db/reviews.py, softwarecenter/models/appstore.py:
    - deal with empty appname in the review-stats to follow the
      latest server changes
  * merged lp:~mmcg069/software-center/reviews-msg-tweaks, many thanks
    to to Matthew McGowan
  * show launcher like location for commandline only apps, thanks
    to Matthew McGowan
  * when scanning for commandline binaries take alterantives into
    account as well

  [ Kiwinote ]
  * data/new.menu.in,
    softwarecenter/view/appview.py,
    softwarecenter/view/availablepane.py,
    softwarecenter/view/catview_gtk.py:
    - only display available items in what's new (LP: #739276)
    - don't display installed items in what's new (LP: #627114)
  * softwarecenter/db/database.py:
    - don't crash when we have no axi values (LP: #737870)
  * softwarecenter/gwibber_helper.py:
    - don't crash on startup due to anything sqlite related (LP: #737220)
  * softwarecenter/log.py:
    - don't crash on startup when logfile is not writeable (LP: #688682)
  * softwarecenter/view/appdetailsview_gtk.py:
    - correctly update statusbar after cancelling a dependency dialog
  * softwarecenter/view/catview_gtk:
    - don't crash when we have no what's new carousel (LP: #736046)
  * softwarecenter/view/softwarepane.py:
    - connect 'transaction-stopped' to on_transaction_stopped rather than o_t_f
  * softwarecenter/view/widgets/reviews.py:
    - fallback to package_name if review_data contains no app_name
 -- Michael Vogt <email address hidden> Tue, 22 Mar 2011 16:03:58 +0100

Changed in software-center (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Kiwinote (kiwinote) wrote :

It seems that this is not yet fixed correctly.

Changed in software-center (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Robbie Williamson (robbiew) wrote :

targeting this to Oneiric, since we probably want it fixed there...and it's too late (IMO) to try and fix for Natty.

Changed in software-center (Ubuntu Oneiric):
status: New → In Progress
importance: Undecided → High
Revision history for this message
Joe Archer (joe-archer-gmail) wrote :

So what you're saying is, I won't have a GUI means of installing applications on my netbook in this release of Ubuntu? Because I'm sure people will agree, that's a pretty big deal and would definitely mean a move to another distro for me.

Revision history for this message
Lewis Chung (lewis-f-chung) wrote : Re: [Bug 688682] Re: software-center crashed with IOError in _open()

Sorry, this has been fixed, at least in my case. there was a permissions
issue earlier on in the alphas
On Apr 18, 2011 1:01 PM, "Joe Archer" <email address hidden> wrote:
> So what you're saying is, I won't have a GUI means of installing
> applications on my netbook in this release of Ubuntu? Because I'm sure
> people will agree, that's a pretty big deal and would definitely mean a
> move to another distro for me.
>
> --
> You received this bug notification because you are a direct subscriber
> of a duplicate bug (738074).
> https://bugs.launchpad.net/bugs/688682
>
> Title:
> software-center crashed with IOError in _open()
>
> Status in “software-center” package in Ubuntu:
> In Progress
> Status in “software-center” source package in Oneiric:
> In Progress
>
> Bug description:
> Binary package hint: software-center
>
> live ubuntu from USB
>
> ProblemType: Crash
> DistroRelease: Ubuntu 10.10
> Package: software-center 3.0.4
> ProcVersionSignature: Ubuntu 2.6.35-22.33-generic 2.6.35.4
> Uname: Linux 2.6.35-22-generic i686
> Architecture: i386
> Date: Fri Dec 10 20:37:24 2010
> ExecutablePath: /usr/share/software-center/software-center
> InterpreterPath: /usr/bin/python2.6
> LiveMediaBuild: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
> PackageArchitecture: all
> ProcCmdline: /usr/bin/python /usr/bin/software-center
> ProcEnviron:
> LANG=ru_UA.utf8
> SHELL=/bin/bash
> PythonArgs: ['/usr/bin/software-center']
> SourcePackage: software-center
> Title: software-center crashed with IOError in _open()
> UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
>
> To unsubscribe from this bug, go to:
>
https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/688682/+subscribe

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Joe, I'm very sorry for the trouble you've been having with this bug. There is actually a workaround in comment #5 that will fix this problem for you. I've added the workaround to the original bug description, and will include it here so as well so that it's not buried in the many comments. It involves typing a single command into the terminal, and once this is done Software Center should work as expected from that point on. Please give this a try and it should take care of the problem for you.

WORKAROUND:

This bug can happen if the directory ~/.cache/software-center is created with root ownership somehow (see bug 652151 for some possible scenarios for how this might happen).

The fix is to set the ownership if this directory back to your user account. You can do this by typing the following into a terminal window (be sure to substitute your own username as noted below):

    sudo chown -R yourusername:yourusername ~/.cache/software-center

After this, Software Center should launch correctly.

description: updated
Changed in software-center (Ubuntu):
assignee: nobody → Gary Lasker (gary-lasker)
Changed in software-center (Ubuntu Oneiric):
status: In Progress → Triaged
Revision history for this message
Michael Vogt (mvo) wrote :

This bug is fixed in the current code, however its not fully able to deal with the breakage it caused earlier.

The bug itself got fixed in 3.1.25:

--- software-center-3.1.23.1/softwarecenter/db/update.py 2011-03-07 10:15:24.000000000 +0100
+++ software-center-3.1.26.6/softwarecenter/db/update.py 2011-04-14 13:53:17.000000000 +0200
@@ -30,7 +30,6 @@
 import time
 import urllib
 import xapian
-import softwarecenter.log

 from ConfigParser import RawConfigParser, NoOptionError
 from gettext import gettext as _

The import had caused a subsequent import for softwarecenter.paths and that has created the dir. There is a check
there for os.getuid() == 0. Then HOME is unset, but xdg.BaseDirectory.xdg_cache_home was already created so
the updated HOME was not taken into account.

Changed in software-center (Ubuntu Natty):
assignee: Gary Lasker (gary-lasker) → Michael Vogt (mvo)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 3.1.26.8

---------------
software-center (3.1.26.8) natty; urgency=low

  * softwarecenter/log.py:
    - deal with not accessible ~/.cache/software-center directory
      (LP: #688682)
  * softwarecenter/paths.py:
    - check for SUDO_USER before xdg is imported, otherwise the
      check has no effect (LP: #688682)
  * softwarecenter/{paths,enums}.py, utils/update-software-center-agent:
    - remove unneeded xdg.BaseDirectory import
  * utils/update-software-center-agent, softwarecenter/enums.py:
    - remove unused imports, make imports explicit (thanks pyflakes)
 -- Michael Vogt <email address hidden> Tue, 19 Apr 2011 20:31:31 +0200

Changed in software-center (Ubuntu Natty):
status: In Progress → Fix Released
Changed in software-center (Ubuntu Oneiric):
importance: High → Undecided
status: Triaged → Invalid
Revision history for this message
Darek (noirbic) wrote :

Hi,

Gary's workaround is work.

Thanks.

----
BR

Revision history for this message
Szabó Gergely (szger) wrote :

+1

Thx!

Revision history for this message
Xwarman (xwarman) wrote :

yes, that works. I deleted that logfile. after restart of software-center it was created new, automaticlly and everything workes fine

Changed in software-center (Ubuntu Oneiric):
status: Invalid → Fix Committed
Changed in software-center (Ubuntu Oneiric):
assignee: nobody → GAURAV VIMAL (gaurav-vimalbhumca09)
no longer affects: software-center (Ubuntu Oneiric)
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.