proxy support not fully working

Bug #966944 reported by Yoann Dubreuil
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
VMBuilder
New
Undecided
Unassigned
vm-builder (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Fix Released
Medium
Unassigned
Quantal
Fix Released
Medium
Unassigned

Bug Description

========================================
SRU Justification:
1. impact: creating VMs using an apt proxy fails
2. Development fix: set up apt proxies before creating sources.list
3. Stable fix: same as development fix
4. Test case:
  sudo apt-get -y install apt-cacher-ng
  sudo vmbuilder kvm ubuntu -o -v --tmpfs 1536 --rootsize=4096M --swapsize=512M -d vm1 --proxy=http://localhost:3142
5. Regression potential: this should not introduce any regressions.
========================================

Building a vm image behind a proxy doesn't work (in fact, it nearly works...). VMbuilder can't connect to the network while updating the apt sources.

This command crashes :

# vmbuilder vbox ubuntu -o -v \
 --tmpfs 1536 --rootsize=4096M --swapsize=512M \
 -c openstack.cfg -d target/ubuntu-vbox --proxy=http://apt-cacher-ng-host:3142

2012-03-28 10:44:47,213 INFO : Mounting tmpfs under /tmp/tmp6WoP31tmpfs
2012-03-28 10:44:47,219 INFO : Calling hook: preflight_check
2012-03-28 10:44:47,222 INFO : Calling hook: set_defaults
2012-03-28 10:44:47,222 INFO : Calling hook: bootstrap
2012-03-28 10:45:22,542 INFO : Calling hook: configure_os
2012-03-28 10:46:25,850 INFO : W: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Unable to connect to fr.archive.ubuntu.com:http:
2012-03-28 10:46:25,850 INFO :
2012-03-28 10:46:25,851 INFO : W: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg Unable to connect to fr.archive.ubuntu.com:http:
2012-03-28 10:46:25,851 INFO :
2012-03-28 10:46:25,851 INFO : W: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Unable to connect to fr.archive.ubuntu.com:http:
2012-03-28 10:46:25,851 INFO :
2012-03-28 10:46:25,851 INFO : W: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/precise/universe/binary-amd64/Packages Unable to connect to fr.archive.ubuntu.com:http:

The problem is at the beginning of the configure_os phase : the /etc/apt/apt.conf file containing the proxy configuration is created after updating the apt sources. The apt update cannot work without the proxy configuration. After swapping theses two actions, building an image works.

So, here is a simple patch swapping theses two actions.

Any chance to have this fix in precise ?

Thanks,
Yoann.

Revision history for this message
Yoann Dubreuil (ydubreuil) wrote :
James Page (james-page)
Changed in vm-builder (Ubuntu):
importance: Undecided → Medium
Revision history for this message
cuc (cuc+) wrote :

thx for the fix... works for me now :)

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

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

Changed in vm-builder (Ubuntu):
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for the patch. This can definately be applied to quantal and precise.

