precise->quantal upgrade fails, with a UnicodeDecodeError

Bug #1031882 reported by Stefano Rivera on 2012-08-01
110
This bug affects 21 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
High
Colin Watson
Quantal
High
Colin Watson

Bug Description

The first time I tried to upgrade this machine to quantal:

$ update-manager -d
authenticate 'quantal.tar.gz' against 'quantal.tar.gz.gpg'
extracting 'quantal.tar.gz'
WARNING: Failed to read mirror file
WARNING: Failed to read mirror file
Traceback (most recent call last):
  File "/tmp/update-manager-sjmjAI/quantal", line 10, in <module>
    sys.exit(main())
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeMain.py", line 235, in main
    if app.run():
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeController.py", line 1736, in run
    return self.fullUpgrade()
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeController.py", line 1693, in fullUpgrade
    if not self.askDistUpgrade():
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeController.py", line 927, in askDistUpgrade
    if not self._checkFreeSpace():
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeController.py", line 904, in _checkFreeSpace
    required.dir))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeViewGtk3.py", line 475, in _handleException
    apport_crash(type, value, tb)
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeApport.py", line 47, in apport_crash
    _apport_append_logfiles(report)
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeApport.py", line 28, in _apport_append_logfiles
    report[f.replace(".","").replace("-","")] = (open(f), )
  File "/usr/lib/python2.7/dist-packages/problem_report.py", line 509, in __setitem__
    assert k.replace('.', '').replace('-', '').replace('_', '').isalnum()
AssertionError

Original exception was:
Traceback (most recent call last):
  File "/tmp/update-manager-sjmjAI/quantal", line 10, in <module>
    sys.exit(main())
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeMain.py", line 235, in main
    if app.run():
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeController.py", line 1736, in run
    return self.fullUpgrade()
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeController.py", line 1693, in fullUpgrade
    if not self.askDistUpgrade():
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeController.py", line 927, in askDistUpgrade
    if not self._checkFreeSpace():
  File "/tmp/update-manager-sjmjAI/DistUpgrade/DistUpgradeController.py", line 904, in _checkFreeSpace
    required.dir))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)

Then I freed some space and ran into a another variant:

$ update-manager -d
authenticate 'quantal.tar.gz' against 'quantal.tar.gz.gpg'
extracting 'quantal.tar.gz'
WARNING: Failed to read mirror file
WARNING: Failed to read mirror file
Traceback (most recent call last):
  File "/tmp/update-manager-K3_3vM/quantal", line 10, in <module>
    sys.exit(main())
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeMain.py", line 235, in main
    if app.run():
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeController.py", line 1736, in run
    return self.fullUpgrade()
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeController.py", line 1693, in fullUpgrade
    if not self.askDistUpgrade():
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeController.py", line 945, in askDistUpgrade
    self.cache.required_download)
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeViewGtk3.py", line 625, in confirmChanges
    demotions, downloadSize):
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeView.py", line 374, in confirmChanges
    apt_pkg.size_to_str(downloadSize)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeViewGtk3.py", line 475, in _handleException
    apport_crash(type, value, tb)
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeApport.py", line 47, in apport_crash
    _apport_append_logfiles(report)
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeApport.py", line 28, in _apport_append_logfiles
    report[f.replace(".","").replace("-","")] = (open(f), )
  File "/usr/lib/python2.7/dist-packages/problem_report.py", line 509, in __setitem__
    assert k.replace('.', '').replace('-', '').replace('_', '').isalnum()
AssertionError

Original exception was:
Traceback (most recent call last):
  File "/tmp/update-manager-K3_3vM/quantal", line 10, in <module>
    sys.exit(main())
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeMain.py", line 235, in main
    if app.run():
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeController.py", line 1736, in run
    return self.fullUpgrade()
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeController.py", line 1693, in fullUpgrade
    if not self.askDistUpgrade():
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeController.py", line 945, in askDistUpgrade
    self.cache.required_download)
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeViewGtk3.py", line 625, in confirmChanges
    demotions, downloadSize):
  File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeView.py", line 374, in confirmChanges
    apt_pkg.size_to_str(downloadSize)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)

