update-manager crashes when locales are not working

Bug #471378 reported by Vilius on 2009-11-02
This bug affects 10 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)

Bug Description

Binary package hint: update-manager

I had some problems with my gnome configuration (not related to update-manager), so I had to reset all gnome configuration by removing gnome directories. I did that using this command in my home directory (now I know it wasn't such a good idea.. :)):

rm -rf .gnome .gnome2 .gconf .gconfd .metacity

After that everything works fine except Update Manager (update-manager package). If I try to run the program from a terminal I get the following error message:

vilius@vilius-work:~$ update-manager

(process:14671): Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/usr/bin/update-manager", line 107, in <module>
    app = UpdateManager(data_dir, options)
  File "/usr/lib/python2.6/dist-packages/UpdateManager/UpdateManager.py", line 119, in __init__
    logging.exception("setlocale failed")
NameError: global name 'logging' is not defined

I tried reinstalling update-manager, but it didn't help.

I know, I'm the one to blame for deleting those directories. But still, a good program should expect missing configuration files and use default configuration in that case, that's why I'm reporting this bug.

ProblemType: Bug
Architecture: i386
Date: Mon Nov 2 12:32:26 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: update-manager 1:
PackageArchitecture: all
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: update-manager
Uname: Linux 2.6.31-14-generic i686

Vilius (vilius) wrote :
Vilius (vilius) wrote :

By the way, how do I get the update manager working?

Michael Vogt (mvo) wrote :

The fix is embarrassingly simple:

=== modified file 'UpdateManager/UpdateManager.py'
--- UpdateManager/UpdateManager.py 2009-10-14 19:14:35 +0000
+++ UpdateManager/UpdateManager.py 2009-11-03 15:00:05 +0000
@@ -45,6 +45,7 @@
 import stat
 import re
 import locale
+import logging
 import tempfile
 import pango
 import subprocess

You should be able to get it working by reseting the locale you use in the login screen or by applying this patch to /usr/lib/python2.6/dist-packages/UpdateManager/UpdateManager.py

Changed in update-manager (Ubuntu):
status: New → Fix Committed
Vilius (vilius) wrote :

The patch works fine.

Michael Vogt (mvo) on 2009-11-13
Changed in update-manager (Ubuntu Karmic):
status: New → In Progress
summary: - update-manager crashes after reseting gnome directories
+ update-manager crashes when locales are not working
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:0.131

update-manager (1:0.131) lucid; urgency=low

  * UpdateManager/UpdateManager.py:
    - do not crash if setlocale() fails (LP: #471378)
  * UpdateManager/Core/DistUpgradeFetcherCore.py:
    - add missing "logging" import (LP: #475941)
  * DistUpgrade/DistUpgradeController.py:
    - better message for upgrades over ssh (LP: #463257)
  * UpdateManager/Core/utils.py:
    - improve proxy check and show error if proxy settings
      look invalid (LP: #472168)
  * AutoUpgradeTester/profile/*/DistUpgrade.cfg:
    - updated to test karimic -> lucid and hardy -> lucid
  * Janitor/plugins/deb_plugin.py:
    - use apt.progress.InstallProgress() to keep the computer-janitor
      UI responsive
  * AutoUpgradeTester/install_blacklist.cfg:
    - add ec2 to the blacklist for the kvm based testing
  * UpdateManager/UpdateManager.py:
    - show selected and download size in two rows (LP: #434062)
  * data/do-release-upgrade.8:
    - man page added, thanks to Willem Bogaerts
  * DistUpgrade/DistUpgrade.cfg:
    - add laptop-mode-tools to the forced obsoletes on upgrade (thanks to
      Steve Langasek)
  * UpdateManager/UpdateManager.py:
    - show restart required dialog in u-m when the upgrade is finished
      with proper parent
  * AutoUpgradeTester/post_upgrade_tests:
    - add python import, xorg and kernel tests
  * UpdateManager/dialog_release_notes.ui:
    - merged lp:~freinhard/update-manager/ui-fix (many thanks)
  * UpdateManager/Core/MetaRelease.py:
    - merge lp:~cristiklein/update-manager/use-xdg (many thanks)
 -- Michael Vogt <email address hidden> Tue, 01 Dec 2009 21:23:59 +0100

Changed in update-manager (Ubuntu Lucid):
status: Fix Committed → Fix Released
Reid Miller (sweetreid) wrote :

I had this exact problem when upgrading from 9.10 to 10.04 beta tonight.

I had to use the provided patch to fix UpdateManager.py. Strange..

rmiller@liptip:~$ sudo update-manager -d
[sudo] password for rmiller:
Sorry, try again.
[sudo] password for rmiller:
extracting 'lucid.tar.gz'
authenticate 'lucid.tar.gz' against 'lucid.tar.gz.gpg'
Traceback (most recent call last):
  File "/tmp/tmppJyGdN/lucid", line 7, in <module>
  File "/tmp/tmppJyGdN/DistUpgradeMain.py", line 132, in main
    if app.run():
  File "/tmp/tmppJyGdN/DistUpgradeController.py", line 1635, in run
    return self.fullUpgrade()
  File "/tmp/tmppJyGdN/DistUpgradeController.py", line 1609, in fullUpgrade
    if not self.doDistUpgrade():
  File "/tmp/tmppJyGdN/DistUpgradeController.py", line 1019, in doDistUpgrade
    res = self.cache.commit(fprogress,iprogress)
  File "/tmp/tmppJyGdN/DistUpgradeCache.py", line 239, in commit
    apt.Cache.commit(self, fprogress, iprogress)
  File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 314, in commit
    res = self.installArchives(pm, installProgress)
  File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 289, in installArchives
    res = installProgress.run(pm)
  File "/tmp/tmppJyGdN/DistUpgradeView.py", line 190, in run
    res = os.WEXITSTATUS(self.waitChild())
  File "/tmp/tmppJyGdN/DistUpgradeViewGtk.py", line 292, in waitChild
  File "/tmp/tmppJyGdN/DistUpgradeViewGtk.py", line 299, in updateInterface
  File "/usr/lib/python2.6/dist-packages/apt/progress/__init__.py", line 277, in updateInterface
  File "/tmp/tmppJyGdN/DistUpgradeViewGtk.py", line 282, in statusChange
    self.parent._webkit_view.get_load_status() == 2):
AttributeError: 'webkit.WebView' object has no attribute 'get_load_status'
rmiller@liptip:~$ sudo update-manager -d
[sudo] password for rmiller:

(process:11100): Gtk-WARNING **: Locale not supported by C library.
 Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/usr/bin/update-manager", line 107, in <module>
    app = UpdateManager(data_dir, options)
  File "/usr/lib/python2.6/dist-packages/UpdateManager/UpdateManager.py", line 119, in __init__
    logging.exception("setlocale failed")
NameError: global name 'logging' is not defined

Rolf Leggewie (r0lf) wrote :

karmic has seen the end of its life and is no longer receiving any updates. Marking the karmic task for this ticket as "Won't Fix".

Changed in update-manager (Ubuntu Karmic):
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints