"Reinstall Ubuntu" failed - apt-clone crashes with: KeyError: "filename './etc/apt/sources.list' not found" line 1886 in getmember in tarfile.py

Bug #1066347 reported by Jean-Baptiste Lallement
98
This bug affects 15 people
Affects Status Importance Assigned to Milestone
apt-clone (Ubuntu)
Fix Released
Critical
Unassigned
Precise
Fix Released
High
Unassigned
Quantal
Fix Released
Critical
Unassigned

Bug Description

Quantal Desktop 20121012.3

TEST CASE:
1. Install Ubuntu 12.10 or 12.04.1 once
2. Install it a second time and in the partitioning step select "Reinstall Ubuntu 12.10"
3. Proceed with installation

ACTUAL RESULT:
Installation ends with an error dialog "Error restoring installation applications"

From syslog
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity mount --bind /run /target/run
Oct 13 16:42:42 ubuntu ubiquity: Traceback (most recent call last):
Oct 13 16:42:42 ubuntu ubiquity: File "/usr/bin/apt-clone", line 119, in <module>
Oct 13 16:42:42 ubuntu ubiquity: args.source, args.destination, args.new_distro_codename, protect_installed)
Oct 13 16:42:42 ubuntu ubiquity: File "/usr/lib/python3/dist-packages/apt_clone.py", line 343, in restore_state
Oct 13 16:42:42 ubuntu ubiquity: self._restore_sources_list(statefile, targetdir)
Oct 13 16:42:42 ubuntu ubiquity: File "/usr/lib/python3/dist-packages/apt_clone.py", line 387, in _restore_sources_list
Oct 13 16:42:42 ubuntu ubiquity: tar.extract(self.TARPREFIX+"etc/apt/sources.list", targetdir)
Oct 13 16:42:42 ubuntu ubiquity: File "/usr/lib/python3.2/tarfile.py", line 2168, in extract
Oct 13 16:42:42 ubuntu ubiquity: tarinfo = self.getmember(member)
Oct 13 16:42:42 ubuntu ubiquity: File "/usr/lib/python3.2/tarfile.py", line 1886, in getmember
Oct 13 16:42:42 ubuntu ubiquity: raise KeyError("filename %r not found" % name)
Oct 13 16:42:42 ubuntu ubiquity: KeyError: "filename './etc/apt/sources.list' not found"
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity chroot /target umount /sys
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity chroot /target umount /proc
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity umount /target/run
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity umount /target/dev
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity umount -f /target/proc
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity umount -f /target/sys
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity umount -f /target/dev
Oct 13 16:42:42 ubuntu plugininstall.py: log-output -t ubiquity umount -f /target/run
Oct 13 16:42:42 ubuntu plugininstall.py: Could not restore packages from the previous install:
Oct 13 16:42:42 ubuntu plugininstall.py: Traceback (most recent call last):
Oct 13 16:42:42 ubuntu plugininstall.py: File "/usr/share/ubiquity/plugininstall.py", line 264, in run
Oct 13 16:42:42 ubuntu plugininstall.py: self.apt_clone_restore()
Oct 13 16:42:42 ubuntu plugininstall.py: File "/usr/share/ubiquity/plugininstall.py", line 1520, in apt_clone_restore
Oct 13 16:42:42 ubuntu plugininstall.py: preexec_fn=install_misc.debconf_disconnect)
Oct 13 16:42:42 ubuntu plugininstall.py: File "/usr/lib/python3.2/subprocess.py", line 489, in check_call
Oct 13 16:42:42 ubuntu plugininstall.py: raise CalledProcessError(retcode, cmd)
Oct 13 16:42:42 ubuntu plugininstall.py: subprocess.CalledProcessError: Command '['apt-clone', 'restore-new-distro', '/target/ubiquity-apt-clone/apt-clone-state-ubuntu.tar.gz', 'quantal', '--destination', '/target']' returned non-zero exit status 1

ProblemType: BugDistroRelease: Ubuntu 12.10
Package: ubiquity 2.12.11
ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
Uname: Linux 3.5.0-17-generic i686
ApportVersion: 2.6.1-0ubuntu3
Architecture: i386
CasperVersion: 1.328
Date: Sat Oct 13 19:08:24 2012
InstallCmdLine: file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- maybe-ubiquity
LiveMediaBuild: Ubuntu 12.10 "Quantal Quetzal" - Release i386 (20121012.3)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bashSourcePackage: ubiquity
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in ubiquity (Ubuntu):
status: New → Confirmed
Changed in ubiquity (Ubuntu):
importance: Undecided → High
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1066347

tags: added: iso-testing
summary: "Reinstall Ubuntu" failed - apt-clone crashes with: KeyError: "filename
- './etc/apt/sources.list' not found" ilne 1886 in getmember in tarfile.py
+ './etc/apt/sources.list' not found" line 1886 in getmember in tarfile.py
tags: added: testcase
Colin Watson (cjwatson)
affects: ubiquity (Ubuntu Quantal) → apt-clone (Ubuntu Quantal)
Changed in apt-clone (Ubuntu Quantal):
importance: High → Critical
milestone: none → ubuntu-12.10
status: Confirmed → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
apt-clone (0.2.3~ubuntu3) quantal; urgency=low

  * Ensure that /etc/apt/sources.list and /etc/apt/sources.list.d are put
    at the right place in the tarball by hardcoding their location in the
    tarball. (LP: #1066347)
 -- Stephane Graber <email address hidden> Mon, 15 Oct 2012 15:18:12 +0200

Changed in apt-clone (Ubuntu Quantal):
status: Triaged → Fix Released
Revision history for this message
Vladimir Rutsky (rutsky) wrote :

I think this bug affects 12.04 LTS, will fix be backported to 12.04?

Changed in apt-clone (Ubuntu Precise):
importance: Undecided → High
status: New → Triaged
milestone: none → ubuntu-12.04.2
Revision history for this message
Brian Murray (brian-murray) wrote :

I've uploaded this to the precise -proposed queue, thanks for the reminder!

description: updated
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Jean-Baptiste, or anyone else affected,

Accepted apt-clone into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/apt-clone/0.2.2ubuntu3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in apt-clone (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Erick Brunzell (lbsolost) wrote :

I've been working on verification for about 48 hours but have encountered problems as outlined in bug #1101073.

Basically I'm not getting a reinstall option with any 12.04 image ...... which is something I should have noticed during 12.04 and 12.04.1 testing :^(

Revision history for this message
Para Siva (psivaa) wrote :

There is another way to reproduce this crash in precise and the crash occurs even with apt-clone 0.2.2ubuntu3.

1. Install precise (select 'Erase disk and install ubuntu' on the 'Installation type' screen)
2. Finish the installation, reboot and login
3. Do another installation on the same device with NO NETWORK (select 'Something else' on the 'Installation type' screen)
4. 'Change' the existing ext-4 partition to be the root partition of the new installation and leave the others (swap) untouched. Do not format the chaned partition.
5. Continue the installation entering the same username/password used for the previous installation
6. The crash can be observed at the end of the installation.

The syslog from the failed installation is attached.

(ubuntu-bug ubiquity fails to report a new bug, with the following error message: 'This is not an official ubuntu package. Please remove any third party package and try again)

Colin Watson (cjwatson)
Changed in apt-clone (Ubuntu Precise):
milestone: ubuntu-12.04.2 → ubuntu-12.04.3
Revision history for this message
Brian Murray (brian-murray) wrote :

@Erick - you won't see the option to upgrade 12.04 to 12.04 - see the following changelog:

ubiquity (2.9.28) precise; urgency=low

  * ubiquity-bluetooth-agent: Don't touch /tmp/ubiquity-bluetooth-done
    if the file already exists. (LP: #951402)
  * gtk-ui: Drop poke_screensaver and replace by code disabling it in
    gsettings. (LP: #951336)
  * Replace ubuntu_installed.png by a scaled down version (LP: #750134)
  * Enable test_same_ubuntu_only making sure we don't get offered an
    'upgrade' to the same version of Ubuntu.
  * Add test_newer_ubuntu_only ensuring ubiquity doesn't offer a downgrade.
  * Automatic update of included source packages: user-setup
    1.41ubuntu1.

 -- Stéphane Graber <email address hidden> Tue, 13 Mar 2012 19:21:21 -0400

Revision history for this message
Erick Brunzell (lbsolost) wrote :

Thanks Stéphane. Based on that info I marked bug #1101073 invalid.

Revision history for this message
Erick Brunzell (lbsolost) wrote :

Oops! Should have said, Thanks Brian ;^)

Speed reading is not my strong suit.

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

The steps to verify this bug report are incorrect in that you need to install apt-clone from precise-proposed manually as it is not included on the 12.04.2 disc and won't be included on the disc until it has passed the verification process.

Revision history for this message
Erick Brunzell (lbsolost) wrote :

Thanks for the clarification Brian. I've marked my personal calendar to revisit this issue in late May to see if I can be helpful then. Right now I'm getting queued up for the final blast of Raring testing, and the immediate follow-up on my end.

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

I booted a 12.04.2 disc and installed the apt-clone version from precise-proposed then choose to upgrade my Oneiric system to Precise. I inspected the contents of /target/ubiquity-apt-clone/apt-clone-state-ubuntu.tar.gz and confirmed that /etc/apt/sources.list was in there and that the path was correct.

Later on I received a crash from apt-clone but that was due to the package installed on my system and uncorrectable problems.

Apr 17 19:04:08 ubuntu ubiquity: WARNING:root:can't add zlib1g (E:Unable to correct problems, you have held broken packages.)
Apr 17 19:04:09 ubuntu ubiquity: Traceback (most recent call last):
Apr 17 19:04:09 ubuntu ubiquity: File "/usr/bin/apt-clone", line 117, in <module>
Apr 17 19:04:09 ubuntu ubiquity:
Apr 17 19:04:09 ubuntu ubiquity: args.source, args.destination, args.new_distro_codename, protect_installed)
Apr 17 19:04:09 ubuntu ubiquity: File "/usr/lib/python2.7/dist-packages/apt_clone.py", line 335, in restore_state
Apr 17 19:04:09 ubuntu ubiquity:
Apr 17 19:04:09 ubuntu ubiquity: self._restore_package_selection(statefile, targetdir, protect_installed)
Apr 17 19:04:09 ubuntu ubiquity: File "/usr/lib/python2.7/dist-packages/apt_clone.py", line 456, in _restore_package_selection
Apr 17 19:04:09 ubuntu ubiquity:
Apr 17 19:04:09 ubuntu ubiquity: self._restore_package_selection_in_cache(statefile, cache, protect_installed)
Apr 17 19:04:09 ubuntu ubiquity: File "/usr/lib/python2.7/dist-packages/apt_clone.py", line 436, in _restore_package_selection_in_cache
Apr 17 19:04:09 ubuntu ubiquity:
Apr 17 19:04:09 ubuntu ubiquity: resolver.resolve()
Apr 17 19:04:09 ubuntu ubiquity: SystemError
Apr 17 19:04:09 ubuntu ubiquity: :
Apr 17 19:04:09 ubuntu ubiquity: E:Unable to correct problems, you have held broken packages.

Subsequently, I considered this verification done for precise.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

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

This bug was fixed in the package apt-clone - 0.2.2ubuntu3

---------------
apt-clone (0.2.2ubuntu3) precise-proposed; urgency=low

  * Ensure that /etc/apt/sources.list and /etc/apt/sources.list.d are put
    at the right place in the tarball by hardcoding their location in the
    tarball. (LP: #1066347) Thanks to Stéphane Graber for the patch.
 -- Brian Murray <email address hidden> Fri, 14 Dec 2012 15:24:02 -0800

Changed in apt-clone (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
mikhail-777 (wpr-oxym) wrote :

I left comment about bug https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1040599/comments/9

I commented in that bug, because i did not select "Reinstall Ubuntu *". I select manual partitoning. And partition for installation has only /home folder before I installed Ubuntu.

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

mikhail-777 - this was not fixed in time for the 12.04.2 release, however we just release 12.04.3 and the correct version of apt-clone should be on that disc.

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.