Changed in vm-builder (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(Fix confirmed, the test case I'm using is:

sudo vmbuilder kvm ubuntu -o -v --tmpfs 1536 --rootsize=4096M --swapsize=512M -d vm1 --proxy=http://localhost:3142

)

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

This bug was fixed in the package vm-builder - 0.12.4+bzr481-0ubuntu1

---------------
vm-builder (0.12.4+bzr481-0ubuntu1) quantal; urgency=low

  [ Yoann Dubreuil ]
  * Fix proxy support: set up apt proxies before writing sources.list.
    (LP: #966944)
 -- Serge Hallyn <email address hidden> Mon, 06 Aug 2012 14:39:54 -0500

Changed in vm-builder (Ubuntu Quantal):
status: Triaged → Fix Released
description: updated
Changed in vm-builder (Ubuntu Precise):
assignee: nobody → Serge Hallyn (serge-hallyn)
status: New → Triaged
importance: Undecided → Medium
Changed in vm-builder (Ubuntu Precise):
assignee: Serge Hallyn (serge-hallyn) → nobody
status: Triaged → In Progress
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Yoann, or anyone else affected,

Accepted vm-builder into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/vm-builder/0.12.4+bzr477-0ubuntu3 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 change the bug tag from verification-needed to verification-done. If it does not, 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 vm-builder (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Download full text (6.1 KiB)

Tested with line in comment #5 against my local LAN proxy, worked fine.

alan@deep-thought:~$ sudo vmbuilder kvm ubuntu -o -v --tmpfs 1536 --rootsize=4096M --swapsize=512M -d vm1 --proxy=http://192.168.1.2:3128
2012-09-23 21:37:16,702 INFO : Mounting tmpfs under /tmp/tmpyXTs9ntmpfs
2012-09-23 21:37:16,705 INFO : Calling hook: preflight_check
2012-09-23 21:37:16,708 INFO : Calling hook: set_defaults
2012-09-23 21:37:16,708 INFO : Calling hook: bootstrap
2012-09-23 21:58:07,557 INFO : Calling hook: configure_os
2012-09-23 22:00:21,739 INFO :
2012-09-23 22:00:21,739 INFO : Current default time zone: 'Etc/UTC'
2012-09-23 22:00:21,740 INFO : Local time is now: Sun Sep 23 21:00:21 UTC 2012.
2012-09-23 22:00:21,740 INFO : Universal Time is now: Sun Sep 23 21:00:21 UTC 2012.
2012-09-23 22:00:21,740 INFO :
Extracting templates from packages: 100%
2012-09-23 22:14:46,150 INFO :
2012-09-23 22:14:46,151 INFO : Current default time zone: 'Etc/UTC'
2012-09-23 22:14:46,153 INFO : Local time is now: Sun Sep 23 21:14:46 UTC 2012.
2012-09-23 22:14:46,154 INFO : Universal Time is now: Sun Sep 23 21:14:46 UTC 2012.
2012-09-23 22:14:46,154 INFO : Run 'dpkg-reconfigure tzdata' if you wish to change it.
2012-09-23 22:14:46,154 INFO :
2012-09-23 22:14:50,928 INFO : Updating certificates in /etc/ssl/certs... WARNING: Skipping duplicate certificate brasil.gov.br.pem
2012-09-23 22:14:50,928 INFO : 0 added, 1 removed; done.
2012-09-23 22:14:50,933 INFO : Running hooks in /etc/ca-certificates/update.d....done.
2012-09-23 22:14:51,816 INFO :
2012-09-23 22:14:51,816 INFO : Warning: Fake initctl called, doing nothing
2012-09-23 22:15:13,523 INFO : Cleaning up
2012-09-23 22:15:13,523 INFO : Calling hook: preflight_check
2012-09-23 22:15:13,523 INFO : Calling hook: configure_networking
2012-09-23 22:15:13,533 INFO : Calling hook: configure_mounting
2012-09-23 22:15:13,538 INFO : Calling hook: mount_partitions
2012-09-23 22:15:13,539 INFO : Mounting target filesystems
2012-09-23 22:15:13,539 INFO : Creating disk image: "/tmp/tmp83B_ke" of size: 4608MB
2012-09-23 22:15:13,551 INFO : Adding partition table to disk image: /tmp/tmp83B_ke
2012-09-23 22:15:13,899 INFO : Adding type 4 partition to disk image: /tmp/tmp83B_ke
2012-09-23 22:15:13,899 INFO : Partition at beginning of disk - reserving first cylinder
2012-09-23 22:15:14,303 INFO : Adding type 3 partition to disk image: /tmp/tmp83B_ke
2012-09-23 22:15:14,313 INFO : [0] ../../libparted/filesys.c:148 (ped_file_system_type_get): File system alias linux-swap(new) is deprecated
2012-09-23 22:15:14,607 INFO : Creating loop devices corresponding to the created partitions
2012-09-23 22:15:14,620 INFO : Creating file systems
2012-09-23 22:15:14,634 INFO : mke2fs 1.42 (29-Nov-2011)
2012-09-23 22:15:15,033 INFO : mkswap: /dev/mapper/loop0p2: warning: don't erase bootbits sectors
2012-09-23 22:15:15,033 INFO : on whole disk. Use -f to force.
2012-09-23 22:15:17,087 INFO : Calling hook: install_bootloader
2012-09-23 22:16:24,188 INFO : Searching for GRUB installation directory ... found: /boot/...

Read more...

tags: added: verification-done
removed: verification-needed
Revision history for this message
Adam Conrad (adconrad) 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 vm-builder - 0.12.4+bzr477-0ubuntu3

---------------
vm-builder (0.12.4+bzr477-0ubuntu3) precise-proposed; urgency=low

  [ Alex Dehnert ]
  * fix tmpfs unmounting failure (LP: #1008225)

vm-builder (0.12.4+bzr477-0ubuntu2) precise-proposed; urgency=low

  [ Yoann Dubreuil ]
  * Fix proxy support: set up apt proxies before writing sources.list.
    (LP: #966944)
 -- Serge Hallyn <email address hidden> Mon, 06 Aug 2012 16:06:51 -0500

Changed in vm-builder (Ubuntu Precise):
status: Fix Committed → 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.