building precise on precise fails with TypeError: 'NoneType' object has no attribute '__getitem__'

Bug #1019009 reported by Alba Nader
60
This bug affects 13 people
Affects Status Importance Assigned to Milestone
VMBuilder
Confirmed
Undecided
Unassigned
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

With apt-proxy-ng installed (fully functional for apt-get use).

sudo vmbuilder vbox ubuntu --arch i386 --suite precise -v --debug --mirror http://127.0.0.1:3142/ubuntu

Log:

 DEBUG : Calling deploy method in VMBuilder.plugins.ubuntu.distro plugin.
 DEBUG : No such method
 DEBUG : Calling deploy method in context plugin VMBuilder.plugins.virtualbox.vm.
 INFO : Cleaning up
 DEBUG : ['kpartx', '-d', '/home/user/ubuntu-vbox/tmpnmO0Gp.vdi']
 DEBUG : ['kpartx', '-d', '/home/user/ubuntu-vbox/tmpnmO0Gp.vdi']
Removing partition None
Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 24, in <module>
    cli.main()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/contrib/cli.py", line 227, in main
    hypervisor.finalise(destdir)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 79, in finalise
    self.call_hooks('deploy', destdir)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/distro.py", line 69, in call_hooks
    self.cleanup()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/distro.py", line 44, in cleanup
    self._cleanup_cbs.pop(0)()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/disk.py", line 129, in <lambda>
    self.vm.add_clean_cb(lambda : self.unmap(ignore_fail=True))
  File "/usr/lib/python2.7/dist-packages/VMBuilder/disk.py", line 194, in unmap
    parted_oldmap=part.filename[len("/dev/mapper/"):-1]+"p"+part.filename[-1]
TypeError: 'NoneType' object has no attribute '__getitem__'

Is it a bug? Can you fix it?

Are there any workarounds in meanwhile?

Revision history for this message
Alba Nader (sharepass12) wrote :

By the way, same error when dropping --mirror http://127.0.0.1:3142/ubuntu, i.e. sudo vmbuilder vbox ubuntu --arch i386 --suite precise -v --debug

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

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

Changed in ubuntu:
status: New → Confirmed
Revision history for this message
David Peall (dkpeall) wrote :

is there a workaround for this?

David Peall (dkpeall)
Changed in vmbuilder:
status: New → Confirmed
Revision history for this message
David Peall (dkpeall) wrote :

This is in fact not a bug but obscure error thrown when the hardware virtualisation is not available.

Changed in vmbuilder:
status: Confirmed → Invalid
Changed in ubuntu:
status: Confirmed → Invalid
Revision history for this message
GeekSmith (lixo-geeksmith) wrote :

On my system, this seems to be unrelated to the hardware virtualisation availability. I can produce images for certain hypervisors without error (usually), but never for others. Please see attached files for output.

I don't understand what part of the command is failing. I'd think that requesting a string length would be a pretty reliable operation, but I'm not a python wizard.

Revision history for this message
GeekSmith (lixo-geeksmith) wrote :

Here's the failed vbox build, which I ran directly after the successful esxi build. I have tested esxi, vmw6, and kvm with success. Only vbox is failing at this point.

Revision history for this message
J Scott (f44w9zx39) wrote :
Download full text (14.6 KiB)

I get a similar error (see below the output that was left in my putty console by the time it failed). My hardware does support virtualization (see output below)

--------------------------------
Check for hardware support
--------------------------------
hypervisor@hypervisor:~$ sudo egrep '(vmx|svm)' --color=always /proc/cpuinfo
[sudo] password for hypervisor:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid

-----------------------------
Attempt to create virtual machine by running the following command (with "sudo"):
vmbuilder kvm ubuntu \
        --dest=/home/hypervisor/[path]\
        --overwrite \
        --mem=1024 \
        --cpus=1 \
        --rootsize=7168 \
        --swapsize=1024 \
        --addpkg=openssh-server \
        --addpkg=vim \
        --addpkg=cron \
        --addpkg=acpid \
        --addpkg=ubuntu-desktop \
        --addpkg=xrdp \
        --addpkg=nano \
        --addpkg=firestarter \
        --addpkg=build-essential \
        --addpkg=cdbs \
        --addpkg=debhelper \
        --addpkg=python-setuptools \
        --arch=amd64 \
        --suite=precise \
        --ip=[address] \
        --mask=255.255.255.0 \
        --bcast=192.168.0.255 \
        --gw=[address] \
        --flavour virtual \
        --components main,universe,restricted \
        --hostname [name]\
        --user [user]\
        --pass [pass]\
        --libvirt qemu:///system \
    ...

Revision history for this message
J Scott (f44w9zx39) wrote :

Sorry - I've just realized why it wasn't working - I needed to switch on virtualization support in the BIOS (doh!)

Thought it might help to let people know this could be the cause of the above issues (if you know that your CPU supports virtualization but are still having this issue)

Revision history for this message
phil (fongpwf) wrote :

I believe this bug is confirmed. I see that same thing as the original report and GeekSmith. I am building quantal on quantal. Hardware virtualization is enabled in my bios and is detected by vmware workstation. Also, the debug output from vmbuilder does not seem to be using any kind of virtualization. It is running kpartx.

Building with the hypervisor set to vmserver works fine.

Changed in vmbuilder:
status: Invalid → 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.