RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 975377 - inspect-get-hostname return unknown for linux guest in rhel6
Summary: inspect-get-hostname return unknown for linux guest in rhel6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 975412
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-18 10:05 UTC by bfan
Modified: 2013-11-21 04:44 UTC (History)
3 users (show)

Fixed In Version: libguestfs-1.20.9-5.el6
Doc Type: Bug Fix
Doc Text:
(This was a bug in Augeas, not libguestfs)
Clone Of:
Environment:
Last Closed: 2013-11-21 04:44:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test script which reproduces the problem (824 bytes, text/plain)
2013-06-18 11:10 UTC, Richard W.M. Jones
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1536 0 normal SHIPPED_LIVE Moderate: libguestfs security, bug fix, and enhancement update 2013-11-21 00:40:55 UTC

Description bfan 2013-06-18 10:05:50 UTC
Description of problem:
inspect-get-hostname return unknown for all linux guest in rhel6, but function correctly with windows guest


Version-Release number of selected component (if applicable):
libguestfs-1.20.8-5.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
# guestfish -a RHEL-Server-6.4-64-hvm.raw
><fs> run
><fs> inspect-os
/dev/VolGroup/lv_root
><fs> inspect-get-hostname /dev/VolGroup/lv_root
unknown


Additional info:
1.It works with 1.16,regression
2.Same issue with bug 920609

Comment 3 Richard W.M. Jones 2013-06-18 11:10:23 UTC
Created attachment 762465 [details]
Test script which reproduces the problem

Note that 920609 has been fixed in the rebased Augeas package in RHEL 6.5
(but not the package in RHEL 7 apparently).

I can reproduce the problem using the attached script but I don't
yet understand why it happens.

Comment 4 Richard W.M. Jones 2013-06-18 11:12:54 UTC
FYI on RHEL 6 host, RHEL 6 guest, the test script dies with:

could not get hostname (error = 'aug_get: no matching node at /tmp/bz975377.pl line 27.
') at /tmp/bz975377.pl line 29.

Comment 5 Richard W.M. Jones 2013-06-18 11:22:11 UTC
Playing around with augtool (in virt-rescue) seems to
show this is an Augeas problem.

(1) Run the 'rm' expression:

><rescue> augtool -r /sysroot -L
augtool> rm '/augeas/load//incl[. != "/etc/sysconfig/network"]'
rm : /augeas/load//incl[. != "/etc/sysconfig/network"] 297    <---#a
augtool> rm '/augeas/load//incl[. != "/etc/sysconfig/network"]'
rm : /augeas/load//incl[. != "/etc/sysconfig/network"] 0      <---#b

At #a 297 rules are deleted.  When repeated, no more rules are deleted.

(2) Repeat augtool, this time deleting a non-existent file:

><rescue> augtool -r /sysroot -L
augtool> rm '/augeas/load//incl[. != "/etc/foobar"]'
rm : /augeas/load//incl[. != "/etc/foobar"] 297      <---#c
augtool> rm '/augeas/load//incl[. != "/etc/foobar"]'
rm : /augeas/load//incl[. != "/etc/foobar"] 0        <---#d

Note that #c and #d match #a and #b.

(3) Repeat augtool, this time deleting a file which we know exists:

><rescue> augtool -r /sysroot -L
augtool> rm '/augeas/load//incl[. != "/etc/passwd"]'
rm : /augeas/load//incl[. != "/etc/passwd"] 296    <---#e
augtool> rm '/augeas/load//incl[. != "/etc/passwd"]'
rm : /augeas/load//incl[. != "/etc/passwd"] 0      <---#f

Note that 1 less rule is deleted in #e compared to #a or #c.

(4) Note that the file exists and is readable:

><rescue> ls -l /sysroot/etc/sysconfig/network
-rw-r--r--. 1 root root 55 Jul 13  2011 /sysroot/etc/sysconfig/network

Comment 6 Richard W.M. Jones 2013-06-18 12:28:18 UTC
Set component back to libguestfs since that's where we will
have to make the change.

This is actually an incompatible ABI change in Augeas however.

Upstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=975412

Comment 8 bfan 2013-09-17 07:30:22 UTC
Verified with libguestfs-1.20.11-1.el6.x86_64

# guestfish -a RHEL-Server-6.4-64-hvm.raw

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run
><fs> inspect-os
/dev/VolGroup/lv_root
><fs> inspect-get-hostname /dev/VolGroup/lv_root
localhost.localdomain

So change the status to verified

Comment 10 errata-xmlrpc 2013-11-21 04:44:59 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.

http://rhn.redhat.com/errata/RHSA-2013-1536.html


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