tobyriddell
2011-May-19 07:23 UTC
[Puppet Users] Intermittent errors for resource dependencies
Hi all, I''ve got a bit of a strange one here. I''m seeing intermittent errors for missing resource dependencies. I''m building up a Puppet config. for a new server, making changes gradually and running the puppet agent multiple times by hand to apply the changes. The behaviour I see is that the errors suddenly appear when I make an apparently unrelated change. Just to be clear: I have no argument with the fact that my Puppet config. has problems in it (clearly dependencies must be present), it''s just that I''d expect the errors to be present the entire time rather than intermittent. I''ve got ''filetimeout = 0'' set in puppet.conf on the master (and for good measure it''s set on the client too). The behaviour persists across puppet master restarts and multiple client runs, and it seems to ''latch'' - the errors will occur persistently for tens of runs, and then disappear for tens of runs. I was running Puppet 2.6.2 when the problem first appeared. I''ve upgraded both master and client to 2.6.8 and the behaviour persists. This is the resource definition that is raising the errors: service { ''nslcd'': tag => [''weekday'',''services''], enable => true, ensure => running, subscribe => [ File[''/etc/nslcd.conf''], File[''/ etc/krb5.conf''] ], } (error for the above is "err: Could not run Puppet configuration client: Could not find dependency File[/etc/nslcd.conf] for Service[nslcd] at /home/puppet/etc/development/modules/services/ manifests/init.pp:105" - the client does not have nslcd installed, and hence /etc/nslcd.conf is indeed missing) Can anyone shed any light on this? Toby -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2011-May-19 13:01 UTC
[Puppet Users] Re: Intermittent errors for resource dependencies
On May 19, 2:23 am, tobyriddell <toby.ridd...@gmail.com> wrote:> I''ve got a bit of a strange one here. I''m seeing intermittent errors > for missing resource dependencies.[...]> it''s just that I''d expect the errors to be present the entire time > rather than intermittent.Prior to version 2.7, the relative order in which Puppet attempts to apply resources that have no dependency relationship is non- deterministic. Some would consider that a feature (missing dependencies will eventually be detected), but project leadership has decided that runtime consistency is more valuable, so that is implemented for 2.7. If the root problem is solely missing dependencies in your manifests, then the behavior you describe is completely normal for Puppet 2.6.x and earlier. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
tobyriddell
2011-May-19 14:04 UTC
[Puppet Users] Re: Intermittent errors for resource dependencies
Thanks for the explanation - nice to know there''s a good reason for it. On May 19, 2:01 pm, jcbollinger <John.Bollin...@stJude.org> wrote:> On May 19, 2:23 am, tobyriddell <toby.ridd...@gmail.com> wrote: > > > I''ve got a bit of a strange one here. I''m seeing intermittent errors > > for missing resource dependencies. > [...] > > it''s just that I''d expect the errors to be present the entire time > > rather than intermittent. > > Prior to version 2.7, the relative order in which Puppet attempts to > apply resources that have no dependency relationship is non- > deterministic. Some would consider that a feature (missing > dependencies will eventually be detected), but project leadership has > decided that runtime consistency is more valuable, so that is > implemented for 2.7. If the root problem is solely missing > dependencies in your manifests, then the behavior you describe is > completely normal for Puppet 2.6.x and earlier. > > John-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
tobyriddell
2011-May-19 14:46 UTC
[Puppet Users] Re: Intermittent errors for resource dependencies
Actually, I''ve just re-read your message. I don''t think we''re talking about quite the same thing. It''s not that the end results are non-deterministic, but rather that Puppet occasionally bleats about missing dependencies. So it''s the error-reporting that''s non-deterministic. On May 19, 3:04 pm, tobyriddell <toby.ridd...@gmail.com> wrote:> Thanks for the explanation - nice to know there''s a good reason for > it. > > On May 19, 2:01 pm, jcbollinger <John.Bollin...@stJude.org> wrote: > > > On May 19, 2:23 am, tobyriddell <toby.ridd...@gmail.com> wrote: > > > > I''ve got a bit of a strange one here. I''m seeing intermittent errors > > > for missing resource dependencies. > > [...] > > > it''s just that I''d expect the errors to be present the entire time > > > rather than intermittent. > > > Prior to version 2.7, the relative order in which Puppet attempts to > > apply resources that have no dependency relationship is non- > > deterministic. Some would consider that a feature (missing > > dependencies will eventually be detected), but project leadership has > > decided that runtime consistency is more valuable, so that is > > implemented for 2.7. If the root problem is solely missing > > dependencies in your manifests, then the behavior you describe is > > completely normal for Puppet 2.6.x and earlier. > > > John > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nan Liu
2011-May-20 00:05 UTC
Re: [Puppet Users] Intermittent errors for resource dependencies
On Thu, May 19, 2011 at 7:23 AM, tobyriddell <toby.riddell@gmail.com> wrote:> Hi all, > > I''ve got a bit of a strange one here. I''m seeing intermittent errors > for missing resource dependencies. I''m building up a Puppet config. > for a new server, making changes gradually and running the puppet > agent multiple times by hand to apply the changes. The behaviour I see > is that the errors suddenly appear when I make an apparently unrelated > change. > > Just to be clear: I have no argument with the fact that my Puppet > config. has problems in it (clearly dependencies must be present), > it''s just that I''d expect the errors to be present the entire time > rather than intermittent. > > I''ve got ''filetimeout = 0'' set in puppet.conf on the master (and for > good measure it''s set on the client too). The behaviour persists > across puppet master restarts and multiple client runs, and it seems > to ''latch'' - the errors will occur persistently for tens of runs, and > then disappear for tens of runs. > > I was running Puppet 2.6.2 when the problem first appeared. I''ve > upgraded both master and client to 2.6.8 and the behaviour persists. > > This is the resource definition that is raising the errors: > > service { ''nslcd'': tag => [''weekday'',''services''], > enable => true, > ensure => running, > subscribe => [ File[''/etc/nslcd.conf''], File[''/ > etc/krb5.conf''] ], > } > > (error for the above is "err: Could not run Puppet configuration > client: Could not find dependency File[/etc/nslcd.conf] for > Service[nslcd] at /home/puppet/etc/development/modules/services/ > manifests/init.pp:105" - the client does not have nslcd installed, and > hence /etc/nslcd.conf is indeed missing)Where is the file resource /etc/nslcd.conf declared in the manifests? Any conditionals controlling that file resource? How is the class including /etc/nslcd.conf declared? Are you using tags to apply the manifests (or when you are running puppet agent)? Thanks, Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
tobyriddell
2011-May-20 09:07 UTC
[Puppet Users] Re: Intermittent errors for resource dependencies
Hi Nan, The /etc/nslcd.conf file is declared in a separate class called ''nss'': if ($osclass == ''rhel'') and ($operatingsystemrelease =~ /^6/) { # Push out nslcd.conf file{''/etc/nslcd.conf'': tag => [''weekday'',''name_service''], owner => ''root'', group => ''root'', mode => ''644'', ensure => present, content => template(''nslcd_conf.erb''), } } (the host in question is running RHEL 6.0 - there''s a similar ''osclass'' and ''operatingsystemrelease'' clause around the nslcd service definition.) I realise that the config. for the new host I''m working on doesn''t include the ''nss'' class so that would explain why the error appears in the first place (thanks for helping me track that down). But I still don''t have a grasp on why it''s intermittent... Toby On May 20, 1:05 am, Nan Liu <n...@puppetlabs.com> wrote:> On Thu, May 19, 2011 at 7:23 AM, tobyriddell <toby.ridd...@gmail.com> wrote: > > Hi all, > > > I''ve got a bit of a strange one here. I''m seeing intermittent errors > > for missing resource dependencies. I''m building up a Puppet config. > > for a new server, making changes gradually and running the puppet > > agent multiple times by hand to apply the changes. The behaviour I see > > is that the errors suddenly appear when I make an apparently unrelated > > change. > > > Just to be clear: I have no argument with the fact that my Puppet > > config. has problems in it (clearly dependencies must be present), > > it''s just that I''d expect the errors to be present the entire time > > rather than intermittent. > > > I''ve got ''filetimeout = 0'' set in puppet.conf on the master (and for > > good measure it''s set on the client too). The behaviour persists > > across puppet master restarts and multiple client runs, and it seems > > to ''latch'' - the errors will occur persistently for tens of runs, and > > then disappear for tens of runs. > > > I was running Puppet 2.6.2 when the problem first appeared. I''ve > > upgraded both master and client to 2.6.8 and the behaviour persists. > > > This is the resource definition that is raising the errors: > > > service { ''nslcd'': tag => [''weekday'',''services''], > > enable => true, > > ensure => running, > > subscribe => [ File[''/etc/nslcd.conf''], File[''/ > > etc/krb5.conf''] ], > > } > > > (error for the above is "err: Could not run Puppet configuration > > client: Could not find dependency File[/etc/nslcd.conf] for > > Service[nslcd] at /home/puppet/etc/development/modules/services/ > > manifests/init.pp:105" - the client does not have nslcd installed, and > > hence /etc/nslcd.conf is indeed missing) > > Where is the file resource /etc/nslcd.conf declared in the manifests? > Any conditionals controlling that file resource? How is the class > including /etc/nslcd.conf declared? Are you using tags to apply the > manifests (or when you are running puppet agent)? > > Thanks, > > Nan-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2011-May-20 13:13 UTC
[Puppet Users] Re: Intermittent errors for resource dependencies
On May 20, 4:07 am, tobyriddell <toby.ridd...@gmail.com> wrote:> I realise that the config. for the new host I''m working on doesn''t > include the ''nss'' class so that would explain why the error appears in > the first place (thanks for helping me track that down). > > But I still don''t have a grasp on why it''s intermittent...When the catlog is compiled successfully, does it actually contain the Service[''nslcd''] resource? And in that case, does it indeed *not* contain File[''/etc/nslcd.conf'']? I would be very surprised if both were so, and that would definitely constitute a bug. My guess, however, is that one or more of the following is true: 1) Your node''s facts are inconsistent from run to run; this would be surprising for Facter''s built-in facts, but it might arise from custom facts you have added. 2) Your manifests use one of the few Puppet features that are evaluation-order dependent. The result could be either that sometimes your "nss" class gets included when you thought it would not be, or that somtimes the class declaring Service[''nslcd''] is not included when you thought it would be. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.