It gets passed this with LC_ALL=C.UTF-8 in the environment

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: update-manager 1:0.156.14
ProcVersionSignature: Ubuntu 3.2.0-23.36-generic 3.2.14
Uname: Linux 3.2.0-23-generic x86_64
ApportVersion: 2.0.1-0ubuntu5
Architecture: amd64
Date: Wed Aug 1 20:50:53 2012
GsettingsChanges:
 com.ubuntu.update-manager first-run false
 com.ubuntu.update-manager launch-time 1343846955
 com.ubuntu.update-manager show-details true
 com.ubuntu.update-manager window-height 500
 com.ubuntu.update-manager window-width 600
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_ZA:en
 TERM=xterm
 PATH=(custom, user)
 LANG=en_ZA.UTF-8
 SHELL=/bin/bash
SourcePackage: update-manager
UpgradeStatus: Upgraded to precise on 2012-08-01 (0 days ago)
VarLogDistupgradeTermlog:

Stefano Rivera (stefanor) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in update-manager (Ubuntu):
status: New → Confirmed
Antti Kaijanmäki (kaijanmaki) wrote :

This could be a duplicate of bug #1039484

Stefano Rivera (stefanor) wrote :

No special characters in my sources.list

Graham Inggs (ginggs) wrote :

> File "/tmp/update-manager-K3_3vM/DistUpgrade/DistUpgradeView.py", line 374, in confirmChanges
> apt_pkg.size_to_str(downloadSize)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)

I ran into precisely the same problem as in your second case after running 'sudo upgrade-manager -d'.
I then tried 'sudo do-release-upgrade -d' and the upgrade was successful.

Stefano Rivera (stefanor) wrote :

I've tried to reproduce it unsuccessfully. Haven't tried to understand the code path, and what could be causing it, though.

Stefano Rivera (stefanor) wrote :

(But two south africans hitting it makes me wonder if it's somehow related to an en_ZA locale)

Michael Vogt (mvo) on 2012-09-25
Changed in update-manager (Ubuntu Quantal):
importance: Undecided → High
Michael Vogt (mvo) wrote :

apt_pkg.size_to_str() returns a string *and* that contains a "c2a0" type unicode string: non-break space

but its returend as a "str" not as "unicode".

Colin Watson (cjwatson) on 2012-09-26
affects: update-manager (Ubuntu Quantal) → ubuntu-release-upgrader (Ubuntu Quantal)
Colin Watson (cjwatson) on 2012-09-30
Changed in ubuntu-release-upgrader (Ubuntu Quantal):
status: Confirmed → Triaged
assignee: nobody → Colin Watson (cjwatson)
milestone: none → ubuntu-12.10
Colin Watson (cjwatson) on 2012-09-30
Changed in ubuntu-release-upgrader (Ubuntu Quantal):
status: Triaged → In Progress
Pauli Virtanen (pauli-virtanen) wrote :

Ran into the same issue on "fi_FI.UTF-8" locale. Unsetting LC_*, LANG* environment variables and setting LC_ALL=C got rid of the error.

Colin Watson (cjwatson) on 2012-10-02
Changed in ubuntu-release-upgrader (Ubuntu Quantal):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:0.184

---------------
ubuntu-release-upgrader (1:0.184) quantal; urgency=low

  * Decode the output of apt_pkg.size_to_str() if necessary when
    substituting it into Unicode strings (LP: #1031882).
  * Ship /usr/share/keyrings/ubuntu-archive-keyring.gpg as
    utils/apt/trusted.gpg (although that's only for tests anyway), rather
    than whatever happens to be in /etc/apt/trusted.gpg on the system used
    to build the source package.
 -- Colin Watson <email address hidden> Tue, 02 Oct 2012 16:09:02 +0100

Changed in ubuntu-release-upgrader (Ubuntu Quantal):
status: Fix Committed → Fix Released
Graham Inggs (ginggs) wrote :

'sudo upgrade-manager -d' now works on another machine that had this same problem last week. Thanks!

molostoff (molostoff) wrote :

I have got the same issue in Ubuntu 12.04.2 LTS.

Also I can not understand why This bug was fixed in the package ubuntu-release-upgrader - 1:0.184

---------------
ubuntu-release-upgrader (1:0.184) *quantal*; urgency=low

while it hits precise? how I can upgrade from my 12.04.2 for now?

 why not to supply fix for precise?

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

Duplicates of this bug

Other bug subscribers