Upgrading to Saucy crashes with a unicode error

Bug #1212025 reported by Yotam Benshalom
64
This bug affects 15 people
Affects Status Importance Assigned to Milestone
apt-clone (Ubuntu)
Fix Released
Undecided
Unassigned
ubuntu-release-upgrader (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Trying to upgrade from 13.04 to 13.10 I experience this, then update-manager quits:

yotam@aku:~$ sudo update-manager -d
[sudo] password for yotam:
מתבצעת בדיקה להימצאות גרסה חדשה של אובונטו
אימות 'saucy.tar.gz' כנגד 'saucy.tar.gz.gpg'
'saucy.tar.gz' מחולץ
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-3jxib8/saucy", line 10, in <module> sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-3jxib8/DistUpgrade/DistUpgradeMain.py", line 240, in main save_system_state(logdir)
  File "/tmp/ubuntu-release-upgrader-3jxib8/DistUpgrade/DistUpgradeMain.py", line 133, in save_system_state scrub_sources=True)
  File "/tmp/ubuntu-release-upgrader-3jxib8/DistUpgrade/apt_clone.py", line 149, in save_state self._write_state_sources_list(tar, scrub_sources)
  File "/tmp/ubuntu-release-upgrader-3jxib8/DistUpgrade/apt_clone.py", line 241, in _write_state_sources_list "./etc/apt/sources.list.d/"+source)
  File "/tmp/ubuntu-release-upgrader-3jxib8/DistUpgrade/apt_clone.py", line 252, in _add_file_to_tar_with_password_check source_copy.write(line)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 68-71: ordinal not in range(128)

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: update-manager 1:0.186.1
ProcVersionSignature: Ubuntu 3.8.0-28.41-generic 3.8.13.5
Uname: Linux 3.8.0-28-generic x86_64
NonfreeKernelModules: wl nvidia
ApportVersion: 2.9.2-0ubuntu8.3
Architecture: amd64
Date: Wed Aug 14 02:24:29 2013
GsettingsChanges:
 b'com.ubuntu.update-manager' b'first-run' b'false'
 b'com.ubuntu.update-manager' b'launch-time' b'1376436121'
 b'com.ubuntu.update-manager' b'show-details' b'true'
 b'com.ubuntu.update-manager' b'window-height' b'590'
 b'com.ubuntu.update-manager' b'window-width' b'555'
InstallationDate: Installed on 2010-05-19 (1182 days ago)
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha amd64 (20100224.1)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: update-manager
UpgradeStatus: Upgraded to raring on 2013-08-13 (0 days ago)

Revision history for this message
Yotam Benshalom (benshalom) wrote :
summary: - Upgrading to Saucy crashes in Hebrew locale with a unicode error
+ Upgrading to Saucy crashes with a unicode error
Revision history for this message
Yotam Benshalom (benshalom) wrote :

I checked it with user and system-wide language set to English and the crash still occurs.

description: updated
Revision history for this message
Yotam Benshalom (benshalom) wrote :

The crash still occurs after deleting all the files in /etc/apt/sources.list.d/ and restarting.
I guess that somehow, one of the automatic system tools inserted a translated Hebrew string somewhere and the current upgrader can't handle it.

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

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

Changed in update-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Márcio Carneiro (marciocr) wrote :

I was with the same error, the only diference it that my locale it is portuguese. But I managed to fix by removing old files from /etc/apt (remains from upgrades from old versions).

Revision history for this message
Yotam Benshalom (benshalom) wrote :

Thank you, I finally made this workaround work too; I had to delete the hidden files in /etc/apt/sources.list.d/ too.
Still, I hope this problem grabs someone's attention.

Revision history for this message
Loris Zinsou (nepenthes) wrote :

This bug affects me too. French locale.

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

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

Changed in apt-clone (Ubuntu):
status: New → Confirmed
affects: update-manager (Ubuntu) → ubuntu-release-upgrader (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-clone - 0.3.1~ubuntu6

---------------
apt-clone (0.3.1~ubuntu6) saucy; urgency=low

  * Properly handle unicode when rewriting source files, thanks to Colin
    Watson for the patch. (LP: #1212025)
 -- Brian Murray <email address hidden> Fri, 06 Sep 2013 14:50:16 -0700

Changed in apt-clone (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Loïc Grobol (loic-grobol) wrote :

It still has to be backported to Raring, having it fixed in Saucy won't help those who are stuck in Raring because of this bug.

Revision history for this message
Brian Murray (brian-murray) wrote :

Release upgrades work by downloading a tarball of ubuntu-release-upgrader for the release that you are upgrading to and the code affected here (apt-clone) is included in that tarbarll, so it does not need to be fixed in Raring. apt-clone in the release upgrader has been updated so this should just work now.

Changed in ubuntu-release-upgrader (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

This bug is not a duplicate of bug 1001335 which contains a traceback about a UnicodeDecodeError in check-new-release, whereas this traceback is about apt-clone.

Revision history for this message
Mike Carifio (carifio) wrote :

At @Murray's suggestion, I closed 1241541 as a dup of this bug. I'm hoping this one will be reopened and addressed. I can't upgrade my Lenovo X1 carbon laptop raring -> saucy. Thanks.

Revision history for this message
Mike Carifio (carifio) wrote :

Still not fixed.

➜ /home/mcarifio% sudo do-release-upgrade
Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

Get:1 Upgrade tool signature [198 B]
Get:2 Upgrade tool [1,142 kB]
Fetched 1,142 kB in 0s (0 B/s)
authenticate 'saucy.tar.gz' against 'saucy.tar.gz.gpg'
extracting 'saucy.tar.gz'

Reading cache

A fatal error occurred

Please report this as a bug and include the files
/var/log/dist-upgrade/main.log and /var/log/dist-upgrade/apt.log in
your report. The upgrade has aborted.
Your original sources.list was saved in
/etc/apt/sources.list.distUpgrade.

Traceback (most recent call last):

File "/tmp/ubuntu-release-upgrader-02kpob/saucy", line 10, in
<module>
sys.exit(main())

File
"/tmp/ubuntu-release-upgrader-02kpob/DistUpgrade/DistUpgradeMain.py",
line 240, in main
save_system_state(logdir)

File
"/tmp/ubuntu-release-upgrader-02kpob/DistUpgrade/DistUpgradeMain.py",
line 133, in save_system_state
scrub_sources=True)

File "/tmp/ubuntu-release-upgrader-02kpob/DistUpgrade/apt_clone.py",
line 149, in save_state
self._write_state_sources_list(tar, scrub_sources)

File "/tmp/ubuntu-release-upgrader-02kpob/DistUpgrade/apt_clone.py",
line 241, in _write_state_sources_list
"./etc/apt/sources.list.d/"+source)

File "/tmp/ubuntu-release-upgrader-02kpob/DistUpgrade/apt_clone.py",
line 246, in _add_file_to_tar_with_password_check
for line in f.readlines():

File "/usr/lib/python2.7/codecs.py", line 296, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)

UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position
1: invalid start byte

Revision history for this message
Mike Carifio (carifio) wrote :

sudo mv /etc/apt/sources.list.d{,-aside}
sudo do-release-upgrade # avoids this error

ty

Revision history for this message
hawkerb (hawk) wrote :

In my case this crash was caused by having vim undo files (.something.list.~un) in /etc/apt/sources.list.d, which are binary. Looks like far too many files are being read in process

Revision history for this message
Brian Murray (brian-murray) wrote :

hawkerb - vim undo files are bug 1254447.

Revision history for this message
Brian Murray (brian-murray) wrote :

Comment #14 is being addressed in bug 1309447.

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.