software-center crashed with TypeError in _get_combo_children(): object of type 'NoneType' has no len()

Bug #885726 reported by Martin Constantino–Bodin
162
This bug affects 35 people
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Fix Released
Low
Gary Lasker

Bug Description

Ubuntu Software Center version 5.2

Steps to reproduce (induces an error condition that causes the traceback for the crash in this bug):
1. Shut down Software Center, if it is running:
2. Open a terminal and type the following command:
   $ cd ~/.config/software-center; touch softwarecenter.cfg.new; chmod 400 softwarecenter.cfg.new
3. Launch Software Center from a terminal as shown:
   $ software-center
4. Once Software Center has started, shut it down again.
5. Note that you'll get a traceback reporting:
   IOError: [Errno 13] Permission denied: '/home/tremolux/.config/software-center/softwarecenter.cfg.new'
Followed by the error for this bug:
   TypeError: object of type 'NoneType' has no len()
6. Note also that Software Center does not fully quit.
7. Type the following in a terminal to kill Software Center:
   $ killall software-center
8. And finally, type the following to remove the bad softwarecenter.cfg.new file:
   $ rm softwarecenter.cfg.new (and verify that you want to remove this file)

Hi!

Well, when I closed the Sofware Center, Apport launches.
Here is the repport, hoping Apport’s information could be useful.

Note that during my upgrade to Oneiric, I got several problems and some of my packages might not be very well set.

Martin.

---

Note that this bug still occurs in final Precise version 5.2, as shown in the following traceback from duplicate bug 992452:

Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/availablepane.py", line 577, in on_db_reopen
    self.refresh_apps()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/availablepane.py", line 788, in refresh_apps
    SoftwarePane.refresh_apps(self, query)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/softwarepane.py", line 432, in refresh_apps
    self._refresh_apps_with_apt_cache(query)
  File "/usr/share/software-center/softwarecenter/utils.py", line 118, in wrapper
    f(*args, **kwargs)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/softwarepane.py", line 451, in _refresh_apps_with_apt_cache
    self.app_view.configure_sort_method(self._is_in_search_mode())
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/appview.py", line 223, in configure_sort_method
    self._use_combobox_without_sort_by_search_ranking()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/appview.py", line 155, in _use_combobox_without_sort_by_search_ranking
    if self._get_combo_children() == 3:
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/appview.py", line 147, in _get_combo_children
    return len(self.sort_methods_combobox.get_model())
TypeError: object of type 'NoneType' has no len()

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: software-center 5.0.2
ProcVersionSignature: Ubuntu 3.0.0-13.21-generic 3.0.6
Uname: Linux 3.0.0-13-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
CheckboxSubmission: 01a18e0a74cbde3d34a62f62830ed079
CheckboxSystem: f134069bba098730d27f59b402920826
Date: Thu Nov 3 16:05:36 2011
ExecutablePath: /usr/share/software-center/software-center
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/software-center
ProcEnviron:
 PATH=(custom, no user)
 LANG=fr_FR.utf8
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/software-center']
SourcePackage: software-center
Title: software-center crashed with TypeError in _get_combo_children(): object of type 'NoneType' has no len()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin audio cdrom dialout dip fax fuse lpadmin netdev plugdev sambashare tape video

Related branches

Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :
visibility: private → public
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-center (Ubuntu):
status: New → Confirmed
Revision history for this message
Guybrush88 (guybrush) wrote :

same here with ubuntu 12.04

Revision history for this message
TRx (trx-) wrote :

same here on 12.04. no additional information unfortunately.

Revision history for this message
Peter Eijlander (peter-eijlander) wrote :

Same here on 12.04 after an apt-get update && apt-get upgrade

Revision history for this message
Graham Lucking (lucking) wrote :

This has just happened to me on 12.04 which is fully up to date except for todays updates (04/03/2012).

I closed the software Centre by clicking the close button and got no response. so, I clicked again and the Software Centre closed but then the Closed unexpectedly message appeared and apport did its stuff. This was the first time I have used software Centre since 12.04 went into beta 1 and this problem did not occur earlier.

Revision history for this message
crtm (carlosrtm) wrote :

Same here: today, when I closed the Sofware Center, Apport launches, afte update.

Revision history for this message
Sven Romeike (lun4tic) wrote :

It happened to me while installing kubuntu-desktop and queueing multiple packages in the software center.

Revision history for this message
Sven Romeike (lun4tic) wrote :

edit: installed kubuntu-desktop in terminal.

Revision history for this message
Eslam Mostafa (cseslam) wrote :

i was installing "Elementary Pantheon" in terminal, i closed the software normally, but then an error appeared.

Revision history for this message
giacomo festa (giacomo-festa) wrote :

Ubuntu 12.04 lts beta 2 italian affect again

