Foreman node.rb error 404 Not Found

I have foreman 1.2 installed, it is new setup and getting following error

[root@puppet ~]# puppet agent -t
> Warning: Unable to fetch my node definition, but the agent run will
> continue:
> Warning: Error 400 on SERVER: Failed to find puppet.example.com via exec:
> Execution of '/etc/puppet/node.rb puppet.example.com' returned 1: — false
>
> Info: Retrieving plugin
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Failed when searching for node puppet.example.com: Failed to find
> puppet.outcome.com via exec: Execution of '/etc/puppet/node.rb
> puppet.example.com' returned 1: — false
>
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
> [root@puppet ~]#
>

Debug logs

Started GET "/node/puppet.example.com?format=yml" for 10.101.20.15 at
> 2014-03-25 16:20:17 -0400
> Processing by HostsController#externalNodes as YML
> Parameters: {"name"=>"puppet.example.com"}
> SmartProxy Load (0.8ms) SELECT smart_proxies.* FROM smart_proxies
> INNER JOIN features_smart_proxies ON
> features_smart_proxies.smart_proxy_id = smart_proxies.id INNER JOIN
> features ON features.id = features_smart_proxies.feature_id WHERE
> features.name = 'Puppet' ORDER BY smart_proxies.name
> Verifying request from ["puppet.example.com"] against
> ["puppet.example.com"]
> User Load (0.4ms) SELECT users.* FROM users WHERE users.login =
> 'admin' LIMIT 1
> Setting current user thread-local variable to admin
> Host::Managed Load (0.7ms) SELECT hosts.* FROM hosts WHERE
> hosts.type IN ('Host::Managed') AND hosts.certname =
> 'puppet.example.com' LIMIT 1
> Host::Managed Load (0.6ms) SELECT hosts.* FROM hosts WHERE
> hosts.type IN ('Host::Managed') AND hosts.name =
> 'puppet.example.com' LIMIT 1
> Completed 404 Not Found in 15ms (ActiveRecord: 2.6ms)
>
>
> Started POST "/api/hosts/facts" for 10.101.20.15 at 2014-03-25 16:20:18
> -0400
> Processing by Api::V1::HomeController#route_error as JSON
> Parameters: {"name"=>"puppet.example.com",
> "certname"=>"puppet.example.com", "facts"=>"[FILTERED]",
> "other"=>"hosts/facts", "home"=>{"name"=>"puppet.example.com",
> "certname"=>"puppet.example.com", "facts"=>"[FILTERED]"}}
> Rendered api/v1/errors/unauthorized.json.rabl (0.9ms)
> Filter chain halted as :authorize rendered or redirected
> Completed 401 Unauthorized in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)
>
>
> Started GET "/node/puppet.example.com?format=yml" for 10.101.20.15 at
> 2014-03-25 16:20:18 -0400
> Processing by HostsController#externalNodes as YML
> Parameters: {"name"=>"puppet.example.com"}
> SmartProxy Load (0.7ms) SELECT smart_proxies.* FROM smart_proxies
> INNER JOIN features_smart_proxies ON
> features_smart_proxies.smart_proxy_id = smart_proxies.id INNER JOIN
> features ON features.id = features_smart_proxies.feature_id WHERE
> features.name = 'Puppet' ORDER BY smart_proxies.name
> Verifying request from ["puppet.example.com"] against
> ["puppet.example.com"]
> User Load (0.4ms) SELECT users.* FROM users WHERE users.login =
> 'admin' LIMIT 1
> Setting current user thread-local variable to admin
> Host::Managed Load (0.6ms) SELECT hosts.* FROM hosts WHERE
> hosts.type IN ('Host::Managed') AND hosts.certname =
> 'puppet.example.com' LIMIT 1
> Host::Managed Load (0.8ms) SELECT hosts.* FROM hosts WHERE
> hosts.type IN ('Host::Managed') AND hosts.name =
> 'puppet.example.com' LIMIT 1
> Completed 404 Not Found in 12ms (ActiveRecord: 2.5ms)
>

Manually running node.rb

[root@puppet ~]# /etc/puppet/node.rb puppet.outcome.com

··· > --- false > Error retrieving node puppet.outcome.com: Net::HTTPNotFound > [root@puppet ~]# >

It looks like you have a node.rb file that's designed for use with
Foreman 1.3 or higher, but are using Foreman 1.2.

Foreman 1.4 is the current stable version, so I'm unsure why you're
using 1.2. If you're determined to use this version, then this is the
template for the old node.rb file that you'll need:

