treydock
2011-Jul-12 10:23 UTC
[Puppet Users] Seemingly random failures after 2.7.1 upgrade
I recently upgraded my Puppetmaster to 2.7.1, and am now having what seem to be random puppet run failures on almost all my nodes. All nodes except the actual puppetmaster are running 2.6.8. Right now I will get alerted about a failure, then log into that system and do a manual run, which will succeed. Then maybe a few hours later another run will fail, and nothing has changed on the puppetmaster. So far two modules seem to be the most frequent failures. Here''s the error from puppet-dashboard on a 2.6.8 client err Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class zabbix::agent for puppetclient0.domain at /etc/puppet/manifests/nodes.pp:177 on node puppetclient0.domain Puppet 2011-07-12 05:04 CDT err Could not retrieve catalog; skipping run Puppet 2011-07-12 05:04 CDT notice Using cached catalog That module is a bit large to paste in here, but it can be viewed at https://github.com/treydock/puppet-zabbix. The other failures are on similarly designed modules and I''ve also noticed that one very basic modules seem to be failing randomly on two clients, both are 2.6.8 -------- err Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class kvm::host for puppetclient1.domain at / etc/puppet/manifests/roles.pp:35 on node puppetclient1.domain Puppet 2011-07-12 05:08 CDT err Could not retrieve catalog; skipping run Puppet 2011-07-12 05:08 CDT notice Using cached catalog ---------- Here''s the module... # manifests/init.pp import "classes/*.pp" class kvm { } # manifests/classes/host.pp class kvm::host { package {''libvirt'': ensure => installed, } service { ''libvirtd'': enable => true, ensure => running, require => Package[''libvirt'']; } logrotate::file { ''libvirtd'': log => ''/var/log/libvirt/qemu/*.log'', interval => ''weekly'', rotation => ''52'', archive => ''true'', minsize => ''100k'', options => [ ''missingok'', ''notifempty'', ''sharedscripts'', ''dateext'', ''copytruncate'' ], } } Is using an empty class in init.pp problematic ? All of these modules worked just fine before going from 2.6.8 to 2.7.1. Thanks - Trey -- 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.
Peter Meier
2011-Jul-13 06:29 UTC
Re: [Puppet Users] Seemingly random failures after 2.7.1 upgrade
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> Is using an empty class in init.pp problematic ? All of these modules > worked just fine before going from 2.6.8 to 2.7.1.I have no idea, whether this is the problem. But why do you do:> # manifests/init.pp > import "classes/*.pp" > > class kvm { > } > > > # manifests/classes/host.pp > class kvm::host {? Why not just have one file manifests/host.pp that contains the kvm::host class? Everything else is not really necessary. Puppet has quite a powerfull autoloading feature of classes and I think it can be seen as a general best practice to have one class in a file in its corresponding path on the filesystem. With your current way you would need a global import kvm, so that the init.pp class is actually parsed, so that the files in classes/ are imported. If this is not the case and the kvm::host class is not in a file that can be found by the autoloader it won''t find the class. This becomes even trickier as other hosts can now interfere which classes are available while compiling the next hosts classes, as an import statement might only have been executed if Host A is compiled and only this would then make these "imported" classes that Host B requires available. Actually, I remember that the autoloader should also look into init.pp for the kvm::host class. But it''s possible that something like that might have changed in 2.7. But I don''t know it. Due to these two reasones (magic availability of classes, possible changes in how classes become available in 2.7) I would generally recommend to *not* use import statements and instead use puppet''s autoloading feature. They''re rather hard to debug. ~pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4dOygACgkQbwltcAfKi39akACcCwslVzxzrTy3/H0r7kGyi4dB M4gAn1LHtc/LGk7OtbVfDolhm5cXwm/p =lWHm -----END PGP SIGNATURE----- -- 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.
Nigel Kersten
2011-Jul-13 14:03 UTC
Re: [Puppet Users] Seemingly random failures after 2.7.1 upgrade
On Tue, Jul 12, 2011 at 11:29 PM, Peter Meier <peter.meier@immerda.ch>wrote:> > Puppet has quite a powerfull autoloading feature of classes and I think > it can be seen as a general best practice to have one class in a file in > its corresponding path on the filesystem. > >What he said. :) Life really does become a lot simpler if you avoid ''import'' everywhere you can and just rely upon the class autoloader. -- Nigel Kersten Product Manager, Puppet Labs Twitter: @nigelkersten *Join us for **PuppetConf *<http://www.bit.ly/puppetconfsig> September 22nd and 23rd in Portland, Oregon, USA. * * -- 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.
Gus
2011-Jul-13 21:26 UTC
[Puppet Users] Re: Seemingly random failures after 2.7.1 upgrade
Hi! I''ve also noticed this (weird) behaviour. I am planning an (huge) upgrade (from 0.25.x to 2.7.1) in all my puppet''s boxes... I''ve installed puppet''s 2.7.1 gem and got a lot of "Could not find class" problem... and everything worked just fine with 0.25.x. So, I decided to uninstall the gem for version 2.7.1 and install puppet version 2.6.9. Everything worked just fine... no weird "Could not find class" problem... am I missing something? Thanks in advance, Gus On Jul 13, 11:03 am, Nigel Kersten <ni...@puppetlabs.com> wrote:> On Tue, Jul 12, 2011 at 11:29 PM, Peter Meier <peter.me...@immerda.ch>wrote: > > > > > Puppet has quite a powerfull autoloading feature of classes and I think > > it can be seen as a general best practice to have one class in a file in > > its corresponding path on the filesystem. > > What he said. :) > > Life really does become a lot simpler if you avoid ''import'' everywhere you > can and just rely upon the class autoloader. > > -- > Nigel Kersten > Product Manager, Puppet Labs > Twitter: @nigelkersten > > *Join us for **PuppetConf *<http://www.bit.ly/puppetconfsig> > September 22nd and 23rd in Portland, Oregon, USA. > * > *-- 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.
treydock
2011-Jul-14 11:57 UTC
[Puppet Users] Re: Seemingly random failures after 2.7.1 upgrade
I think the way I posted the contents of the modules may have been misleading, as I do actually have each class in it''s own file so kvm::host class has it''s own host.pp file. So far I''ve actually noticed this problem only on my modules that make use of the autoloading, so each class in it''s own *.pp file. Not all my modules suffer from this, but that''s one common thing among the ones that do fail. I''m in the process of moving my other modules to that layout as they currently have all classes in init.pp, but interestingly enough none of those modules have had random failures. - Trey On Jul 13, 1:29 am, Peter Meier <peter.me...@immerda.ch> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > Is using an empty class in init.pp problematic ? All of these modules > > worked just fine before going from 2.6.8 to 2.7.1. > > I have no idea, whether this is the problem. But why do you do: > > > # manifests/init.pp > > import "classes/*.pp" > > > class kvm { > > } > > > # manifests/classes/host.pp > > class kvm::host { > > ? > > Why not just have one file manifests/host.pp that contains the kvm::host > class? Everything else is not really necessary. > > Puppet has quite a powerfull autoloading feature of classes and I think > it can be seen as a general best practice to have one class in a file in > its corresponding path on the filesystem. > > With your current way you would need a global import kvm, so that the > init.pp class is actually parsed, so that the files in classes/ are > imported. > If this is not the case and the kvm::host class is not in a file that > can be found by the autoloader it won''t find the class. > > This becomes even trickier as other hosts can now interfere which > classes are available while compiling the next hosts classes, as an > import statement might only have been executed if Host A is compiled and > only this would then make these "imported" classes that Host B requires > available. > > Actually, I remember that the autoloader should also look into init.pp > for the kvm::host class. But it''s possible that something like that > might have changed in 2.7. But I don''t know it. > > Due to these two reasones (magic availability of classes, possible > changes in how classes become available in 2.7) I would generally > recommend to *not* use import statements and instead use puppet''s > autoloading feature. They''re rather hard to debug. > > ~pete > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ > > iEYEARECAAYFAk4dOygACgkQbwltcAfKi39akACcCwslVzxzrTy3/H0r7kGyi4dB > M4gAn1LHtc/LGk7OtbVfDolhm5cXwm/p > =lWHm > -----END PGP SIGNATURE------- 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.
Gustavo Soares
2011-Jul-14 14:34 UTC
Re: [Puppet Users] Re: Seemingly random failures after 2.7.1 upgrade
Hi Trey, same problem for me.. I''ve notice the problem on modules using autoloading... I think I will stick to version 2.6.9... Gus On Thu, Jul 14, 2011 at 8:57 AM, treydock <treydock@gmail.com> wrote:> I think the way I posted the contents of the modules may have been > misleading, as I do actually have each class in it''s own file so > kvm::host class has it''s own host.pp file. So far I''ve actually > noticed this problem only on my modules that make use of the > autoloading, so each class in it''s own *.pp file. Not all my modules > suffer from this, but that''s one common thing among the ones that do > fail. I''m in the process of moving my other modules to that layout as > they currently have all classes in init.pp, but interestingly enough > none of those modules have had random failures. > > - Trey > > > On Jul 13, 1:29 am, Peter Meier <peter.me...@immerda.ch> wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > > Is using an empty class in init.pp problematic ? All of these modules > > > worked just fine before going from 2.6.8 to 2.7.1. > > > > I have no idea, whether this is the problem. But why do you do: > > > > > # manifests/init.pp > > > import "classes/*.pp" > > > > > class kvm { > > > } > > > > > # manifests/classes/host.pp > > > class kvm::host { > > > > ? > > > > Why not just have one file manifests/host.pp that contains the kvm::host > > class? Everything else is not really necessary. > > > > Puppet has quite a powerfull autoloading feature of classes and I think > > it can be seen as a general best practice to have one class in a file in > > its corresponding path on the filesystem. > > > > With your current way you would need a global import kvm, so that the > > init.pp class is actually parsed, so that the files in classes/ are > > imported. > > If this is not the case and the kvm::host class is not in a file that > > can be found by the autoloader it won''t find the class. > > > > This becomes even trickier as other hosts can now interfere which > > classes are available while compiling the next hosts classes, as an > > import statement might only have been executed if Host A is compiled and > > only this would then make these "imported" classes that Host B requires > > available. > > > > Actually, I remember that the autoloader should also look into init.pp > > for the kvm::host class. But it''s possible that something like that > > might have changed in 2.7. But I don''t know it. > > > > Due to these two reasones (magic availability of classes, possible > > changes in how classes become available in 2.7) I would generally > > recommend to *not* use import statements and instead use puppet''s > > autoloading feature. They''re rather hard to debug. > > > > ~pete > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.11 (GNU/Linux) > > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ > > > > iEYEARECAAYFAk4dOygACgkQbwltcAfKi39akACcCwslVzxzrTy3/H0r7kGyi4dB > > M4gAn1LHtc/LGk7OtbVfDolhm5cXwm/p > > =lWHm > > -----END PGP SIGNATURE----- > > -- > 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. > >-- 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.
Nigel Kersten
2011-Jul-14 14:59 UTC
Re: [Puppet Users] Re: Seemingly random failures after 2.7.1 upgrade
On Wed, Jul 13, 2011 at 2:26 PM, Gus <gustavosoares@gmail.com> wrote:> Hi! > > I''ve also noticed this (weird) behaviour. I am planning an (huge) > upgrade (from 0.25.x to 2.7.1) in all my puppet''s boxes... > > I''ve installed puppet''s 2.7.1 gem and got a lot of "Could not find > class" problem... and everything worked just fine with 0.25.x. > > So, I decided to uninstall the gem for version 2.7.1 and install > puppet version 2.6.9. > > Everything worked just fine... no weird "Could not find class" > problem... > > am I missing something? >You need to give us a few more details. * name of the classes that are failing and succeeding autoloading * How you''re declaring the classes (include vs parameterized class declaration) * the file paths that contain the classes that fail and succeed * some info about the modulepath for this environment. * whether you''re using ''import'' anywhere.> > Thanks in advance, > Gus > > On Jul 13, 11:03 am, Nigel Kersten <ni...@puppetlabs.com> wrote: > > On Tue, Jul 12, 2011 at 11:29 PM, Peter Meier <peter.me...@immerda.ch > >wrote: > > > > > > > > > Puppet has quite a powerfull autoloading feature of classes and I think > > > it can be seen as a general best practice to have one class in a file > in > > > its corresponding path on the filesystem. > > > > What he said. :) > > > > Life really does become a lot simpler if you avoid ''import'' everywhere > you > > can and just rely upon the class autoloader. > > > > -- > > Nigel Kersten > > Product Manager, Puppet Labs > > Twitter: @nigelkersten > > > > *Join us for **PuppetConf *<http://www.bit.ly/puppetconfsig> > > September 22nd and 23rd in Portland, Oregon, USA. > > * > > * > > -- > 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. > >-- Nigel Kersten Product Manager, Puppet Labs Twitter: @nigelkersten *Join us for **PuppetConf *<http://www.bit.ly/puppetconfsig> September 22nd and 23rd in Portland, Oregon, USA. * * -- 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.
Gustavo Soares
2011-Jul-14 18:30 UTC
Re: [Puppet Users] Re: Seemingly random failures after 2.7.1 upgrade
Hi Nigel, here we go... * all my classes are "included" (I was still using 0.25.x...) * In my $confdir/manifests/classes/roles I have a very generic class for all puppet hosts declared as follow: class role_puppet_common { $role = "puppet_common" include common include puppet::common include puppet::user } in $confdir/manifests/site.pp I have the following line... [...] import "classes/roles/*" [...] the weird "Could not find class" problem occurs for class puppet::common my directory structure is as follow: ... $confdir/modules/puppet/ $confdir/modules/puppet/manifests $confdir/modules/puppet/manifests/init.pp $confdir/modules/puppet/manifests/classes/ $confdir/modules/puppet/manifests/classes/common.pp ... in $confdir/modules/puppet/manifests/init.pp I have: import "puppet/classes/*" and in $confdir/modules/puppet/manifests/classes/common.pp class puppet::common { ... } * my modulepath declared in puppet.conf is as follow: modulepath = /mnt/puppet/conf/modules:/mnt/puppet/othermodules where /mnt/puppet/conf is set to $confdir. That''s it! As I said before, when I downgraded to version 2.6.9 everything worked fine. Thanks in advance, Gus On Thu, Jul 14, 2011 at 11:59 AM, Nigel Kersten <nigel@puppetlabs.com>wrote:> > > On Wed, Jul 13, 2011 at 2:26 PM, Gus <gustavosoares@gmail.com> wrote: > >> Hi! >> >> I''ve also noticed this (weird) behaviour. I am planning an (huge) >> upgrade (from 0.25.x to 2.7.1) in all my puppet''s boxes... >> >> I''ve installed puppet''s 2.7.1 gem and got a lot of "Could not find >> class" problem... and everything worked just fine with 0.25.x. >> >> So, I decided to uninstall the gem for version 2.7.1 and install >> puppet version 2.6.9. >> >> Everything worked just fine... no weird "Could not find class" >> problem... >> >> am I missing something? >> > > You need to give us a few more details. > > * name of the classes that are failing and succeeding autoloading >* How you''re declaring the classes (include vs parameterized class> declaration) >* the file paths that contain the classes that fail and succeed> * some info about the modulepath for this environment. > * whether you''re using ''import'' anywhere. > > > > > >> >> Thanks in advance, >> Gus >> >> On Jul 13, 11:03 am, Nigel Kersten <ni...@puppetlabs.com> wrote: >> > On Tue, Jul 12, 2011 at 11:29 PM, Peter Meier <peter.me...@immerda.ch >> >wrote: >> > >> > >> > >> > > Puppet has quite a powerfull autoloading feature of classes and I >> think >> > > it can be seen as a general best practice to have one class in a file >> in >> > > its corresponding path on the filesystem. >> > >> > What he said. :) >> > >> > Life really does become a lot simpler if you avoid ''import'' everywhere >> you >> > can and just rely upon the class autoloader. >> > >> > -- >> > Nigel Kersten >> > Product Manager, Puppet Labs >> > Twitter: @nigelkersten >> > >> > *Join us for **PuppetConf *<http://www.bit.ly/puppetconfsig> >> > September 22nd and 23rd in Portland, Oregon, USA. >> > * >> > * >> >> -- >> 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. >> >> > > > -- > Nigel Kersten > Product Manager, Puppet Labs > Twitter: @nigelkersten > > *Join us for **PuppetConf *<http://www.bit.ly/puppetconfsig> > September 22nd and 23rd in Portland, Oregon, USA. > * > * > > -- > 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. >-- 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.
Peter Meier
2011-Jul-15 10:59 UTC
Re: [Puppet Users] Re: Seemingly random failures after 2.7.1 upgrade
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> same problem for me.. I''ve notice the problem on modules using > autoloading... > > I think I will stick to version 2.6.9...can you at least file a detailed bug report? Thanks! Otherwise the situation can''t be really improved... ~pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4gHX4ACgkQbwltcAfKi3/GXQCgpZMNyTEiV1USVG1qpxgCh3mE +S8AoJnCLIYreiOg3bXr1zf4u56eZivk =NF0L -----END PGP SIGNATURE----- -- 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.
Gustavo Soares
2011-Jul-15 17:13 UTC
Re: [Puppet Users] Re: Seemingly random failures after 2.7.1 upgrade
done! http://projects.puppetlabs.com/issues/8433 Gus On Fri, Jul 15, 2011 at 7:59 AM, Peter Meier <peter.meier@immerda.ch> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > same problem for me.. I''ve notice the problem on modules using > > autoloading... > > > > I think I will stick to version 2.6.9... > > can you at least file a detailed bug report? Thanks! Otherwise the > situation can''t be really improved... > > ~pete > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk4gHX4ACgkQbwltcAfKi3/GXQCgpZMNyTEiV1USVG1qpxgCh3mE > +S8AoJnCLIYreiOg3bXr1zf4u56eZivk > =NF0L > -----END PGP SIGNATURE----- > > -- > 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. > >-- 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.