Changed in software-center (Ubuntu):
importance: Undecided → High
status: Confirmed → Triaged
assignee: nobody → Gary Lasker (gary-lasker)
milestone: none → precise-updates
description: updated
Changed in software-center (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Samop (samopn) wrote :

Similar for me...

After running software center (successfully) it apparently closes OK but on subsequent runs you get a blank screen. Typing

killall software-center

in the terminal will fix it for the next run.

If run from a terminal you get see the error list as it's trying to close.

Uninstall and reinstall don't fix it.

Revision history for this message
Michael Vogt (mvo) wrote :

Hello Sam - can you always reproduce this?

If so, what steps do you take to get the error? Or is just open/close enough to trigger the problem?

Revision history for this message
Samop (samopn) wrote :

Hello Michael

Just opening and closing the Software-Center is enough to trigger this problem.

Hope that helps

Sam

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your quick reply Sam!

Could you please run in a terminal window (like gnome-terminal):
 software-center --debug 2> /tmp/sc.log

and make it crash and then attach the file /tmp/sc.log to this bug report pleae?

Revision history for this message
Samop (samopn) wrote :

Hi Michael

This attachment should be that file.....
Sam

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

Thank you, Sam! The information in your log is exactly what we needed. Analyzing your log, it seems that the shutdown is interrupted due to an error with your software-center config file:

  IOError: [Errno 5] Input/output error: '/home/sam/.config/software-center/softwarecenter.cfg.new'

And this results in the crash that corresponds to this bug's stacktrace.

I was able to reproduce this error by restricing the permissions on the file softwarecenter.cfg.new.

This is great info and clears up the mystery of why we were getting this error. We can take it from here now and get the fix(es) in for this.

Many thanks for your help!

description: updated
Changed in software-center (Ubuntu):
importance: High → Low
tags: added: precise
Revision history for this message
Gary Lasker (gary-lasker) wrote :
Download full text (3.5 KiB)

As evidenced by this bug no longer appearing in errors.ubuntu.com, it was fixed with the merge of lp:~gary-lasker/software-center/fix-shutdown-crash-lp996333, and this fix was released in the package software-center - 5.2.2:

---------------
software-center (5.2.2) precise-proposed; urgency=low

  [ Michael Vogt ]
  * lp:~mvo/software-center/whatsnew-leak-lp985389:
    - search filter fix for the case when the "installed-only"
      filter leaks into subsequent searches (LP: #985389)
  * lp:~mvo/software-center/fix-lp994632:
    - add a dep to ensure we get the correct ubuntu-sso-client-gtk
      (LP: #994632)
  * lp:~mvo/software-center/proper-error-on-unknown-files:
    - show a proper error message when attempting to open unknown
      file types (LP: #944868)
  * lp:~mvo/software-center/lp921799:
    - fix crash when decoding screenshots JSON (LP: #921799)
  * lp:~mvo/software-center/lp959612:
    - fix crash when selecting the Installed view very quickly
      after startup (LP: #959612)

  [ Ken VanDine ]
  * lp:~ken-vandine/software-center/lp_982567:
    - Check if the proxy is enabled, if the proxy host is set but not
      enabled we shouldn't attempt to use the proxy (LP: #982567)

  [ Gary Lasker ]
  * lp:~gary-lasker/software-center/fix-crash-lp969732:
    - need to explicitly declare the needs-refresh signal in the
      AppTreeStore class to prevent a crash (LP: #969732)
  * lp:~gary-lasker/software-center/fix-crash-lp870822:
    - don't crash if we don't get a pkgversion object back
      (LP: #870822)
  * lp:~gary-lasker/software-center/fix-shutdown-crash-lp996333:
    - never crash when writing out the software center config file on
      shutdown (LP: #996333)
  * lp:~gary-lasker/software-center/fix-makedirs-race-crashes:
    - fix crash on race when creating the cache or config directories
      (LP: #743003, LP: #621182)
  * lp:~gary-lasker/software-center/fix-crash_lp973379:
    - ensure that the cache is ready before using the recommender
      service (LP: #973379 )
  * lp:~gary-lasker/software-center/toolbar-buttons-insensitive-during-startup:
    - set the toolbar buttons insensitive for the duration of time that the
      lobby panels are initializing (LP: #999486, LP: #994341)

  [ Robert Roth ]
  * lp:~evfool/software-center/bug532072:
    - escape markup for support info and license (LP: #993279)
    - ellipsize summary at trailing end (LP: #532072)
  * lp:~evfool/software-center/lp626037:
    - subtle background color tweak for consistency
      between views (LP: #626037)
  * lp:~evfool/software-center/lp835005:
    - no need for the software-properties dialog to be modal
      to software-center (LP: #835005)
  * lp:~evfool/software-center/lp839389:
    - don't display an "icon not found" image in the Unity
      launcher when a report a review window is opened (LP: #839389)
  * lp:~evfool/software-center/867588:
    - capitalize the first letter of the package summary
      (LP: #867588)
  * lp:~evfool/software-center/lp876657:
    - make sure the search field does not disappear when an
      install or remove is in progress (LP: #876657)
  * lp:~evfool/software-center/lp987797:
    - fix alignment in the revi...

Read more...

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

Cheers for your work Gary....

Sam

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

Thank you Sam, that is very kind of you to say! :) And may I say thank you to *you* as it was the information that you provided that gave us the crucial piece of information that allowed us to find the root cause of this bug. So, I thank you for your help, it is very much appreciated! You did indeed directly help to make Ubuntu better. :D

My best regards to you,
Gary

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.