Project

General

Profile

Bug #21573

Importing facts in development breaks on code reload

Added by Ivan Necas almost 5 years ago. Updated 7 months ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Facts
Target version:
-
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

1. Import facts
2. Host::Base file, so that code realoding happens
3. import facts again

Error gets triggered:

NoMethodError: undefined method `new' for nil:NilClass
 | /home/inecas/Projects/ws/foreman-rex/foreman-rails5/app/models/host/base.rb:141:in `import_facts'
 | /home/inecas/Projects/ws/foreman-rex/foreman-rails5/app/models/host/managed.rb:298:in `import_facts'
 | /home/inecas/Projects/ws/foreman-rex/foreman-rails5/app/controllers/api/v2/hosts_controller.rb:288:in `facts'
 | /home/inecas/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actionpack-5.0.6/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'

Related issues

Related to Foreman - Refactor #15409: Refactor (puppet) facts out of host classes.Closed
Related to Foreman - Bug #21654: Host discovery fails with undefined method `new` for nil:NIlClassClosed

History

#1 Updated by Ivan Necas almost 5 years ago

  • Related to Refactor #15409: Refactor (puppet) facts out of host classes. added

#2 Updated by Lukas Zapletal about 4 years ago

  • Triaged set to No

Oh! That's why I sometimes see this error.

#3 Updated by Lukas Zapletal about 4 years ago

  • Related to Bug #21654: Host discovery fails with undefined method `new` for nil:NIlClass added

#4 Updated by Leos Stejskal about 1 year ago

  • Triaged changed from No to Yes

Still reproducible on latest develop branch

2021-08-06T08:41:04 [E|kat|c2920112] NoMethodError: undefined method `new' for nil:NilClass
 c2920112 | /home/vagrant/foreman/app/services/host_fact_importer.rb:47:in `block in parse_facts'
 c2920112 | /home/vagrant/foreman/app/services/host_fact_importer.rb:90:in `block in skipping_orchestration'
 c2920112 | /home/vagrant/foreman/app/models/concerns/orchestration.rb:124:in `without_orchestration'
 c2920112 | /home/vagrant/foreman/app/services/host_fact_importer.rb:89:in `skipping_orchestration'
 c2920112 | /home/vagrant/foreman/app/services/host_fact_importer.rb:45:in `parse_facts'
 c2920112 | /home/vagrant/foreman/app/services/host_fact_importer.rb:34:in `import_facts'
 c2920112 | /home/vagrant/foreman/app/models/host/base.rb:143:in `import_facts'
 c2920112 | /home/vagrant/katello/app/models/katello/host/subscription_facet.rb:220:in `update_facts'
 c2920112 | /home/vagrant/katello/app/services/katello/registration_manager.rb:217:in `create_in_candlepin'
 c2920112 | /home/vagrant/katello/app/services/katello/registration_manager.rb:171:in `block in register_host'
 c2920112 | /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
 c2920112 | /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
 c2920112 | /home/vagrant/katello/app/services/katello/registration_manager.rb:169:in `register_host'
 c2920112 | /home/vagrant/katello/app/services/katello/registration_manager.rb:40:in `process_registration'
 c2920112 | /home/vagrant/katello/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb:234:in `consumer_activate'

...

#5 Updated by Adi Abramovitch 7 months ago

  • Status changed from New to Duplicate

Also available in: Atom PDF