vmbuilder blkid output parsing broken

Bug #535397 reported by Данило Шеган on 2010-03-09
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
VMBuilder
Medium
Soren Hansen
vm-builder (Ubuntu)
Medium
Unassigned
Lucid
Medium
Unassigned

Bug Description

Here's the traceback I receive when trying to run python-vm-builder on one machine (and interestingly, it passed fully on a different machine which was Karmic from day one; system where it fails was upgrade from at least as far back as Hardy).

2010-03-09 23:23:29,285 INFO : sed: warning: failed to get security context of /tmp/fileH0Tvpe: No data availablesed: warning: failed to get security context of /tmp/fileqCRxm0: No data availableUpdating /boot/grub/menu.lst ... done
2010-03-09 23:23:29,285 INFO :
2010-03-09 23:23:29,311 INFO : sed: -e expression #1, char 84: unterminated `s' command
Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 24, in <module>
    cli.main()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/contrib/cli.py", line 106, in main
    hypervisor.install_os()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/hypervisor.py", line 57, in install_os
    self.call_hooks('install_bootloader', self.chroot_dir, self.disks)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/distro.py", line 66, in call_hooks
    call_hooks(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/util.py", line 158, in call_hooks
    getattr(plugin, func, log_no_such_method)(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/ubuntu/distro.py", line 222, in install_bootloader
    self.suite.install_menu_lst(disks)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/ubuntu/dapper.py", line 214, in install_menu_lst
    self.mangle_grub_menu_lst(disks)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/ubuntu/jaunty.py", line 45, in mangle_grub_menu_lst
    run_cmd('sed', '-ie', 's/^# kopt=root=\([^ ]*\)\(.*\)/# kopt=root=UUID=%s\\2/g' % rootdev.fs.uuid, '%s/boot/grub/menu.lst' % self.context.chroot_dir)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/util.py", line 120, in run_cmd
    raise VMBuilderException, "Process (%s) returned %d. stdout: %s, stderr: %s" % (args.__repr__(), status, mystdout.buf, mystderr.buf)
VMBuilder.exception.VMBuilderException: Process (['sed', '-ie', 's/^# kopt=root=\\([^ ]*\\)\\(.*\\)/# kopt=root=UUID=707f3066-3d55-4303-9efb-a62bbbd412e4\n1.0\next4\nfilesystem\\2/g', '/tmp/tmp8KukTN/boot/grub/menu.lst']) returned 1. stdout: , stderr: sed: -e expression #1, char 84: unterminated `s' command

The problem is that blkid -ovalue returns a string over multiple lines and that seems to fail. Eg.

# blkid -p -sUUID -ovalue /dev/sda1
34efc44f-60f0-474f-8ae7-6eceeb074237
1.0
ext2
filesystem

From some furher testing it seems "-p" and "-s" options don't really work together:

# blkid -ovalue -sUUID -p /dev/sda1
34efc44f-60f0-474f-8ae7-6eceeb074237
1.0
ext2
filesystem
# blkid -ovalue -sUUID -c /dev/null /dev/sda1
34efc44f-60f0-474f-8ae7-6eceeb074237

If man page is to be trusted, the only thing -p does is set -c /dev/null, so here's a patch that makes it work for me.

blkid behaves exactly the same on my two Karmic machines, so I suspet the code path is not even executed on the system with the fresh install.

tags: added: patch
tags: added: kernel-series-unknown
tags: removed: kernel-series-unknown
Thierry Carrez (ttx) on 2010-03-10
summary: - blkid output parsing broken
+ vmbuilder blkid output parsing broken
Changed in vm-builder (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Soren Hansen (soren) wrote :

I like the patch, but would like to see if I could get this fixed in blkid instead. I'll add the patch regardless, because people might be using vmbuilder with a broken version of blkid.

Changed in vmbuilder:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Soren Hansen (soren)
Changed in vm-builder (Ubuntu):
milestone: none → ubuntu-10.04
Soren Hansen (soren) on 2010-03-30
Changed in vmbuilder:
milestone: none → 0.12.4
Thierry Carrez (ttx) on 2010-04-09
Changed in vm-builder (Ubuntu Lucid):
milestone: ubuntu-10.04 → none
Philip Muškovac (yofel) wrote :

Unsubscribing reviewers as the patch is already known upstream.

tags: added: patch-forwarded-upstream
Philip Muškovac (yofel) on 2010-05-07
tags: added: patch-accepted-upstream
removed: patch patch-forwarded-upstream
Soren Hansen (soren) wrote :

Fixed in upstream 0.12.4.

Changed in vmbuilder:
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

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

---------------
vm-builder (0.12.4-0ubuntu1) maverick; urgency=low

  * New upstream, bugfix release. (LP: #539460, #536942, #535397,
    #550689, #410521, #550691, others)
 -- Soren Hansen <email address hidden> Fri, 09 Jul 2010 22:58:32 +0200

Changed in vm-builder (Ubuntu):
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vm-builder - 0.12.4-0ubuntu0.1

---------------
vm-builder (0.12.4-0ubuntu0.1) lucid-proposed; urgency=low

  * New upstream, bugfix release. (LP: #539460, #536942, #535397,
    #550689, #410521, #550691, others)
 -- Soren Hansen <email address hidden> Fri, 09 Jul 2010 23:03:27 +0200

Changed in vm-builder (Ubuntu Lucid):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers