Cannot upgrade to 15.10 using alternate AMD64 ISO

Bug #1551929 reported by Steven Chan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Fix Released
Medium
Brian Murray
Wily
Invalid
Medium
Unassigned

Bug Description

# lsb_release -rd
Description: Ubuntu 15.10
Release: 15.10

# apt-cache policy python3-distupgrade
python3-distupgrade:
  Installed: 1:15.10.14.4
  Candidate: 1:15.10.14.4
  Version table:
 *** 1:15.10.14.4 0
        500 http://ca.archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:15.10.13 0
        500 http://ca.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages

I am a Lubuntu AMD64 user. I was on Lubuntu 14.10 and needed to upgrade. After successfully upgrading to vivid/15.04, I then tried to upgrade to wily/15.10. In both cases, I used the alternate ISO.

First, I downloaded the ISO file and mounted it to my local file system:

# sudo mount -o loop ~/Desktop/x220/lubuntu-15.10-alternate-amd64.iso /mnt

Second, I executed the upgrade script and chose the 'no network' option:

# sudo /mnt/cdromupgrade

But it failed early in the sequence of events. The relevant part of the /var/log/dist-upgrade/main.log file showed the following:

2016-02-28 12:19:17,788 ERROR not handled exception:
Traceback (most recent call last):

  File "/tmp/tmp.vQLpNb1AlJ/wily", line 8, in <module>
    sys.exit(main())

  File "/tmp/tmp.vQLpNb1AlJ/DistUpgrade/DistUpgradeMain.py", line 240, in main
    if app.run():

  File "/tmp/tmp.vQLpNb1AlJ/DistUpgrade/DistUpgradeController.py", line 1837, in run
    return self.fullUpgrade()

  File "/tmp/tmp.vQLpNb1AlJ/DistUpgrade/DistUpgradeController.py", line 1729, in fullUpgrade
    not self.aptcdrom.add(self.sources_backup_ext)):

  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeAptCdrom.py", line 306, in add
    res = self._doAdd()

  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeAptCdrom.py", line 264, in _doAdd
    if self._verifyRelease(self.signatures):

  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeAptCdrom.py", line 227, in _verifyRelease
    sum = apt_pkg.sha256sum(open(fp))

TypeError: invalid file: <_io.TextIOWrapper name='/mnt/dists/wily/restricted/debian-installer/binary-amd64/Packages.gz' mode='r' encoding='UTF-8'>

After some detective work, I was able to upgrade to wily by removing the 'open' call in line 227:

    sum = apt_pkg.sha256sum(fp)

An important step in the detective work was to inspect the changes to the DistUpgradeAptCdrom.py file
(http://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu-release-upgrader/trunk/revision/2859#tests/test_sources_list.py).
There, we can see that the line:

sum = apt_pkg.sha256sum(open(f))

was changed to:

with open(f) as fp:
    sum = apt_pkg.sha256sum(open(fp))

The end result is that a call to open() was changed to use a with/as statement, as part of a substantial commit to improve the robustness of the code. But for this line, it introduced two open calls instead of just one, and that is clearly wrong, as the first open call will return a File object, and the second will try to open the consequent File object, which will result in a Type error.

Revision 2859 was done about a year ago, and refers to LP #1409555, which seems to indicate that the fix was added in 15.04. It explains why I was able to upgrade to 15.04 but not to 15.10.

Tags: wily xenial

Related branches

Revision history for this message
Steven Chan (schan2) wrote :
summary: - Cannot upgrade to 15.10 using alternate AMD64 CD
+ Cannot upgrade to 15.10 using alternate AMD64 ISO
Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for the investigative work! I'll get this fixed shortly.

tags: added: wily xenial
Changed in ubuntu-release-upgrader (Ubuntu Wily):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
ubuntu-release-upgrader (1:16.04.8) xenial; urgency=medium

  * data/release-upgrades:
    - set the default upgrade prompt to "lts" instead of "normal" so that
      LTS users will only see the automatic upgrade prompt when the next LTS
      version is ready. (LP: #1550927)
  * update demoted.cfg, demoted.cfg.trusty, mirrors.cfg
  * DistUpgrade/DistUpgradeAptCdrom.py: fix double open. (LP: #1551929)

 -- Brian Murray <email address hidden> Thu, 03 Mar 2016 11:36:41 -0800

Changed in ubuntu-release-upgrader (Ubuntu):
status: Triaged → Fix Released
dino99 (9d9)
Changed in ubuntu-release-upgrader (Ubuntu Wily):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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