Upgrade to yakkety fails due to non-us locale

Bug #1633219 reported by Vsevolod Velichko
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Confirmed
Undecided
Unassigned
ubuntu-release-upgrader (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Upgrade to yakkety failed during updates installation. The do-release-upgrade window froze and there was a stacktrace in the terminal:

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/yakkety", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeMain.py", line 242, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeController.py", line 1880, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeController.py", line 1845, in fullUpgrade
    if not self.doDistUpgrade():
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeController.py", line 1183, in doDistUpgrade
    res = self.cache.commit(fprogress,iprogress)
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeCache.py", line 267, in commit
    apt.Cache.commit(self, fprogress, iprogress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 515, in commit
    res = self.install_archives(pm, install_progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 479, in install_archives
    res = install_progress.run(pm)
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeView.py", line 234, in run
    res = os.WEXITSTATUS(self.wait_child())
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeViewGtk3.py", line 339, in wait_child
    self.update_interface()
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeViewGtk3.py", line 346, in update_interface
    InstallProgress.update_interface(self)
  File "/usr/lib/python3/dist-packages/apt/progress/base.py", line 255, in update_interface
    if float(percent) != self.percent or status_str != self.status:
ValueError: could not convert string to float: '0,0000'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/problem_report.py", line 497, in add_to_existing
    self.write(f)
  File "/usr/lib/python3/dist-packages/problem_report.py", line 450, in write
    block = f.read(1048576)
  File "/usr/lib/python3.5/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Original exception was:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/yakkety", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeMain.py", line 242, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeController.py", line 1880, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeController.py", line 1845, in fullUpgrade
    if not self.doDistUpgrade():
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeController.py", line 1183, in doDistUpgrade
    res = self.cache.commit(fprogress,iprogress)
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeCache.py", line 267, in commit
    apt.Cache.commit(self, fprogress, iprogress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 515, in commit
    res = self.install_archives(pm, install_progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 479, in install_archives
    res = install_progress.run(pm)
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeView.py", line 234, in run
    res = os.WEXITSTATUS(self.wait_child())
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeViewGtk3.py", line 339, in wait_child
    self.update_interface()
  File "/tmp/ubuntu-release-upgrader-tqyb12c_/DistUpgrade/DistUpgradeViewGtk3.py", line 346, in update_interface
    InstallProgress.update_interface(self)
  File "/usr/lib/python3/dist-packages/apt/progress/base.py", line 255, in update_interface
    if float(percent) != self.percent or status_str != self.status:
ValueError: could not convert string to float: '0,0000'

It seems, that it's because release-upgrader incorrectly works with locale: Russian locale uses "," as a floating point separator, rather than ".", so it generates the "0,0000" somewhere and cannot parse it afterwards.

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: ubuntu-release-upgrader-core 1:16.04.17
ProcVersionSignature: Ubuntu 4.4.0-43.63-generic 4.4.21
Uname: Linux 4.4.0-43-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CrashDB: ubuntu
CurrentDesktop: Unity
Date: Thu Oct 13 23:54:25 2016
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: release-upgrade
UpgradeStatus: Upgraded to yakkety on 2016-10-13 (0 days ago)
VarLogDistupgradeTermlog:

modified.conffile..etc.update-manager.release-upgrades: [modified]
mtime.conffile..etc.update-manager.release-upgrades: 2016-10-13T22:47:25.822710

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

I'm not convinced that this is specific to ubuntu-release-upgrader if we look at bug 1592817 we can see the same crash occurring in python-apt with gdebi.

Revision history for this message
Vsevolod Velichko (torkvemada) wrote :

May be you are right, I don't know where this "0,0000" comes from.
But I'm not sure, may be it's ubuntu-release-upgrader and gdebi (since they are end-user binaries, rather than python-apt) who should set correct LC_NUMERIC.

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

As one test I changed the Regional Format to "English (Denmark)" so that numbers are 1.234.567,89 and then upgraded to yakkety using DistUpgradeViewGtk3. I did not encounter a crash.

bdmurray@clean-xenial-amd64:~$ env | grep LC_
LC_PAPER=en_DK.UTF-8
LC_ADDRESS=en_DK.UTF-8
LC_MONETARY=en_DK.UTF-8
LC_NUMERIC=en_DK.UTF-8
LC_TELEPHONE=en_DK.UTF-8
LC_IDENTIFICATION=en_DK.UTF-8
LC_MEASUREMENT=en_DK.UTF-8
LC_CTYPE=en_US.UTF-8
LC_TIME=en_DK.UTF-8
LC_NAME=en_DK.UTF-8

Revision history for this message
Vsevolod Velichko (torkvemada) wrote :

Was it system-wide change (and reboot is done)? It may be needed if python-apt gets something from outside (e.g. by dbus).
I have no idea, I used update-manager to start the upgrade process and my env:
torkve@yaroot-46:/tmp [2016-10-14 02:01:18]
0 ➜ locale
LANG=ru_RU.UTF-8
LANGUAGE=ru:en
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY=ru_RU.UTF-8
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LC_ALL=

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

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

Changed in python-apt (Ubuntu):
status: New → Confirmed
Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Confirmed
Revision history for this message
QkiZ (qkiz) wrote :

For me do-release-upgrade crashed right after download packages needed to system upgrade. But after that I was able to continue upgrade started by sudo apt upgrade. Now Ubuntu 16.10 is booting and working, but people that don't have knowledge may be frustrated.

LANG=pl_PL.UTF-8
LANGUAGE=pl:en
LC_CTYPE="pl_PL.UTF-8"
LC_NUMERIC=pl_PL.UTF-8
LC_TIME=pl_PL.UTF-8
LC_COLLATE="pl_PL.UTF-8"
LC_MONETARY=pl_PL.UTF-8
LC_MESSAGES="pl_PL.UTF-8"
LC_PAPER=pl_PL.UTF-8
LC_NAME=pl_PL.UTF-8
LC_ADDRESS=pl_PL.UTF-8
LC_TELEPHONE=pl_PL.UTF-8
LC_MEASUREMENT=pl_PL.UTF-8
LC_IDENTIFICATION=pl_PL.UTF-8
LC_ALL=

Revision history for this message
VPablo (villumar) wrote :

Please, correct this bug. With Spanish format it hangs as described but changing the numbers, date and so on to English (EEUU) it works perfect.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Marking this as a duplicate of bug 1592817. This is an APT bug to be fixed in the upcoming 1.2.16, which is hopefully passing CI soon.

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.