我正在為一個大型自訂木偶模組儲存庫進行重構專案。這包括從 puppet 2.x 到 3.2.4 的升級。當我最終達到臨界點並開始測試一些更改時,我很快就遇到了以下錯誤:
Info: Retrieving plugin
Info: Loading facts in /etc/puppet/modules/base/lib/facter/elversion.rb
Info: Loading facts in /etc/puppet/modules/base/lib/facter/site.rb
Info: Loading facts in /var/lib/puppet/lib/facter/elversion.rb
Info: Loading facts in /var/lib/puppet/lib/facter/site.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: stack level too deep at /etc/puppet/manifests/nodes.pp:9 on node puppet
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
在查看了各種 puppet bug 報告後,我決定嘗試簡化問題。我將問題縮小到兩類,定義如下:
class base::includes { }
和
class prod_secure::base::includes inherits base::includes { }
僅包含 prod_secure::base::includes 的節點會產生上面列出的錯誤輸出。我看到的唯一可能相關的警告puppet-lint
是:
WARNING: class inherits across module namespaces on line 1
……但這只是一個警告,我認為不應該在特工運行時使傀儡崩潰。有任何想法嗎?我設定的命名空間方案是否可能不受木偶支援?
更新
我決定進一步測試,並更改繼承類別的名稱。新的定義是:
class prod_secure::base2::includes2 inherits base::includes { }
結果是一樣的... stack level too deep
。在我看來這個問題與命名空間無關。
更新2
在上一輪調試過程中,我錯過了一個顯著的細節:
Wed Sep 11 11:25:09 -0400 2013 Puppet (info): Caching node for puppet
Wed Sep 11 11:25:09 -0400 2013 Puppet (debug): importing '/etc/puppet/manifests/nodes.pp' in environment production
Wed Sep 11 11:25:09 -0400 2013 Puppet (debug): importing '/etc/puppet/manifests/config_file.pp' in environment production
Wed Sep 11 11:25:10 -0400 2013 Puppet (debug): importing '/etc/puppet/modules/prod_secure/manifests/base2/includes2.pp' in environment production
Wed Sep 11 11:25:10 -0400 2013 Puppet (debug): Automatically imported prod_secure::base2::includes2 from prod_secure/base2/includes2 into production
Wed Sep 11 11:25:10 -0400 2013 Puppet (debug): importing '/etc/puppet/modules/prod_secure/manifests/base/includes.pp' in environment production
Wed Sep 11 11:25:10 -0400 2013 Puppet (debug): Automatically imported prod_secure::base::includes from prod_secure/base/includes into production
Wed Sep 11 11:25:10 -0400 2013 Puppet (err): stack level too deep at /etc/puppet/manifests/nodes.pp:9 on node puppet
Wrapped exception:
stack level too deep
我不能說我確定為什麼,但它仍在嘗試載入 prod_secure::base::includes,這就是有問題的條目。完全刪除該檔案後,測試通過。我又回到了命名空間理論......
答案1
您可能想嘗試 puppet 3.2.3。
3.2.2 有#21376類似的問題,但在3.2.3中已修復,可能是回歸