Issue #13259 has been updated by Rich  Rauenzahn.

Is there a workaround for this that doesn't require an upgrade?  We're seeing 
this on just a couple of machines in /etc/sysctl.conf.  

...it looks like the only workaround is to hand apply the augeas change to the 
file?

(I'd rather not upgrade augeas to a non official release; and a puppet upgrade 
when 14 release will take a bit of time to roll out)
----------------------------------------
Bug #13259: Augeas error: Could not evaluate: No such file or directory
https://projects.puppetlabs.com/issues/13259#change-63671

Author: Tim Bishop
Status: Duplicate
Priority: Normal
Assignee: 
Category: augeas
Target version: 
Affected Puppet version: 2.7.12
Keywords: Augeas FreeBSD
Branch: 


I have a problem with Puppet on FreeBSD (I haven't confirmed if the issue is 
repeatable on another OS). The relevant software versions are:

 * puppet-2.7.12
 * augeas-0.10.0
 * rubygem-ruby-augeas-0.4.1

My test manifest is:

<pre>
augeas { '/etc/ssh/sshd_config':
  context => '/files/etc/ssh/sshd_config',
  changes => [
    "set Port 2222",
    "set PermitRootLogin no",
  ],
}
</pre>

And I apply this as follows, with debugging enabled:

<pre>
# puppet apply -v -d augtest.pp
...
debug: Augeas[/etc/ssh/sshd_config](provider=augeas): Opening augeas with root 
/, lens path , flags 0
debug: Augeas[/etc/ssh/sshd_config](provider=augeas): Augeas version 0.10.0 is 
installed
debug: Augeas[/etc/ssh/sshd_config](provider=augeas): Will attempt to save and 
only run if files changed
debug: Augeas[/etc/ssh/sshd_config](provider=augeas): sending command 'set' 
with params ["/files/etc/ssh/sshd_config/Port", "2222"]
debug: Augeas[/etc/ssh/sshd_config](provider=augeas): sending command 'set' 
with params ["/files/etc/ssh/sshd_config/PermitRootLogin", "no"]
notice: Augeas[/etc/ssh/sshd_config](provider=augeas): saved_file: 
/etc/ssh/sshd_config
notice: Augeas[/etc/ssh/sshd_config](provider=augeas): saved_file: 
/etc/ssh/sshd_config
err: /Stage[main]//Augeas[/etc/ssh/sshd_config]: Could not evaluate: No such 
file or directory - /etc/ssh/sshd_config.augnew
...
</pre>

There's two additional lines there. I added the following to the augeas 
provider:

<pre>
--- augeas.rb.orig      2012-03-20 20:01:57.000000000 +0000
+++ augeas.rb   2012-03-20 20:02:28.000000000 +0000
@@ -297,10 +297,11 @@
           saved_files = @aug.match("/augeas/events/saved")
           if saved_files.size > 0
             root = resource[:root].sub(/^\/$/, "")
             saved_files.each do |key|
               saved_file = @aug.get(key).sub(/^\/files/, root)
+              notice("saved_file: " + saved_file)
               if Puppet[:show_diff]
                 notice "\n" + diff(saved_file, saved_file + ".augnew")
               end
               File.delete(saved_file + ".augnew")
             end
</pre>

So the reason for the problem is that Puppet does a diff of the file, removes 
it, and then attempts to diff it again. The root cause is unknown, but it's 
obviously not right that the file appears twice in saved_files.

Issue #13204 offers a fix, but it feels like it's masking the underlying issue. 
I've tried it, and not surprisingly the fix works.

I'm happy to help debug this where I can.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to