Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1335671 - extra quotes around UUID confuses findfs in RHEL (but not in Fedora)
Summary: extra quotes around UUID confuses findfs in RHEL (but not in Fedora)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: util-linux
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
TreeView+ depends on / blocked
 
Reported: 2016-05-12 19:58 UTC by Thom Carlin
Modified: 2016-11-03 21:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 21:27:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2605 0 normal SHIPPED_LIVE Low: util-linux security, bug fix, and enhancement update 2016-11-03 12:13:26 UTC

Description Thom Carlin 2016-05-12 19:58:36 UTC
Description of problem:

Failure running virt-v2v with misleading error message

Version-Release number of selected component (if applicable):

virt-v2v 1:1.28.1-1.55.el7_2.2

How reproducible:

100% for this guest VM

Steps to Reproduce:
1. LIBGUESTFS_BACKEND=direct virt-v2v -v -x -ic vpx://vcenter_string guest_vm -o local -os /tmp
2.
3.

Actual results:

virt-v2v: error: no grub1/grub-legacy or grub2 configuration file was found

Expected results:

Successful conversion

Additional info:

Similar to 1229119, the error message is misleading.  The actual message seems to be "augeas failed to parse /etc/httpd/conf.d/pulp_puppet.conf:
  error "Syntax error" at line 50 char 0 in lens /usr/share/augeas/lenses/dist/httpd.aug.98.10-.44:

apachectl configtest reports "Syntax OK"

Comment 1 Richard W.M. Jones 2016-05-12 21:21:17 UTC
Can you attach the full log (from virt-v2v -v -x) please.

Comment 4 Richard W.M. Jones 2016-05-13 07:17:57 UTC
I believe that the Augeas error can be ignored.

Does the guest have a /boot partition?  It looks like it does not,
or if it does libguestfs cannot find it.  Because there's no /boot
partition found, no grub configuration is found and virt-v2v
gives up.

Where does the guest come from?  How was it created?

Comment 5 Thom Carlin 2016-05-15 20:41:14 UTC
Yes, the guest has a boot partition:
df -T /boot
Filesystem     Type 1K-blocks   Used Available Use% Mounted on
/dev/sda1      xfs     508588 201912    306676  40% /boot

The guest is RHEL 7.2 running on VMware 5.5.  It was created from booting a RHEL ISO.

Comment 6 Thom Carlin 2016-05-15 20:43:54 UTC
ll /boot/grub2/grub.cfg
-rw-------. 1 root root 5814 May 14 13:44 /boot/grub2/grub.cfg

Comment 7 Thom Carlin 2016-05-15 20:46:51 UTC
/dev/sda1: UUID="9b6e77f6-1bf0-46e4-bd8c-22ed3f59bc8e" TYPE="xfs" 

findfs UUID="9b6e77f6-1bf0-46e4-bd8c-22ed3f59bc8e"
/dev/sda1

Comment 8 Richard W.M. Jones 2016-05-15 22:13:14 UTC
Ah, got it.  The actual error is a strange one.  /etc/fstab
references the /boot filesystem by UUID.  It contains the UUID
quoted:

  UUID="9b6e77f6-1bf0-46e4-bd8c-22ed3f59bc8e" /boot [...]

However the findfs command (in libguestfs) is unable to resolve this UUID.
From your log file:

  findfs UUID="9b6e77f6-1bf0-46e4-bd8c-22ed3f59bc8e"
  findfs: unable to resolve 'UUID="9b6e77f6-1bf0-46e4-bd8c-22ed3f59bc8e"'
  guestfsd: error: findfs: unable to resolve 'UUID="9b6e77f6-1bf0-46e4-bd8c-22ed3f59bc8e"'

It turns out that this is because the findfs command in RHEL 7
doesn't like the extra set of quotes.

Here is the same thing from my RHEL 7.2 machine with
util-linux-2.23.2-26.el7.x86_64:

  $ findfs 'UUID="8e404981-c9ca-4f77-a017-c5a9da4c02bb"'
  findfs: unable to resolve 'UUID="8e404981-c9ca-4f77-a017-c5a9da4c02bb"'
  $ findfs 'UUID=8e404981-c9ca-4f77-a017-c5a9da4c02bb'
  /dev/sda3

And from my Fedora machine with util-linux-2.28-2.fc24.x86_64:

  $ findfs 'UUID="96945d72-61cb-4518-8585-583f77d379ac"'
  /dev/sda1
  $ findfs 'UUID=96945d72-61cb-4518-8585-583f77d379ac'
  /dev/sda1

I had a quick look at the util-linux code, and nothing seems to have changed
since long before RHEL 7, so I'm not sure exactly why findfs in RHEL doesn't
work with the quotes.

Comment 9 Karel Zak 2016-05-16 08:43:53 UTC
The problem is that RHEL7 findfs main() parses the tag, the side effect is that findfs in RHEL7 does not support anything else that LABEL and UUID, Fedora (upstream) version supports PARTUUID= and quoted tags.

We need upstream commits:

  c48508c2faa356c48c26d7d0070a6f20ae4ba9a0  (findfs: use libblkid to parse tags)
  c1178175e7adb35388a3e34495974d7f24f45d5d  (libblkid: fix memory leak)
  aab691cf8deb4a53782a0317b6f96c5d8b61f8e9  (libblkid: ignore incomplete tags)

Comment 10 Richard W.M. Jones 2016-05-16 12:16:19 UTC
I really should have cloned this bug for util-linux, because I think
it also requires a fix in virt-v2v:

https://github.com/libguestfs/libguestfs/commit/e13334a1a2a934ad9dd4fc9500491b0dba3cd687
https://github.com/libguestfs/libguestfs/commit/653e374ef6a5fda3e6575166e159d5727b9248fa

As well as the util-linux reproducer shown in comment 8, here is
an end-to-end reproducer using virt-v2v (only works in RHEL 7.2):

$ virt-builder centos-7.2 --edit '/etc/fstab:s/^UUID=([-a-f0-9]+)/UUID="$1"/'
$ virt-v2v -i disk centos-7.2.img -o null

In the error case, the second command will print:

virt-v2v: error: no grub1/grub-legacy or grub2 configuration file was found

Comment 12 Richard W.M. Jones 2016-06-02 12:19:25 UTC
Re comment 10, this is fixed in libguestfs-1.32.5-1.el7

Comment 17 errata-xmlrpc 2016-11-03 21:27:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2605.html


Note You need to log in before you can comment on or make changes to this bug.