Skip to content

Puppet Class Importer fails to update parameters: undefined method `override' for nil:NilClass #388

Description

@SebbiUltimate

When I try to import the puppet environments, I get the error "undefined method `override' for nil:NilClass".
Beginning of Backtrace:

2024-03-02T00:21:03 [I|app|92f6450f] Backtrace for 'Failed to calculate obsolete and new' error (NoMethodError): undefined method override' for nil:NilClass
92f6450f | /usr/share/gems/gems/foreman_puppet-5.0.0/app/services/foreman_puppet/puppet_class_importer.rb:277:in block in update_parameter'
92f6450f | /usr/share/gems/gems/foreman_puppet-5.0.0/app/services/foreman_puppet/puppet_class_importer.rb:275:in `each'
92f6450f | /usr/share/gems/gems/foreman_puppet-5.0.0/app/services/foreman_puppet/puppet_class_importer.rb:275:in update_parameter'
92f6450f | /usr/share/gems/gems/foreman_puppet-5.0.0/app/services/foreman_puppet/puppet_class_importer.rb:270:in block in update_classes_in_foreman'

It seems that the parameters cannot be found in the lookup_keys table even though they exist.

When I replace the line
key = db_class.class_params.find_by key: param_name
in puppet_class_importer.rb L275 with
key = db_class.class_params.where("key like ?", param_name)
it works.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Red Hat Jira

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions