Bug #474
closed0.1-6 does not add a node automatically on initial report
Description
Usually, if Foreman receives a report from a client that does not exist, it will create the node. I can no longer get this functionality to work.
OS: RHEL6/x86_64
Puppet: 2.6.3
--
Report that client sends:
--- !ruby/object:Puppet::Transaction::Report
external_times: {}
host: rhel6n01.corp.com
logs:
- !ruby/object:Puppet::Util::Log
level: !ruby/sym err
message: "Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find node 'rhel6n01.corp.com'; cannot compile"
source: Puppet
tags:
- err
time: 2010-11-18 20:39:11.487700 -06:00
version: &id001 2.6.3
- !ruby/object:Puppet::Util::Log
level: !ruby/sym notice
message: Using cached catalog
source: Puppet
tags:
- notice
time: 2010-11-18 20:39:11.488888 -06:00
version: *id001
- !ruby/object:Puppet::Util::Log
level: !ruby/sym err
message: Could not retrieve catalog; skipping run
source: Puppet
tags:
- err
time: 2010-11-18 20:39:11.489098 -06:00
version: *id001
metrics: {}
resource_statuses: {}
time: 2010-11-18 20:39:04.979613 -06:00
--
Output from production.log with debugging:
Processing HostsController#externalNodes to yml (for 172.26.101.160 at 2010-11-18 14:24:59) [GET]
Parameters: {"name"=>"rhel6n01.corp.follett.com", "format"=>"yml", "action"=>"externalNodes", "controller"=>"hosts"}
User Load (0.9ms) SELECT * FROM "users" WHERE ("users"."login" = 'admin') LIMIT 1
Host Load (0.4ms) SELECT * FROM "hosts" WHERE ("hosts"."name" = 'rhel6n01.corp.com') LIMIT 1
Completed in 8ms (View: 0, DB: 2) | 404 Not Found [http://fc-pupm01.corp.com/node/rhel6n01.corp.?format=yml]
Processing ReportsController#create (for 172.26.101.160 at 2010-11-18 14:24:59) [POST]
Parameters: {"report"=>"[FILTERED]", "action"=>"create", "controller"=>"reports"}
User Load (0.9ms) SELECT * FROM "users" WHERE ("users"."login" = 'admin') LIMIT 1
processing report for rhel6n01.corp.follett.com
Host Load (0.5ms) SELECT * FROM "hosts" WHERE ("hosts"."name" = 'rhel6n01.corp.follett.com') LIMIT 1
Domain Load (1.0ms) SELECT * FROM "domains" ORDER BY name
Host Load (0.2ms) SELECT "hosts".id FROM "hosts" WHERE ("hosts"."name" = 'rhel6n01.corp.com') LIMIT 1
NoMethodError (undefined method `[]' for nil:NilClass):
app/models/report.rb:205:in `metrics_to_hash'
app/models/report.rb:200:in `each'
app/models/report.rb:200:in `metrics_to_hash'
app/models/report.rb:102:in `import'
app/controllers/reports_controller.rb:35:in `create'
app/controllers/reports_controller.rb:33:in `create'
passenger (2.2.2) lib/phusion_passenger/rack/request_handler.rb:81:in `process_request'
passenger (2.2.2) lib/phusion_passenger/abstract_request_handler.rb:203:in `main_loop'
passenger (2.2.2) lib/phusion_passenger/railz/application_spawner.rb:340:in `start_request_handler'
passenger (2.2.2) lib/phusion_passenger/railz/application_spawner.rb:298:in `handle_spawn_application'
passenger (2.2.2) lib/phusion_passenger/utils.rb:181:in `safe_fork'
passenger (2.2.2) lib/phusion_passenger/railz/application_spawner.rb:296:in `handle_spawn_application'
passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in `__send__'
passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in `main_loop'
passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:187:in `start_synchronously'
passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:154:in `start'
passenger (2.2.2) lib/phusion_passenger/railz/application_spawner.rb:192:in `start'
passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:257:in `spawn_rails_application'
passenger (2.2.2) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:251:in `spawn_rails_application'
passenger (2.2.2) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.2) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:250:in `spawn_rails_application'
passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:153:in `spawn_application'
passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:282:in `handle_spawn_application'
passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in `__send__'
passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in `main_loop'
passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:187:in `start_synchronously'
Rendering /usr/share/foreman/public/500.html (500 Internal Server Error)
Updated by Ohad Levy about 14 years ago
- Category set to Puppet Reports
- Target version set to 0.2
reports for new hosts, which do not receive a catalog (or basically do nothing), still report to the master, however in this case they do not provide metric information.
Updated by Ohad Levy almost 14 years ago
- Status changed from New to Ready For Testing
- % Done changed from 0 to 100
Applied in changeset e08af89170d45265bbd9663539e05c3b45c54572.
Updated by Ohad Levy almost 14 years ago
- Status changed from Ready For Testing to Closed