Project

General

Profile

Actions

Bug #13975

closed

Edit host fails with 'undefined method `param_class' for #<LookupKey:0x007f04dde2bda8>'

Added by Magnus Svensson about 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Parameters
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

HOSTNAME: olympic.it.liu.se
OS: redhat
RELEASE: CentOS release 6.7 (Final)
FOREMAN: 1.10.2
RUBY: ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
PUPPET: 3.8.6
DENIALS: 0

When I try to edit some of my host I get 'undefined method `param_class' for #<LookupKey:0x007f04dcec62f0>' instead of the host-edit interface.


Files

foreman-debug-BrklV.tar.xz foreman-debug-BrklV.tar.xz 671 KB Magnus Svensson, 03/01/2016 08:12 AM

Related issues 1 (0 open1 closed)

Related to Foreman - Refactor #10832: Make LookupKey an STI for puppet and variable keysClosedTom Caspy06/16/2015Actions
Actions #1

Updated by Dominic Cleal about 8 years ago

  • Status changed from New to Need more information

Is this a recent upgrade to 1.10? Could you try running foreman-rake db:migrate to check the DB is up to date?

Do you create smart variables or anything through the API or CLI?

Actions #2

Updated by Dominic Cleal about 8 years ago

  • Related to Refactor #10832: Make LookupKey an STI for puppet and variable keys added
Actions #3

Updated by Magnus Svensson about 8 years ago

[root@olympic environments]# foreman-rake db:migrate
[root@olympic environments]#

We do not use the API or CLI.

I upgraded to 1.10.1 from 1.9.3 around feb 16

Actions #4

Updated by Magnus Svensson about 8 years ago

I think the problem was present in at least 1.9.

Actions #5

Updated by Dominic Cleal about 8 years ago

I'm not sure I see how it could have happened in 1.9, this looks more like a 1.10 only issue. There's a possibility there was some bad data though which has caused the issue on upgrade.

It looks like a problem with a particular smart class parameter or variable associated to the host, which might be difficult to find. What appears to be the problem is that you have a "LookupKey" in the database which should either be a PuppetLookupKey (a smart class parameter) or a VariableLookupKey (a smart variable).

Can you run foreman-rake console and attach the output from running: LookupKey.where(:type => 'LookupKey')

My guess is that some entries in 1.9 had is_param set to NULL rather than true/false and so didn't get migrated properly.

Actions #6

Updated by Magnus Svensson about 8 years ago

[root@olympic ~]# foreman-rake console
Loading production environment (Rails 3.2.8)
irb(main):001:0> LookupKey.where(:type => 'LookupKey')
LookupKey Load (0.8ms) SELECT "lookup_keys".* FROM "lookup_keys" WHERE "lookup_keys"."type" = 'LookupKey' ORDER BY lookup_keys.key
=> []
irb(main):002:0>

Actions #7

Updated by Dominic Cleal about 8 years ago

  • Category set to Parameters
  • Status changed from Need more information to New
  • translation missing: en.field_release set to 145

Hm OK, thanks for trying that. I'm out of ideas for now.

Are you able to narrow down any particular Puppet classes that might be causing it? Especially if you have any smart variables.

Actions #8

Updated by Magnus Svensson about 8 years ago

Tanks to your comments I was able to find the bad variables and matchers in the database. They were invisible from the web-interface. Deleting those lines from the database solved my problems. Now I am happy. :-)

Actions #9

Updated by Dominic Cleal about 8 years ago

  • Status changed from New to Resolved
  • translation missing: en.field_release deleted (145)

Okay, glad you found it! I'll close this for now, but if somebody else hits this, please comment and we can reopen to dig further into how the issue is coming about.

Actions

Also available in: Atom PDF