UnboundLocalError: local variable 'e' referenced before assignment in doUpdate, line 924

Bug #1347834 reported by bp
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Here's the message I got:

File
"/tmp/user/0/ubuntu-release-upgrader-y0kam4fv/DistUpgrade/DistUpgradeController.py",
line 1822, in run
return self.fullUpgrade()

File
"/tmp/user/0/ubuntu-release-upgrader-y0kam4fv/DistUpgrade/DistUpgradeController.py",
line 1724, in fullUpgrade
if not self.doUpdate():

File
"/tmp/user/0/ubuntu-release-upgrader-y0kam4fv/DistUpgrade/DistUpgradeController.py",
line 924, in doUpdate
if not e:

UnboundLocalError: local variable 'e' referenced before assignment
=== Command detached from window (Wed Jul 23 19:26:09 2014) ===
=== Command terminated with exit status 1 (Wed Jul 23 19:26:19 2014) ===

The problem persists also if I upgrade ubuntu-release-upgrader-core to the Utopic version of the software. This was easy to try as do-release-upgrade failed to restore my sources.list file to its previous state as it crashed and burned.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ubuntu-release-upgrader-core 1:0.220.2
ProcVersionSignature: Ubuntu 3.13.0-30.55-generic 3.13.11.2
Uname: Linux 3.13.0-30-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
CrashDB: ubuntu
CurrentDesktop: Unity
Date: Wed Jul 23 19:28:51 2014
InstallationDate: Installed on 2014-05-09 (74 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
UpgradeStatus: Upgraded to trusty on 2014-07-23 (0 days ago)
VarLogDistupgradeAptlog:
 Log time: 2014-07-23 19:24:30.630772
 Log time: 2014-07-23 19:24:50.648009

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

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

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Confirmed
Revision history for this message
Max Bowsher (maxb) wrote :

This appears to be a coding error. If you look at the file and line referenced, you see the local variable 'e' being referenced, but it is not in scope there.

It looks like the code is expecting the captured exception variable from a previously exited 'except' block to still be in scope after the block completes. It isn't.

Revision history for this message
Max Bowsher (maxb) wrote :

Further note on reproducability:

The bug is only directly visible if the previous loop attempting multiple retries to update the APT cache fails on all attempts.

One way to make this happen is to have a third party PPA in sources.list which doesn't have anything published for utopic, and have [Sources] AllowThirdParty=yes set, such that the APT update fails with a 404.

Revision history for this message
Michael Vogt (mvo) wrote :

I just uploaded a fix into utopic for this.

Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → Medium
importance: Medium → High
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
ubuntu-release-upgrader (1:14.10.9) utopic; urgency=low

  * DistUpgrade/DistUpgradeController.py:
    - fix crash when one of the sources.list entries gives a network
      error (LP: #1347834)
 -- Michael Vogt <email address hidden> Mon, 20 Oct 2014 10:12:27 -0400

Changed in ubuntu-release-upgrader (Ubuntu):
status: In Progress → Fix Released
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.