Xenial Release upgrader failed with a permission error setting cron.daily/apt

Bug #1611470 reported by MissionSix on 2016-08-09
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Brian Murray

Bug Description

Trying to run `$ sudo do-release-upgrade` fails with a permission error:

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-0as70maz/xenial", line 8, in <module>
  File "/tmp/ubuntu-release-upgrader-0as70maz/DistUpgrade/DistUpgradeMain.py", line 242, in main
  File "/tmp/ubuntu-release-upgrader-0as70maz/DistUpgrade/DistUpgradeController.py", line 1876, in run
  File "/tmp/ubuntu-release-upgrader-0as70maz/DistUpgrade/DistUpgradeController.py", line 1841, in fullUpgrade
  File "/tmp/ubuntu-release-upgrader-0as70maz/DistUpgrade/DistUpgradeController.py", line 1257, in doDistUpgrade
UnboundLocalError: local variable 'e' referenced before assignment
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-0as70maz/DistUpgrade/DistUpgradeController.py", line 1062, in _enableAptCronJob
PermissionError: [Errno 1] Operation not permitted: '/etc/cron.daily/apt'

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ubuntu-release-upgrader-core 1:0.220.8
ProcVersionSignature: Ubuntu 3.13.0-92.139-generic 3.13.11-ckt39
Uname: Linux 3.13.0-92-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3.21
Architecture: amd64
CrashDB: ubuntu
CurrentDesktop: GNOME
Date: Tue Aug 9 11:24:21 2016
InstallationDate: Installed on 2012-08-31 (1439 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: dist-upgrade
UpgradeStatus: Upgraded to trusty on 2016-08-09 (0 days ago)

Related branches

MissionSix (missionsix) wrote :
MissionSix (missionsix) wrote :

RE: UnboundLocalError: local variable 'e' referenced before assignment

xenial: DistUpgradeControll.py:1257


        # maximum fetch-retries reached without a successful commit
        logging.error("giving up on fetching after maximum retries")
        self._view.error(_("Could not download the upgrades"),
                         _("The upgrade has aborted. Please check your "\
                           "Internet connection or "\
                           "installation media and try again. "),
                           "%s" % e)

This error message is outside of the exception scope, and within the retry loop. So the `e` here is unbounded.

MissionSix (missionsix) wrote :

This change gets me past the error and to the upgrade UI prompt.

The attachment "DistUpgradeController.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Brian Murray (brian-murray) wrote :

Thanks for working on this. I've added the fix to trunk.

Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Triaged
tags: added: trusty2xenial
Launchpad Janitor (janitor) wrote :

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

ubuntu-release-upgrader (1:16.10.4) yakkety; urgency=medium

  [ Brian Murray ]
  * DistUpgradeController.py: fix UnboundLocalError - thanks to Launchpad user
    MissionSix for the patch. (LP: #1611470)
  * po/POTFILES.in: use check_new_release_gtk.py to allow for fuzzy

  [ Dimitri John Ledkov ]
  * Mirgrate to using apt-key, instead of gpg/gpgv directly to gain
    support for apt-secure trustedparts (key fragments in
    /etc/apt/trusted.gpg.d). (LP: #1628415)

 -- Brian Murray <email address hidden> Mon, 03 Oct 2016 16:09:42 -0700

Changed in ubuntu-release-upgrader (Ubuntu):
status: Triaged → Fix Released

I am affected by the same issue. How can I have the correction in trusty?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers