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 894241 - aug-init fail with the newest augeas package
Summary: aug-init fail with the newest augeas package
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 901439 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-11 06:54 UTC by Mohua Li
Modified: 2014-09-16 13:53 UTC (History)
9 users (show)

Fixed In Version: libguestfs-1.20.1-6.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:56:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mohua Li 2013-01-11 06:54:48 UTC
Description of problem:

aug-init fail with "Augeas initialization failed", this fail occur on the 
latest augeas package augeas-1.0.0-1.el7, no problem with augeas-0.10.0-5.el7, 
on libguestfs, just simply call the aug_init api, so it's probably a augeas 
problem, 

daemon/augeas.c
                                                                         
   83                                                                                
   84   aug = aug_init (buf, NULL, flags);                                           
   85   free (buf);                                                                  
   86                                                                                
   87   if (!aug) {                                                                  
   88     reply_with_error ("Augeas initialization failed");                         
   89     return -1;                                                                 
   90   }                     



Version-Release number of selected component (if applicable):
libguestfs-1.20.1-4.el7.x86_64
augeas-1.0.0-1.el7

How reproducible:
always

Steps to Reproduce:
1.guestfish -x -v -N fs  mount /dev/sda1 / : aug-init / 1 

 
Actual results:


Expected results:


Additional info:

Comment 2 Dominic Cleal 2013-01-14 10:03:11 UTC
I can reproduce this on Fedora 18 with:

libguestfs-1.20.1-2.fc18.x86_64
augeas-1.0.0-1.fc18.x86_64

It'd be really useful to call aug_init with the AUG_NO_ERR_CLOSE flag and then call aug_error* when initialisation fails.  See for instance:

https://github.com/hercules-team/augeas/blob/master/src/augtool.c#L593
https://github.com/hercules-team/augeas/blob/master/src/augtool.c#L412

Comment 3 David Lutterkort 2013-01-15 20:04:30 UTC
This _might_ be caused by attempting to read files with funky filenames. To get more information about the error, pass the AUG_NO_LOAD flag to aug_init, and then issue a separate aug_load and look at the errors from that. You can also try to trigger the error by running augtool -A 'load' on the affected system.

Is there any way you could send me the /etc from the machine to help me analyze this ?

