Bug #13975
closedEdit host fails with 'undefined method `param_class' for #<LookupKey:0x007f04dde2bda8>'
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
Updated by Dominic Cleal almost 9 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?
Updated by Dominic Cleal almost 9 years ago
- Related to Refactor #10832: Make LookupKey an STI for puppet and variable keys added
Updated by Magnus Svensson almost 9 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
Updated by Magnus Svensson almost 9 years ago
I think the problem was present in at least 1.9.
Updated by Dominic Cleal almost 9 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.
Updated by Magnus Svensson almost 9 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>
Updated by Dominic Cleal almost 9 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.
Updated by Magnus Svensson almost 9 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. :-)
Updated by Dominic Cleal almost 9 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.