Augeas with puppet 3.4.2

4,212 views
Skip to first unread message

Ryan Anderson

unread,
Feb 13, 2014, 3:54:41 PM2/13/14
to puppet...@googlegroups.com
I have some augeas code that works flawlessly with puppet 2.6.17, but when running the identical code on 3.4.2, I get an error.

The code:
   augeas { 'myuser_in_logingroup':
      context     => '/files/etc/group',
      changes     => [ "set ${hostname}/user[last()+1] myuser", ],
      onlyif      => "match ${hostname}/*[.='myuser'] size == 0",
      require     => Group['local_login_group'],
    }

The error from running 'puppet agent -tv':
Warning: Augeas[myuser_in_logingroup](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Error: /Stage[main]/Group_management/Augeas[myuser_in_logingroup]: Could not evaluate: Save failed with return code false, see debug

I'm having a difficult time finding/understanding clues from debug output. Any ideas?

Rob Reynolds

unread,
Feb 13, 2014, 4:23:00 PM2/13/14
to puppet...@googlegroups.com
Ryan, would you mind running 'puppet agent --trace --verbose --debug' and posting the output here?

 

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0daa274a-6978-41e5-8812-be05d13dfa39%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Rob Reynolds
Developer, Puppet Labs

Join us at PuppetConf 2014September 23-24 in San Francisco - http://bit.ly/pupconf14

gter marcelo

unread,
Feb 13, 2014, 7:18:27 PM2/13/14
to puppet...@googlegroups.com
Hi, 

I had the same problem,  the solution of the problem is in : 

https://github.com/puppetlabs/puppet/commit/644fc99193dd5e2beed3facbccb949caf8d6501f

Best  regards, 
Marcelo Frota


Message has been deleted

Ryan Anderson

unread,
Feb 13, 2014, 8:54:47 PM2/13/14
to puppet...@googlegroups.com
Cool. Does this mean I need to update augeas.rb from github.com or wait for it to make it into a future release? What should I do to fix it now?

In case it helps, here are the problem bits from the debug output:
^[[0;32mInfo: Applying configuration version '1392322307'^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): Opening augeas with root /, lens path , flags 32^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): Augeas version 1.0.0 is installed^[[0m
^[[1;31mWarning: Augeas[myuser_in_logingroup](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): /augeas/files/etc/group/error = parse_failed^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): /augeas/files/etc/group/error/pos = 670^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): /augeas/files/etc/group/error/line = 51^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): /augeas/files/etc/group/error/char = 0^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): /augeas/files/etc/group/error/lens = /usr/share/augeas/lenses/dist/group.aug:44.17-.40:^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): /augeas/files/etc/group/error/message = Iterated lens matched less than it should^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): Will attempt to save and only run if files changed^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): sending command 'set' with params ["/files/etc/group/mygroup/user[last()+1]", "myuser"]^[[0m
^[[0;36mDebug: Augeas[myuser_in_logingroup](provider=augeas): Closed the augeas connection^[[0m
^[[1;31mError: /Stage[main]/Group_management/Augeas[myuser_in_logingroup]: Could not evaluate: Save failed with return code false, see debug
/usr/lib/ruby/site_ruby/1.8/puppet/util/errors.rb:97:in `fail'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/augeas/augeas.rb:388:in `need_to_run?'
/usr/lib/ruby/site_ruby/1.8/puppet/type/augeas.rb:175:in `retrieve'

Dominic Cleal

unread,
Feb 17, 2014, 4:18:46 PM2/17/14
to puppet...@googlegroups.com
The fix that Marcelo pointed out isn't relevant here, it's to fix a
false positive log message. The log message is actually correct in this
instance, no need to update augeas.rb.

The Augeas library is unable to parse something on line 51 of your
/etc/group file. From the debug: augeas/files/etc/group/error/line = 51

Look to see what's there and maybe you can edit the file to workaround
the problem. If the file is still valid, then please file a bug either
with your distribution or upstream
(https://github.com/hercules-team/augeas/issues).

--
Dominic Cleal
Red Hat Engineering

On 13/02/14 20:54, Ryan Anderson wrote:
> Cool. Does this mean I need to update augeas.rb from github.com
> <http://github.com/> or wait for it to make it into a future release?
> <https://github.com/puppetlabs/puppet/commit/644fc99193dd5e2beed3facbccb949caf8d6501f>,
>
> Best regards,
> Marcelo Frota
>
>
> 2014-02-13 14:23 GMT-02:00 Rob Reynolds <r...@puppetlabs.com
> <javascript:>>:
> <javascript:>.
> <https://groups.google.com/d/msgid/puppet-users/0daa274a-6978-41e5-8812-be05d13dfa39%40googlegroups.com>.
> For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
>
>
> --
> Rob Reynolds
> Developer, Puppet Labs
>
> *Join us at PuppetConf 2014, September 23-24 in San Francisco
> - *http://bit.ly/pupconf14
>
> --
> You received this message because you are subscribed to the
> Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to puppet-users...@googlegroups.com <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAMJiBK5F1GgFyBMTZQmyND7zrfaRpyPe5jKXS3%3DupdVzO8RVpw%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CAMJiBK5F1GgFyBMTZQmyND7zrfaRpyPe5jKXS3%3DupdVzO8RVpw%40mail.gmail.com>.
>
> For more options, visit https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/96e850f6-4909-4162-9f16-6af9f7b40be8%40googlegroups.com.

Ryan Anderson

unread,
Feb 18, 2014, 9:21:51 PM2/18/14
to puppet...@googlegroups.com
Excellent catch, the error was indeed an improperly-formatted /etc/group entry (on line 51). Thanks for your help! I've learned a lot about augeas through this.

The old adage applies: garbage in, garbage out.
Reply all
Reply to author
Forward
0 new messages