do-release-upgrade fails when using update-alternatives to provide different versions of /usr/bin/python

Bug #1241465 reported by Daniel Ricao Canelhas
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

sudo do-release-upgrade

fails to upgrade 13.04 to 13.10 when update-alternatives is used to maintain different versions of python

e.g.
sudo update-alternatives --list python
/usr/bin/python2.7
/usr/bin/python3.3

The script complains that the symlink to /usr/bin/python is broken regardless of which version is being used to provide python

a workaround is to remove the symbolic link

`sudo rm /usr/bin/python`

and creating it manually

`sudo rm /usr/bin/python`
`sudo ln -s /usr/bin/python2.7 /usr/bin/python`
`sudo do-release-upgrade`

Apparently using version 3.3 didn't work too well either.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: ubuntu-release-upgrader-core 1:0.205
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
ApportVersion: 2.12.5-0ubuntu2
Architecture: amd64
CrashDB: ubuntu
Date: Fri Oct 18 11:42:03 2013
MarkForUpload: True
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: release-upgrade
UpgradeStatus: Upgraded to saucy on 2013-10-18 (0 days ago)

Revision history for this message
Daniel Ricao Canelhas (daniel-canelhas) wrote :
Revision history for this message
Daniel Ricao Canelhas (daniel-canelhas) wrote :

Found a log with the actual error

Revision history for this message
Daniel Ricao Canelhas (daniel-canelhas) wrote :

I'm guessing the solution in general should be to check if the symbolic link points to a file or to a symbolic link and keep following the links until a file is reached (unless the symlinks point around in a circle somehow)

ls /etc/alternatives
...
lrwxrwxrwx 1 root root 62 Jul 5 22:25 policytool.1.gz -> /usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/policytool.1.gz
lrwxrwxrwx 1 root root 18 Oct 18 11:39 python -> /usr/bin/python2.7
lrwxrwxrwx 1 root root 12 Jul 5 17:02 rcp -> /usr/bin/scp
...

Revision history for this message
Daniel Ricao Canelhas (daniel-canelhas) wrote :

so, in /DistUpgrade/DistUpgradeController.py

after line 381, inserting something like this would possibly patch this bug:

                while os.path.islink(fs_default_version) :
                    fs_default_version = os.readlink(fs_default_version)

It would be an endless loop if links are circular though. Adding a counter for a maximum depth is one way out...
Another would be to add the visited links to a list and checking it to see if the current link is already in the list. If so. break and return an error of some sort. But it would be a very unusual configuration to find.

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
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.