Bug #21654
Host discovery fails with undefined method `new` for nil:NIlClass
Pull request:
Fixed in Releases:
Found in Releases:
Description
The problem is that in the old (pre-PR) code importers registry is kept in FactImporter class that gets reloaded. Once the class is reloaded, it looses its default importer registration that point to puppet. See my comment for more information.
This is a regression in the import_facts core codebase introduced by #15409.
Let's add one REAL (non-mocked) test of discovering a host :-)
Related issues
Associated revisions
History
#1
Updated by Rahul Bajaj over 4 years ago
- Assignee set to Rahul Bajaj
#2
Updated by Lukas Zapletal over 4 years ago
- Related to Bug #21653: Unable to render host without memory info added
#3
Updated by Lukas Zapletal over 4 years ago
As per IRC, the issue is in Host::Base#import_facts:
type = facts.delete(:_type)
It was previously:
type = facts.delete(:_type) || 'puppet'
#4
Updated by Rahul Bajaj over 4 years ago
- Category deleted (
Discovery plugin) - Project changed from Discovery to Foreman
#5
Updated by Rahul Bajaj over 4 years ago
- Pull request https://github.com/theforeman/foreman/pull/5010 added
#6
Updated by Rahul Bajaj over 4 years ago
- Related to Bug #22705: Must use the ImporterRegistry rather than FactImporter added
#7
Updated by The Foreman Bot over 4 years ago
- Status changed from New to Ready For Testing
#8
Updated by Lukas Zapletal about 4 years ago
- Triaged set to No
It looks like this happens only when Rails reloads some classes: #21573
#9
Updated by Lukas Zapletal about 4 years ago
- Related to Bug #21573: Importing facts in development breaks on code reload added
#10
Updated by Lukas Zapletal about 4 years ago
- Description updated (diff)
#11
Updated by The Foreman Bot over 2 years ago
- Fixed in Releases 2.1.0 added
#12
Updated by Rahul Bajaj over 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 5b8e09dc6a465066bfa2c1bb7a9645cbd7994ce1.
#13
Updated by Tomer Brisker over 2 years ago
- Category set to Facts
#14
Updated by Lukas Zapletal 9 months ago
- Related to Bug #34026: Importing puppet report via the API does not authorize added
Fixes #21654 - create registry for importers