Indagating for another problem, I found that host details are not correctly
fetched:
foreman-rake console
/usr/share/foreman/lib/tasks/console.rake:4: warning: already initialized
constant ARGV
Loading production environment (Rails 4.1.5)
irb(main):001:0> @host = Host.find_by_name("cmongo02cs.mydomain.com")
=> #<Host::Managed id: 120, name: "cmongo02cs.mydomain.com", last_compile:
"2017-02-10 09:41:15", last_report: "2017-02-10 09:41:12", updated_at:
"2017-02-10 09:41:17", created_at: "2017-02-08 09:07:26", root_pass:
"$1$xxxxxxxxxxxxxxx/", architecture_id: 1, operatingsystem_id: 3,
environment_id: 34, ptable_id: nil, medium_id: nil, build: false, comment:
"", disk: nil, installed_at: nil, model_id: 1, hostgroup_id: 8, owner_id:
6, owner_type: "User", enabled: true, puppet_ca_proxy_id: 2, managed:
false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id:
nil, puppet_proxy_id: 2, certname: "cmongo02cs.mydomain.com", image_id:
nil, organization_id: 1, location_id: 3, type: "Host::Managed", otp: nil,
realm_id: nil, compute_profile_id: nil, provision_method: nil,
content_source_id: 2, grub_pass: "$1$xxxx$xxxxxx/", discovery_rule_id: nil,
content_view_id: 19, lifecycle_environment_id: 4, global_status: 2,
lookup_value_matcher: "fqdn=cmongo02cs.mydomain.com", openscap_proxy_id:
>
irb(main):002:0> @host.info.to_yaml
Safemode::NoMethodError: undefined method '[]' for NilClass::Jail (NilClass)
from
/opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode/jail.rb:17:in
method_missing' from /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode.rb:53:in
bind'
from
/opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode.rb:51:in
eval' from /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode.rb:51:in
eval'
from /usr/share/foreman/app/services/safe_render.rb:36:in
parse_string' from /usr/share/foreman/app/services/safe_render.rb:18:in
parse'
from /usr/share/foreman/app/services/classification/base.rb:82:in
value_of_key' from /usr/share/foreman/app/services/classification/class_param.rb:12:in
block
(2 levels) in enc'
from
/usr/share/foreman/app/services/classification/class_param.rb:11:in each' from /usr/share/foreman/app/services/classification/class_param.rb:11:in
block
in enc'
from
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in
each' from /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in
each'
from
/usr/share/foreman/app/services/classification/class_param.rb:8:in enc' from /usr/share/foreman/app/models/host/managed.rb:977:in
lookup_keys_class_params'
from /usr/share/foreman/app/models/host/managed.rb:426:in info' from /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/app/models/katello/concerns/host_managed_extensions.rb:53:in
info_with_katello'
… 6 levels…
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in
each' from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in
execute'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:in
block in invoke_with_call_chain' from /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in
mon_synchronize'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:in
invoke_with_call_chain' from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:in
invoke'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:in
invoke_task' from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in
block (2 levels) in top_level'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in
each' from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in
block in top_level'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:in
run_with_threads' from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:in
top_level'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:in
block in run' from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in
standard_exception_handling'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in
run' from /opt/rh/rh-ruby22/root/usr/bin/rake:33:in
<main>'
Any idea?
Thanks in advance