Project

General

Profile

Bug #21654

Host discovery fails with undefined method `new` for nil:NIlClass

Added by Lukas Zapletal almost 3 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Facts
Target version:
-
Difficulty:
trivial
Triaged:
No
Bugzilla link:
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

Related to Discovery - Bug #21653: Unable to render host without memory infoClosed2017-11-14
Related to Katello - Bug #22705: Must use the ImporterRegistry rather than FactImporterClosed
Related to Foreman - Bug #21573: Importing facts in development breaks on code reloadNew2017-11-03

Associated revisions

Revision 5b8e09dc (diff)
Added by Rahul Bajaj 8 months ago

Fixes #21654 - create registry for importers

History

#1 Updated by Rahul Bajaj almost 3 years ago

  • Assignee set to Rahul Bajaj

#2 Updated by Lukas Zapletal almost 3 years ago

  • Related to Bug #21653: Unable to render host without memory info added

#3 Updated by Lukas Zapletal almost 3 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 2 years ago

  • Category deleted (Discovery plugin)
  • Project changed from Discovery to Foreman

#5 Updated by Rahul Bajaj over 2 years ago

  • Pull request https://github.com/theforeman/foreman/pull/5010 added

#6 Updated by Rahul Bajaj over 2 years ago

  • Related to Bug #22705: Must use the ImporterRegistry rather than FactImporter added

#7 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing

#8 Updated by Lukas Zapletal over 2 years ago

  • Triaged set to No

It looks like this happens only when Rails reloads some classes: #21573

#9 Updated by Lukas Zapletal over 2 years ago

  • Related to Bug #21573: Importing facts in development breaks on code reload added

#10 Updated by Lukas Zapletal about 2 years ago

  • Description updated (diff)

#11 Updated by The Foreman Bot 8 months ago

  • Fixed in Releases 2.1.0 added

#12 Updated by Rahul Bajaj 8 months ago

  • Status changed from Ready For Testing to Closed

#13 Updated by Tomer Brisker 5 months ago

  • Category set to Facts

Also available in: Atom PDF