-1

我收到以下错误:

错误——:无法列出木偶环境:无法查询木偶查找环境 API(400):环境必须是纯字母数字,而不是“v2.0”

错误原因描述在: http ://projects.theforeman.org/projects/foreman/wiki/ERF12-2749

建议的解决方法:确保在使用 Puppet 3.6+ 和目录环境(“environmentpath”设置)时拥有 foreman-proxy 1.5.2 或更高版本。

我的环境拓扑

--- IP1 上带工头的傀儡大师

Puppet 3.7.5, foreman-1.8.2-1.el6.noarch, ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

--- 在连接到 IP1 的 IP2 上带有 Foreman 代理的 Puppet Master

Puppet 3.7.5, foreman-proxy-1.7.5-1.el6.noarch and ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

两个 puppet master 都配置为具有相同的目录环境路径。我可以从工头所在的 IP1 导入类。但不是来自仅安装了工头代理的 IP2。

我可以看到 IP2 注册到 IP1。

尝试从 IP1 上的工头导入来自 IP2 的 puppet 类会引发上述错误。

尝试从 IP1 列出 IP2 的 puppet 环境的命令:(这是为了复制我在 CLI 的工头中遇到的错误)

curl -vs \
  --key /var/lib/puppet/ssl/private_keys/ip2.dns.com.pem \
  --cacert /var/lib/puppet/ssl/certs/ca.pem \
  --cert /var/lib/puppet/ssl/certs/ip2-dns.com.pem  \
  https://ip2-dns.com:8443/puppet/environments

ip2 代理日志中报告的错误:

[root@ip2 httpd]# tail -f /var/log/foreman-proxy/proxy.log
E, [2015-09-10T14:52:10.201506 #24275] ERROR -- : Failed to list puppet environments: Failed to query Puppet find environments API (400): The environment must be purely alphanumeric, not 'v2.0'
ip1 - - [10/Sep/2015 14:52:10] "GET /environments HTTP/1.1" 406 143 1.8941
E, [2015-09-10T14:53:33.477247 #24275] ERROR -- : Failed to list puppet environments: Failed to query Puppet find environments API (400): The environment must be purely alphanumeric, not 'v2.0'
ip1 - - [10/Sep/2015 14:53:33] "GET /environments HTTP/1.1" 406 143 0.5582
E, [2015-09-10T14:56:59.390056 #24275] ERROR -- : Failed to list puppet environments: Failed to query Puppet find environments API (400): The environment must be purely alphanumeric, not 'v2.0'
ip1 - - [10/Sep/2015 14:56:59] "GET /environments HTTP/1.1" 406 143 0.5364
E, [2015-09-10T14:57:11.816250 #24275] ERROR -- : Failed to list puppet environments: Failed to query Puppet find environments API (400): The environment must be purely alphanumeric, not 'v2.0'
ip1 - - [10/Sep/2015 14:57:11] "GET /environments HTTP/1.1" 406 143 0.5434
E, [2015-09-11T09:18:12.636880 #24275] ERROR -- : Failed to list puppet environments: Failed to query Puppet find environments API (400): The environment must be purely alphanumeric, not 'v2.0'
ip1 - - [11/Sep/2015 09:18:12] "GET /environments HTTP/1.1" 406 143 0.5595

在工头中导入类时出错:

Warning!
ERF12-2749 [ProxyAPI::ProxyException]: Unable to get environments from Puppet ([RestClient::NotAcceptable]: 406 Not Acceptable) for proxy https://ip2:8443/puppet

如果您认为这是 Foreman 本身的错误,请使用 Foreman 票务系统打开一个新问题,您可能需要附加完整跟踪和相关日志条目。

ProxyAPI::ProxyException
ERF12-2749 [ProxyAPI::ProxyException]: Unable to get environments from Puppet ([RestClient::NotAcceptable]: 406 Not Acceptable) for proxy https://devci2-puppet.vzbi.com:8443/puppet
lib/proxy_api/puppet.rb:11:in `rescue in environments'
lib/proxy_api/puppet.rb:9:in `environments'
app/services/puppet_class_importer.rb:131:in `actual_environments'
app/services/puppet_class_importer.rb:23:in `changes'
app/controllers/concerns/foreman/controller/environments.rb:11:in `import_environments'
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call' 
4

1 回答 1

1

http://projects.theforeman.org/issues/11780

似乎问题是安装同时具有 puppet 包和 puppet gem。Puppet 包的版本是 2.7.x,puppet gem 的版本是 3.7.x

我将不得不纠正这个问题。

于 2015-09-15T09:16:00.847 回答