Comment 6 Mohua Li 2013-01-16 05:16:33 UTC
(In reply to comment #3)
> This _might_ be caused by attempting to read files with funky filenames. To
> get more information about the error, pass the AUG_NO_LOAD flag to aug_init,
> and then issue a separate aug_load and look at the errors from that. You can
> also try to trigger the error by running augtool -A 'load' on the affected
> system.
> 
> Is there any way you could send me the /etc from the machine to help me
> analyze this ?

i didn't find a way to send you the /etc so far, as it's in the libguestfs appliance env,

Comment 7 Richard W.M. Jones 2013-01-16 11:14:42 UTC
(In reply to comment #6)
> i didn't find a way to send you the /etc so far, as it's in the libguestfs
> appliance env,

Whoa wait ... you're doing aug-init on the libguestfs appliance *itself*?

Well, I guess that should work, but I'm not sure why you'd want
to ever do that.

In any case, you can extract the libguestfs appliance /etc using
libguestfs (naturally):

  cd /var/tmp/.guestfs-`id -u`
  guestfish -a root -m /dev/sda --ro tar-out /etc /tmp/etc.tar
  ls -l /tmp/etc.tar 

To extract /etc from a regular disk image, do this instead:

  virt-tar-out -d disk.img /etc /tmp/etc.tar

Comment 8 Richard W.M. Jones 2013-01-16 11:15:47 UTC
(In reply to comment #7)
> To extract /etc from a regular disk image, do this instead:

Correction:

  virt-tar-out -a disk.img /etc /tmp/etc.tar

Comment 9 Mohua Li 2013-01-16 11:44:00 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > i didn't find a way to send you the /etc so far, as it's in the libguestfs
> > appliance env,
> 
> Whoa wait ... you're doing aug-init on the libguestfs appliance *itself*?
> 
> Well, I guess that should work, but I'm not sure why you'd want
> to ever do that.

no, not the appliance itself, but aug-init on a disk image which add with "-a"
to guestfish  

> 
> In any case, you can extract the libguestfs appliance /etc using
> libguestfs (naturally):
> 
>   cd /var/tmp/.guestfs-`id -u`
>   guestfish -a root -m /dev/sda --ro tar-out /etc /tmp/etc.tar
>   ls -l /tmp/etc.tar 
> 
> To extract /etc from a regular disk image, do this instead:
> 
>   virt-tar-out -d disk.img /etc /tmp/etc.tar


yup, just forgot i could hack the appliance disk image, thanks for remind

Comment 10 Richard W.M. Jones 2013-01-18 09:53:57 UTC
*** Bug 901439 has been marked as a duplicate of this bug. ***

Comment 11 Dominic Cleal 2013-01-18 10:44:44 UTC
The issue is the hostfiles list to build the contents of the libguestfs appliance is out of date with respect to the contents of the augeas packages.

By adding augtool into the appliance and running it, I was able to get the detailed error messages.  A number of modules were added in Augeas 1.0.0, two of which (Quote and Simplevars) are new dependencies for existing modules.

><rescue> augtool 
Failed to initialize Augeas
error: Syntax error in lens definition
/usr/share/augeas/lenses/dist/dhcpd.aug:95.14-.28:Could not load module Quote for Quote.do_quote
/usr/share/augeas/lenses/dist/dhcpd.aug:95.14-.28:Undefined variable Quote.do_quote

><rescue> augtool
Failed to initialize Augeas
error: Syntax error in lens definition
/usr/share/augeas/lenses/dist/sysctl.aug:36.34-.50:Could not load module Simplevars for Simplevars.entry
/usr/share/augeas/lenses/dist/sysctl.aug:36.34-.50:Undefined variable Simplevars.entry

Adding these to the supermin hostfiles (/usr/lib64/guestfs/supermin.d/hostfiles) resolved the issue:

/usr/share/augeas/lenses/dist/quote.aug
/usr/share/augeas/lenses/dist/simplevars.aug

I guess rebuilding libguestfs would resolve the issue, as it'd pick up the new package list from Augeas 1.0.0.  It seems though that either the dependency between the built libguestfs RPM and the packages it's pulling into the appliance should be tighter, or the hostfiles list made more dynamic.

Comment 12 Richard W.M. Jones 2013-01-18 10:56:07 UTC
I see, not good.

Let's go for the rebuild option (Fedora 18 and RHEL 7 should
cover it).

Comment 13 Richard W.M. Jones 2013-01-18 13:05:53 UTC
For Fedora 18: libguestfs-1.20.1-3.fc18 is building here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=4880583

Can't build on RHEL 7 at the moment because qemu is broken
(bug 901542).

Comment 14 Richard W.M. Jones 2013-01-18 15:11:16 UTC
Sorry I don't have a separate bug for the Fedora 18 issue,
but please try this package and mod it up if it works for you:

https://admin.fedoraproject.org/updates/libguestfs-1.20.1-3.fc18

Comment 15 Richard W.M. Jones 2013-01-18 15:15:50 UTC
$ egrep 'augeas.*(quote|simplevars)' /usr/lib64/guestfs/supermin.d/hostfiles 
/usr/share/augeas/lenses/dist/quote.aug
/usr/share/augeas/lenses/dist/simplevars.aug
/usr/share/augeas/lenses/dist/tests/test_quote.aug
/usr/share/augeas/lenses/dist/tests/test_simplevars.aug

Comment 16 Richard W.M. Jones 2013-01-19 12:15:39 UTC
https://brewweb.devel.redhat.com/taskinfo?taskID=5292752

Comment 17 Steve Baker 2013-01-20 20:50:34 UTC
Fedora 17 is also affected by this

Comment 18 Richard W.M. Jones 2013-01-21 07:32:43 UTC
I've kicked off an F17 rebuild:
http://koji.fedoraproject.org/koji/taskinfo?taskID=4888499

Comment 19 David Lutterkort 2013-01-23 18:42:08 UTC
I just added a --trace option to augparse (commit 85db83cd) so that it will print which modules are loaded - hopefully that will be useful in generating hostfiles.

Comment 20 Arun S A G 2013-01-24 13:58:04 UTC
Fedora 17 build worked for me, Thanks!

Comment 21 Arun S A G 2013-01-31 12:04:21 UTC
The problem now happens in RHEL5

$ rpm -q augeas
augeas-1.0.0-1.el5

$ rpm -q python-augeas
python-augeas-0.4.1-1.el5

$ rpm -q libguestfs
libguestfs-1.19.37-4.el5

Comment 22 Richard W.M. Jones 2013-01-31 12:12:40 UTC
(In reply to comment #21)
> The problem now happens in RHEL5
> 
> $ rpm -q augeas
> augeas-1.0.0-1.el5
> 
> $ rpm -q python-augeas
> python-augeas-0.4.1-1.el5
> 
> $ rpm -q libguestfs
> libguestfs-1.19.37-4.el5

You mean EPEL 5?  Please file a separate bug about it.

Comment 23 Arun S A G 2013-01-31 13:58:19 UTC
(In reply to comment #22)

> You mean EPEL 5?  Please file a separate bug about it.

Done https://bugzilla.redhat.com/show_bug.cgi?id=906361 Thanks!

Comment 27 Wei Shi 2013-06-13 08:59:23 UTC
Verified:
 libguestfs-1.22.2-1.el7.x86_64
 augeas-1.0.0-2.el7.x86_64

 # guestfish -N fs  mount /dev/sda1 / : aug-init / 1

No error feedback.

Comment 28 Ludek Smid 2014-06-13 11:56:20 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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