do-release-upgrade crashes if any directories exist in /etc/apt/sources.list.d

Bug #1077113 reported by hackel
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt-clone (Ubuntu)
Fix Released
Medium
Unassigned
ubuntu-release-upgrader (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

This has happened to me on two different machines now when attempting to upgrade from 12.04 to 12.10. I usually make a backup of my sources.list.d/*.list files in a subdirectory e.g. /etc/apt/sources.list.d/old. Every time I tried to do the release upgrade (from Software Updater) I got the message that "do-release-upgrade has closed unexpectedly" without any further information. I finally discovered the cause in /var/log/dist-upgrade/20121028-2325/main.log:

  File "/tmp/update-manager-qYs_K9/quantal", line 10, in <module> sys.exit(main())
  File "/tmp/update-manager-qYs_K9/DistUpgrade/DistUpgradeMain.py", line 237, in main save_system_state(logdir)
  File "/tmp/update-manager-qYs_K9/DistUpgrade/DistUpgradeMain.py", line 130, in save_system_state scrub_sources=True)
  File "/tmp/update-manager-qYs_K9/DistUpgrade/apt_clone.py", line 148, in save_state self._write_state_sources_list(tar, scrub_sources)
  File "/tmp/update-manager-qYs_K9/DistUpgrade/apt_clone.py", line 235, in _write_state_sources_list "./etc/apt/sources.list.d/"+source)
  File "/tmp/update-manager-qYs_K9/DistUpgrade/apt_clone.py", line 239, in _add_file_to_tar_with_password_check with tempfile.NamedTemporaryFile(mode='w') as source_copy, open(sources, 'r') as f:
IOError: [Errno 21] Is a directory: '/etc/apt/sources.list.d//old'

Moving /etc/apt/sources.list.d/old out of the way allowed the upgrade to proceed successfully. Like I said, I observed this same behaviour (and the solution) on two different machines. Should be an easy fix to check if those files are directories or not before trying to add them to the tar file.

Revision history for this message
Brian Murray (brian-murray) wrote :

This is actually a bug in apt-clone, which the release upgrader uses.

affects: ubuntu-release-upgrader (Ubuntu) → apt-clone (Ubuntu)
Changed in apt-clone (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-clone - 0.3.1~ubuntu3

---------------
apt-clone (0.3.1~ubuntu3) raring; urgency=low

  * Do not include subdirectories in /etc/apt/sources.list.d/ (LP: #1077113)
 -- Brian Murray <email address hidden> Fri, 25 Jan 2013 13:47:56 -0800

Changed in apt-clone (Ubuntu):
status: New → Fix Released
Revision history for this message
Gabriel de Perthuis (g2p) wrote :

Just fyi, I don't think the fix has been propagated correctly. I've just tried to start `do-release-upgrade -d` (precise → raring), and hit this issue.

Revision history for this message
Gabriel de Perthuis (g2p) wrote :

quantal → raring, sorry.

tags: added: precise precise2quantal
tags: added: dist-upgrade
no longer affects: ubuntu-release-upgrader
Revision history for this message
Brian Murray (brian-murray) wrote :

The release upgrader includes its own version of apt_clone.py and so the raring upgrader, used to upgrade from quantal to raring includes this fix.

If you download the release upgrader from here: http://archive.ubuntu.com/ubuntu/dists/raring/main/dist-upgrader-all/current/raring.tar.gz you can examine the tarball and the source for apt_clone.py to confirm this.

Having said that when you ran the release upgrade and updater version of apt_clone.py was not included in the upgrader, but it is now so I am setting this to Fix Released.

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