これがバグなのか、何らかの誤用/設定ミスなのか、私にはわかりません。誰かが助けてくれることを願っています。ありがとう!
モジュールまたはマニフェスト ディレクトリ内のファイルを変更すると、多くの場合、次のようなエラーが発生します。
ノード上のクラスが見つかりませんでした
ノードに定義クラスが見つかりません
これらのエラーは、パペット モジュール/マニフェストが変更されたときに発生しますが、一度だけ発生します。これが発生した場合、影響を受けるパペット エージェントは、キャッシュされたカタログを 1 回使用します。次回これらのエージェントがカタログを要求すると、カタログは完璧にコンパイルされ、すべてが魔法のように機能し、すべてのエラーがなくなります. 問題は、大きなカタログを持つエージェントがいるということです。カタログの実行には最大で 1 分以上かかる場合があるため、変更が適用されるまでの時間が 2 倍になり、最大で 2 分または 3 分かかることもあります。
通常、モジュール/マニフェストの変更は「git pull」で行います。しかし、これらのエラー メッセージは、単純な「タッチ」操作で簡単に再現できます。いくつかの興味深いログ観察とその [共通点] を次に示します。はい AFAICS 彼らは常にトリプレットで表示されます。変更後にそのような問題がまったくないことはめったにありません。
> touch /opt/xxx/dev/puppet/manifests/site.pp
[often] puppet-master[12498]: Could not find class <class> for <node> on <node>
[often] puppet-master[12498]: Could not find class <class> for <node> on <node>
[often] puppet-master[12498]: Could not find class <class> for <node> on <node>
> タッチ /opt/xxx/dev/puppet/puppet.conf
[often] puppet-master[12498]: Could not find class <class> for <node> on <node>
[often] puppet-master[12498]: Could not find class <class> for <node> on <node>
[often] puppet-master[12498]: Could not find class <class> for <node> on <node>
[sometimes] puppet-master[12498]: Cannot find definition Class on node <node>
[sometimes] puppet-master[12498]: Cannot find definition Class on node <node>
[sometimes] puppet-master[12498]: Cannot find definition Class on node <node>
[rare] puppet-master[12498]: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type <own custom type> at <class file> on node <node>
[rare] puppet-master[12498]: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type <own custom type> at <class file> on node <node>
[rare] puppet-master[12498]: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type <own custom type> at <class file> on node <node>
> touch /opt/xxx/dev/puppet/modules/dispatcher/manifests/init.pp
[often] puppet-master[12498]: Could not find class <class not even part of module dispatcher> for <node not even affected by module dispatcher> on <node not even...>
[often] puppet-master[12498]: Could not find class <class not even part of module dispatcher> for <node not even affected by module dispatcher> on <node not even...>
[often] puppet-master[12498]: Could not find class <class not even part of module dispatcher> for <node not even affected by module dispatcher> on <node not even...>
影響を受けるクラスとノードはランダムに選択されているようです。
これが実行される環境:
> ll /etc/puppet
lrwxrwxrwx 1 root root 34 Mar 7 10:01 auth.conf -> /opt/xxx/dev/puppet/auth.conf
lrwxrwxrwx 1 root root 38 Mar 7 10:01 autosign.conf -> /opt/xxx/dev/puppet/autosign.conf
lrwxrwxrwx 1 root root 40 Mar 7 10:01 fileserver.conf -> /opt/xxx/dev/puppet/fileserver.conf
lrwxrwxrwx 1 root root 36 Mar 7 10:01 puppet.conf -> /opt/xxx/dev/puppet/puppet.conf
> ls -A /opt/xxx/dev/puppet/
auth.conf autosign.conf fileserver.conf .git .gitignore manifests modules .project puppet.conf scripts
> cat /etc/puppet/puppet.conf # on puppetmaster
[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
modulepath = /opt/xxx/dev/puppet/modules
manifestdir = /opt/xxx/dev/puppet/manifests
manifest = /opt/xxx/dev/puppet/manifests/site.pp
[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
server = <puppetmaster host>
report = true
splaylimit = 0
runinterval = 30
[master]
certname=<puppetmaster host>
reports = http,log
reportdir = /var/lib/puppet/reports/upload
reporturl = http://<puppetmaster host>:3000/reports
> cat /opt/xxx/dev/puppet/manifests/site.pp
import 'nodes.pp'
$puppetserver = <puppetmaster host>
> rpm -qa | egrep "puppet|ruby"
rubygem-rake-0.8.7-2.1.el6.noarch
ruby-mysql-2.8.2-1.el6.x86_64
libselinux-ruby-2.0.94-5.3.el6.x86_64
puppet-3.1.0-1.el6.noarch
rubygem-fastthread-1.0.7-2.el6.x86_64
rubygem-mongrel-1.1.5-3.el6.x86_64
ruby-1.8.7.352-7.el6_2.x86_64
ruby-irb-1.8.7.352-7.el6_2.x86_64
ruby-augeas-0.4.1-1.el6.x86_64
ruby-shadow-1.4.1-13.el6.x86_64
puppetlabs-release-6-6.noarch
rubygems-1.3.7-1.el6.noarch
puppet-server-3.1.0-1.el6.noarch
rubygem-gem_plugin-0.2.3-3.el6.noarch
rubygem-daemons-1.0.10-2.el6.noarch
puppet-dashboard-1.2.22-1.el6.noarch
ruby-libs-1.8.7.352-7.el6_2.x86_64
ruby-rdoc-1.8.7.352-7.el6_2.x86_64
rubygem-json-1.4.6-1.el6.x86_64