27
7
I'm currently trying to upgrade a ubuntu 14.04 box to xenial. I'm trying to do do release update, and its failing with errors like UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 382: invalid start byte
It looks like a known bug - I've tried that and had no luck finding the offending package, and disabled/removed my 2 non standard package.lst files for nodesource and veeam repositories.
The traceback reads something like this
Traceback (most recent call last):
File "/tmp/ubuntu-release-upgrader-woadaq_z/xenial", line 8, in <module>
sys.exit(main())
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeMain.py", line 242, in main
if app.run():
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeController.py", line 1876, in run
return self.fullUpgrade()
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeController.py", line 1757, in fullUpgrade
if not self.doPostInitialUpdate():
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeController.py", line 943, in doPostInitialUpdate
self.tasks = self.cache.installedTasks
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeCache.py", line 806, in installedTasks
for line in pkg._pcache._records.record.split("\n"):
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 382: invalid start byte
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/problem_report.py", line 416, in add_to_existing
self.write(f)
File "/usr/lib/python3/dist-packages/problem_report.py", line 369, in write
block = f.read(1048576)
File "/usr/lib/python3.4/codecs.py", line 319, 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-woadaq_z/xenial", line 8, in <module>
sys.exit(main())
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeMain.py", line 242, in main
if app.run():
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeController.py", line 1876, in run
return self.fullUpgrade()
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeController.py", line 1757, in fullUpgrade
if not self.doPostInitialUpdate():
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeController.py", line 943, in doPostInitialUpdate
self.tasks = self.cache.installedTasks
File "/tmp/ubuntu-release-upgrader-woadaq_z/DistUpgrade/DistUpgradeCache.py", line 806, in installedTasks
for line in pkg._pcache._records.record.split("\n"):
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 382: invalid start byte
=== Command terminated with exit status 1 (Mon Apr 3 09:31:21 2017) ===
And there's nothing really helpful in the logs. How would I get do-release update to work?
7This is a very nice, very gentle intro to gdb, which can be used with different levels of proficiency by just about any user. +1 from me, and kudos. And, BTW, you may just add that typing pkg in the debugger will print the value of the variable of the same name, as defined on line 803. In other words, pkg is not a debugger instruction. Cheers. – MariusMatutiae – 2017-04-03T08:14:34.250
@MariusMatutiae Edited. And it's pdb ;) (This was actually intended more to be specific to solving this class of problems, but it's nice that you find it easy to follow as a general intro.) – Bob – 2017-04-03T08:59:19.403
To resolve this problem in particular, wouldn't it be easier to just add a line to the script that prints whatever that debug message wants to print for a package record that doesnt exist? (Theres that logging.debug message right above)
Or does this assume the pkg variable might not be able to be printed at all due to the bug, and python debugger can print anything at all? – CausingUnderflowsEverywhere – 2017-04-03T16:37:15.083
If we still have the Super User blog, this would be an excellent addition to it! – Canadian Luke – 2017-04-03T17:00:36.003
@CausingUnderflowsEverywhere In theory, yes. In practice, a similar suggestion from the linked bug report apparently didn't work (I'm not sure why, just from what OP told me) and I ended up doing it interactively in case something else triggered the crash - e.g. didn't know that in this case it was the
record
property itself that could not be read. – Bob – 2017-04-04T07:34:57.067