Forman-installer fails for Foreman_proxy Starting to evaluate the resource

Problem: forman-installer fails for Foreman_proxy Starting to evaluate the resource

Expected outcome: No error

Foreman and Proxy versions: Version 1.16.1 © 2009-2018 Paul Kelly and Ohad Levy

Foreman and Proxy plugin versions:

Other relevant data:

Hi , As I see from the logs , complete installation “foreman-installer” goes fine , and in the end it gives me error like below

[ INFO 2018-04-17 16:25:26 main]  /Stage[main]/Foreman_proxy::Register/Datacat_collector[foreman_proxy::enabled_features]: Evaluated in 0.01 seconds
[ INFO 2018-04-17 16:25:26 main]  /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[dev-pipe21.bbs.bunnings.com.au]: Starting to evaluate the resource
[DEBUG 2018-04-17 16:25:26 main]  Foreman_smartproxy[dev-pipe21.bbs.bunnings.com.au](provider=rest_v3): Making get request to https://dev-pipe21.bbs.bunnings.com.au/api/v2/smart_proxies?search=name=%22dev-pipe21.bbs.bunnings.com.au%22
[ERROR 2018-04-17 16:25:26 main]  /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[dev-pipe21.bbs.bunnings.com.au]: Could not evaluate: Exception Failed to open TCP connection to : (getaddrinfo: Name or service not known) in get request to: https://dev-pipe21.bbs.bunnings.com.au/api/v2/smart_proxies?search=name=%22dev-pipe21.bbs.bunnings.com.au%22
[ERROR 2018-04-17 16:25:26 main] /usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_resource/rest_v3.rb:89:in `rescue in request'
[ERROR 2018-04-17 16:25:26 main] /usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_resource/rest_v3.rb:71:in `request'
[ERROR 2018-04-17 16:25:26 main] /usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:6:in `proxy'
[ERROR 2018-04-17 16:25:26 main] /usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:13:in `id'
[ERROR 2018-04-17 16:25:26 main] /usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:17:in `exists?'
[ERROR 2018-04-17 16:25:26 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property/ensure.rb:81:in `retrieve'
[ERROR 2018-04-17 16:25:26 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1070:in `retrieve'

And after this , I am able to login to the forman web page .

But on the server where I have installed foreman/puppetmaster , I ran below command and it errored out

[root@dev-pipe21 ~]# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 500 on SERVER: Server Error: Failed to find dev-pipe21.bbs.bunnings.com.au via exec: Execution of '/etc/puppetlabs/puppet/node.rb dev-pipe21.bbs.bunnings.com.au' returned 1:
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node dev-pipe21.bbs.bunnings.com.au: Failed to find dev-pipe21.bbs.bunnings.com.au via exec: Execution of '/etc/puppetlabs/puppet/node.rb dev-pipe21.bbs.bunnings.com.au' returned 1:
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@dev-pipe21 ~]#


[root@dev-pipe21 ~]# /etc/puppetlabs/puppet/node.rb dev-pipe21.bbs.bunnings.com.au
During fact upload occured an exception: getaddrinfo: Name or service not known
Unable to read from Cache file: No such file or directory - /opt/puppetlabs/server/data/puppetserver/yaml/foreman/dev-pipe21.bbs.bunnings.com.au.yaml
[root@dev-pipe21 ~]#

Can anyone assist to identify what is the problem ? this may be 2 issues …

[root@dev-pipe21 ~]# /etc/puppetlabs/puppet/node.rb dev-pipe21.bbs.bunnings.com.au
During fact upload occured an exception: getaddrinfo: Name or service not known

“dev-pipe21.bbs.bunnings.com.au” is unknown and cannot be resolved to an ip address.

Thanks for your assistance.

I fail to understand from where it is unknown.

This is what i get from that servers nslookup

[root@dev-pipe21 ~]# nslookup

dev-pipe21
Server: 172.31.43.92
Address: 172.31.43.92#53

Name: dev-pipe21.bbs.bunnings.com.au
Address: 172.23.11.203

dev-pipe21.bbs.bunnings.com.au
Server: 172.31.43.92
Address: 172.31.43.92#53

Name: dev-pipe21.bbs.bunnings.com.au
Address: 172.23.11.203

172.23.11.203
Server: 172.31.43.92
Address: 172.31.43.92#53

203.11.23.172.in-addr.arpa name = dev-pipe21.bbs.bunnings.com.au.

i have also added this entry in /etc/hosts

172.23.11.203 dev-pipe21.bbs.bunnings.com.au dev-pipe21

still i get

[root@dev-pipe21 ~]# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 500 on SERVER: Server Error: Failed to find dev-pipe21.bbs.bunnings.com.au via exec: Execution of ‘/etc/puppetlabs/puppet/node.rb dev-pipe21.bbs.bunnings.com.au’ returned 1:
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node dev-pipe21.bbs.bunnings.com.au: Failed to find dev-pipe21.bbs.bunnings.com.au via exec: Execution of ‘/etc/puppetlabs/puppet/node.rb dev-pipe21.bbs.bunnings.com.au’ returned 1:
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@dev-pipe21 ~]# /etc/puppetlabs/puppet/node.rb dev-pipe21.bbs.bunnings.com.au
During fact upload occured an exception: getaddrinfo: Name or service not known
Unable to read from Cache file: No such file or directory - /opt/puppetlabs/server/data/puppetserver/yaml/foreman/dev-pipe21.bbs.bunnings.com.au.yaml

When I run "puppet agent -t " I get below logs in “/var/log/foreman/production.log”

2018-04-18 10:06:13 074ed101 [app] [I] Started POST "/api/hosts/facts" for 172.23.11.203 at 2018-04-18 10:06:13 +0800
2018-04-18 10:06:13 074ed101 [app] [I] Processing by Api::V2::HostsController#facts as JSON
2018-04-18 10:06:13 074ed101 [app] [I]   Parameters: {"facts"=>"[FILTERED]", "name"=>"dev-pipe21.bbs.bunnings.com.au", "certname"=>"dev-pipe21.bbs.bunnings.com.au", "apiv"=>"v2", :host=>{"certname"=>"dev-pipe21.bbs.bunnings.com.au", "name"=>"dev-pipe21.bbs.bunnings.com.au"}}
2018-04-18 10:06:13 074ed101 [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 10:06:13 074ed101 [app] [I]   Rendered api/v2/errors/access_denied.json.rabl within api/v2/layouts/error_layout (0.6ms)
2018-04-18 10:06:13 074ed101 [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 10:06:13 074ed101 [app] [I] Completed 403 Forbidden in 12ms (Views: 1.6ms | ActiveRecord: 0.7ms)
2018-04-18 10:06:13 14b7aaa6 [app] [I] Started GET "/node/dev-pipe21.bbs.bunnings.com.au?format=yml" for 172.23.11.203 at 2018-04-18 10:06:13 +0800
2018-04-18 10:06:13 14b7aaa6 [app] [I] Processing by HostsController#externalNodes as YML
2018-04-18 10:06:13 14b7aaa6 [app] [I]   Parameters: {"name"=>"dev-pipe21.bbs.bunnings.com.au"}
2018-04-18 10:06:13 14b7aaa6 [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 10:06:13 14b7aaa6 [app] [I] Redirected to https://dev-pipe21.bbs.bunnings.com.au/users/login
2018-04-18 10:06:13 14b7aaa6 [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 10:06:13 14b7aaa6 [app] [I] Completed 403 Forbidden in 11ms (ActiveRecord: 0.5ms)
2018-04-18 10:06:14 c479e85b [app] [I] Started POST "/api/hosts/facts" for 172.23.11.203 at 2018-04-18 10:06:14 +0800
2018-04-18 10:06:14 c479e85b [app] [I] Processing by Api::V2::HostsController#facts as JSON
2018-04-18 10:06:14 c479e85b [app] [I]   Parameters: {"facts"=>"[FILTERED]", "name"=>"dev-pipe21.bbs.bunnings.com.au", "certname"=>"dev-pipe21.bbs.bunnings.com.au", "apiv"=>"v2", :host=>{"certname"=>"dev-pipe21.bbs.bunnings.com.au", "name"=>"dev-pipe21.bbs.bunnings.com.au"}}
2018-04-18 10:06:14 c479e85b [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 10:06:14 c479e85b [app] [I]   Rendered api/v2/errors/access_denied.json.rabl within api/v2/layouts/error_layout (0.5ms)
2018-04-18 10:06:14 c479e85b [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 10:06:14 c479e85b [app] [I] Completed 403 Forbidden in 8ms (Views: 1.5ms | ActiveRecord: 0.6ms)
2018-04-18 10:06:14 9db900b8 [app] [I] Started GET "/node/dev-pipe21.bbs.bunnings.com.au?format=yml" for 172.23.11.203 at 2018-04-18 10:06:14 +0800
2018-04-18 10:06:14 9db900b8 [app] [I] Processing by HostsController#externalNodes as YML
2018-04-18 10:06:14 9db900b8 [app] [I]   Parameters: {"name"=>"dev-pipe21.bbs.bunnings.com.au"}
2018-04-18 10:06:14 9db900b8 [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 10:06:14 9db900b8 [app] [I] Redirected to https://dev-pipe21.bbs.bunnings.com.au/users/login
2018-04-18 10:06:14 9db900b8 [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 10:06:14 9db900b8 [app] [I] Completed 403 Forbidden in 11ms (ActiveRecord: 0.6ms)
2018-04-18 10:06:14 cf705803 [app] [I] Started POST "/api/config_reports" for 172.23.11.203 at 2018-04-18 10:06:14 +0800
2018-04-18 10:06:15 cf705803 [app] [I] Processing by Api::V2::ConfigReportsController#create as JSON
2018-04-18 10:06:15 cf705803 [app] [I]   Parameters: {"config_report"=>"[FILTERED]", "apiv"=>"v2"}
2018-04-18 10:06:15 cf705803 [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 10:06:15 cf705803 [app] [I]   Rendered api/v2/errors/access_denied.json.rabl within api/v2/layouts/error_layout (0.9ms)
2018-04-18 10:06:15 cf705803 [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 10:06:15 cf705803 [app] [I] Completed 403 Forbidden in 12ms (Views: 1.8ms | ActiveRecord: 0.7ms)

Also , I see

[root@dev-pipe21 ~]# host dev-pipe21.bbs.bunnings.com.au
dev-pipe21.bbs.bunnings.com.au has address 172.23.11.203
[root@dev-pipe21 ~]# host 172.23.11.203
203.11.23.172.in-addr.arpa domain name pointer dev-pipe21.bbs.bunnings.com.au.
[root@dev-pipe21 ~]#

Something is not right with my installations smart-proxy , not sure if i have understood smart-proxy correctly or not.

I thought may be give it a try to add a new host as puppet agent ( and assuming it will add that to foreman)
So , pointed this foreman server in puppet.conf , and did "puppet agent -t " on this new host and I get this

[root@dev-mado21 ~]# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 500 on SERVER: Server Error: Failed to find dev-mado21.bbs.bunnings.com.au via exec: Execution of '/etc/puppetlabs/puppet/node.rb dev-mado21.bbs.bunnings.com.au' returned 1:
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node dev-mado21.bbs.bunnings.com.au: Failed to find dev-mado21.bbs.bunnings.com.au via exec: Execution of '/etc/puppetlabs/puppet/node.rb dev-mado21.bbs.bunnings.com.au' returned 1:
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

At the same time , I get below in /var/log/foreman/production.log

2018-04-18 17:15:35 1d74e8c8 [app] [I]   Parameters: {"facts"=>"[FILTERED]", "name"=>"dev-mado21.bbs.bunnings.com.au", "certname"=>"dev-mado21.bbs.bunnings.com.au", "apiv"=>"v2", :host=>{"certname"=>"dev-mado21.bbs.bunnings.com.au", "name"=>"dev-mado21.bbs.bunnings.com.au"}}
2018-04-18 17:15:35 1d74e8c8 [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 17:15:35 1d74e8c8 [app] [I]   Rendered api/v2/errors/access_denied.json.rabl within api/v2/layouts/error_layout (0.6ms)
2018-04-18 17:15:35 1d74e8c8 [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 17:15:35 1d74e8c8 [app] [I] Completed 403 Forbidden in 10ms (Views: 1.7ms | ActiveRecord: 0.6ms)
2018-04-18 17:15:35 6b3305f4 [app] [I] Started GET "/node/dev-mado21.bbs.bunnings.com.au?format=yml" for 172.23.11.203 at 2018-04-18 17:15:35 +0800
2018-04-18 17:15:35 6b3305f4 [app] [I] Processing by HostsController#externalNodes as YML
2018-04-18 17:15:35 6b3305f4 [app] [I]   Parameters: {"name"=>"dev-mado21.bbs.bunnings.com.au"}
2018-04-18 17:15:35 6b3305f4 [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 17:15:35 6b3305f4 [app] [I] Redirected to https://dev-pipe21.bbs.bunnings.com.au/users/login
2018-04-18 17:15:35 6b3305f4 [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 17:15:35 6b3305f4 [app] [I] Completed 403 Forbidden in 11ms (ActiveRecord: 0.4ms)
2018-04-18 17:15:36 1c439935 [app] [I] Started POST "/api/hosts/facts" for 172.23.11.203 at 2018-04-18 17:15:36 +0800
2018-04-18 17:15:36 1c439935 [app] [I] Processing by Api::V2::HostsController#facts as JSON
2018-04-18 17:15:36 1c439935 [app] [I]   Parameters: {"facts"=>"[FILTERED]", "name"=>"dev-mado21.bbs.bunnings.com.au", "certname"=>"dev-mado21.bbs.bunnings.com.au", "apiv"=>"v2", :host=>{"certname"=>"dev-mado21.bbs.bunnings.com.au", "name"=>"dev-mado21.bbs.bunnings.com.au"}}
2018-04-18 17:15:36 1c439935 [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 17:15:36 1c439935 [app] [I]   Rendered api/v2/errors/access_denied.json.rabl within api/v2/layouts/error_layout (0.5ms)
2018-04-18 17:15:36 1c439935 [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 17:15:36 1c439935 [app] [I] Completed 403 Forbidden in 8ms (Views: 1.5ms | ActiveRecord: 0.8ms)
2018-04-18 17:15:36 b51c266b [app] [I] Started GET "/node/dev-mado21.bbs.bunnings.com.au?format=yml" for 172.23.11.203 at 2018-04-18 17:15:36 +0800
2018-04-18 17:15:36 b51c266b [app] [I] Processing by HostsController#externalNodes as YML
2018-04-18 17:15:36 b51c266b [app] [I]   Parameters: {"name"=>"dev-mado21.bbs.bunnings.com.au"}
2018-04-18 17:15:36 b51c266b [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 17:15:36 b51c266b [app] [I] Redirected to https://dev-pipe21.bbs.bunnings.com.au/users/login
2018-04-18 17:15:36 b51c266b [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 17:15:36 b51c266b [app] [I] Completed 403 Forbidden in 12ms (ActiveRecord: 0.9ms)
2018-04-18 17:15:36 12c87248 [app] [I] Started POST "/api/config_reports" for 172.23.11.203 at 2018-04-18 17:15:36 +0800
2018-04-18 17:15:36 12c87248 [app] [I] Processing by Api::V2::ConfigReportsController#create as JSON
2018-04-18 17:15:36 12c87248 [app] [I]   Parameters: {"config_report"=>"[FILTERED]", "apiv"=>"v2"}
2018-04-18 17:15:36 12c87248 [app] [W] No smart proxy server found on ["dev-pipe21.bbs.bunnings.com.au", "puppet", "puppet.bbs.bunnings.com.au"] and is not in trusted_puppetmaster_hosts
2018-04-18 17:15:36 12c87248 [app] [I]   Rendered api/v2/errors/access_denied.json.rabl within api/v2/layouts/error_layout (0.7ms)
2018-04-18 17:15:36 12c87248 [app] [I] Filter chain halted as # rendered or redirected
2018-04-18 17:15:36 12c87248 [app] [I] Completed 403 Forbidden in 19ms (Views: 1.7ms | ActiveRecord: 1.5ms)

Really appreciate if someone can assist.

I can attach the bundle I have collected by running foreman-debug.

It was strange that this portal didn’t allow uploading foreman-debug-oUfb7.tar.xz saying unsupported extension

Aah and then it says , new users cannot upload the attachment.

Alright :slight_smile:

I believe I need to sort this error first

 /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[dev-pipe21.bbs.bunnings.com.au]: Could not evaluate: Exception Failed to open TCP connection to : (getaddrinfo: Name or service not known) in get request to: https://dev-pipe21.bbs.bunnings.com.au/api/v2/smart_proxies?search=name=%22dev-pipe21.bbs.bunnings.com.au%22

And then I was able to solve this issue by myself.

What I had to do … Regenerate ssl certificates on puppet master , and restart all the services like , puppetserver,foreman,foreman-proxy,httpd.

I am doing POC on Ansible AWX and Foreman, Hope will get some support from community whenever got stuck.