update-manager crashes when locales are not working

Bug #471378 reported by Vilius
66
This bug affects 10 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Fix Released
Undecided
Unassigned
Karmic
Won't Fix
Undecided
Unassigned
Lucid
Fix Released
Undecided
Unassigned

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:0.126.6.1
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_US.UTF-8
 LC_TIME=”en_US_custom.UTF-8″
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: update-manager
Uname: Linux 2.6.31-14-generic i686

Revision history for this message
Vilius (vilius) wrote :
Revision history for this message
Vilius (vilius) wrote :

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

Revision history for this message
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
Revision history for this message
Vilius (vilius) wrote :

The patch works fine.
Thanks!

Michael Vogt (mvo)
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
Revision history for this message
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
Revision history for this message
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>
    sys.exit(main())
  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
    self.updateInterface()
  File "/tmp/tmppJyGdN/DistUpgradeViewGtk.py", line 299, in updateInterface
    InstallProgress.updateInterface(self)
  File "/usr/lib/python2.6/dist-packages/apt/progress/__init__.py", line 277, in updateInterface
    status_str.strip())
  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
----------------

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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