https://raw.github.com/theforeman/puppet-foreman/master/templates/external_node_v1.rb.erb

Else I'd strongly recommend installing Foreman 1.4 instead.

··· -- Dominic Cleal Red Hat Engineering

On 25/03/14 20:22, satish patel wrote:

I have foreman 1.2 installed, it is new setup and getting following error

[root@puppet ~]# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will
continue:
Warning: Error 400 on SERVER: Failed to find puppet.example.com via
exec: Execution of '/etc/puppet/node.rb puppet.example.com' returned
1: --- false

Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: Failed when searching for node puppet.example.com: Failed to
find puppet.outcome.com via exec: Execution of '/etc/puppet/node.rb
puppet.example.com' returned 1: --- false

Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@puppet ~]#

Debug logs

Started GET "/node/puppet.example.com?format=yml" for 10.101.20.15
at 2014-03-25 16:20:17 -0400
Processing by HostsController#externalNodes as YML
  Parameters: {"name"=>"puppet.example.com"}
  SmartProxy Load (0.8ms)  SELECT `smart_proxies`.* FROM
`smart_proxies` INNER JOIN `features_smart_proxies` ON
`features_smart_proxies`.`smart_proxy_id` = `smart_proxies`.`id`
INNER JOIN `features` ON `features`.`id` =
`features_smart_proxies`.`feature_id` WHERE `features`.`name` =
'Puppet' ORDER BY smart_proxies.name
Verifying request from ["puppet.example.com"] against
["puppet.example.com"]
  User Load (0.4ms)  SELECT `users`.* FROM `users` WHERE
`users`.`login` = 'admin' LIMIT 1
Setting current user thread-local variable to admin
  Host::Managed Load (0.7ms)  SELECT `hosts`.* FROM `hosts` WHERE
`hosts`.`type` IN ('Host::Managed') AND `hosts`.`certname` =
'puppet.example.com' LIMIT 1
  Host::Managed Load (0.6ms)  SELECT `hosts`.* FROM `hosts` WHERE
`hosts`.`type` IN ('Host::Managed') AND `hosts`.`name` =
'puppet.example.com' LIMIT 1
Completed 404 Not Found in 15ms (ActiveRecord: 2.6ms)


Started POST "/api/hosts/facts" for 10.101.20.15 at 2014-03-25
16:20:18 -0400
Processing by Api::V1::HomeController#route_error as JSON
  Parameters: {"name"=>"puppet.example.com",
"certname"=>"puppet.example.com", "facts"=>"[FILTERED]",
"other"=>"hosts/facts", "home"=>{"name"=>"puppet.example.com",
"certname"=>"puppet.example.com", "facts"=>"[FILTERED]"}}
  Rendered api/v1/errors/unauthorized.json.rabl (0.9ms)
Filter chain halted as :authorize rendered or redirected
Completed 401 Unauthorized in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)


Started GET "/node/puppet.example.com?format=yml" for 10.101.20.15
at 2014-03-25 16:20:18 -0400
Processing by HostsController#externalNodes as YML
  Parameters: {"name"=>"puppet.example.com"}
  SmartProxy Load (0.7ms)  SELECT `smart_proxies`.* FROM
`smart_proxies` INNER JOIN `features_smart_proxies` ON
`features_smart_proxies`.`smart_proxy_id` = `smart_proxies`.`id`
INNER JOIN `features` ON `features`.`id` =
`features_smart_proxies`.`feature_id` WHERE `features`.`name` =
'Puppet' ORDER BY smart_proxies.name
Verifying request from ["puppet.example.com"] against
["puppet.example.com"]
  User Load (0.4ms)  SELECT `users`.* FROM `users` WHERE
`users`.`login` = 'admin' LIMIT 1
Setting current user thread-local variable to admin
  Host::Managed Load (0.6ms)  SELECT `hosts`.* FROM `hosts` WHERE
`hosts`.`type` IN ('Host::Managed') AND `hosts`.`certname` =
'puppet.example.com' LIMIT 1
  Host::Managed Load (0.8ms)  SELECT `hosts`.* FROM `hosts` WHERE
`hosts`.`type` IN ('Host::Managed') AND `hosts`.`name` =
'puppet.example.com' LIMIT 1
Completed 404 Not Found in 12ms (ActiveRecord: 2.5ms)

Manually running node.rb

[root@puppet ~]# /etc/puppet/node.rb puppet.outcome.com
--- false
Error retrieving node puppet.outcome.com: Net::HTTPNotFound
[root@puppet ~]#


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto:foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.