Host details not being correctly fetched

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&#39; from /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode.rb:53:inbind'
from
/opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode.rb:51:in
eval&#39; from /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode.rb:51:ineval'
from /usr/share/foreman/app/services/safe_render.rb:36:in
parse_string&#39; from /usr/share/foreman/app/services/safe_render.rb:18:inparse'
from /usr/share/foreman/app/services/classification/base.rb:82:in
value_of_key&#39; from /usr/share/foreman/app/services/classification/class_param.rb:12:inblock
(2 levels) in enc'
from
/usr/share/foreman/app/services/classification/class_param.rb:11:in each&#39; from /usr/share/foreman/app/services/classification/class_param.rb:11:inblock
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&#39; from /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:ineach'
from
/usr/share/foreman/app/services/classification/class_param.rb:8:in enc&#39; from /usr/share/foreman/app/models/host/managed.rb:977:inlookup_keys_class_params'
from /usr/share/foreman/app/models/host/managed.rb:426:in info&#39; from /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/app/models/katello/concerns/host_managed_extensions.rb:53:ininfo_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&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:inexecute'
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&#39; from /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:inmon_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&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:ininvoke'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:in
invoke_task&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:inblock (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&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:inblock 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&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:intop_level'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:in
block in run&#39; from /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:instandard_exception_handling'
from
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in
run&#39; from /opt/rh/rh-ruby22/root/usr/bin/rake:33:in<main>'

Any idea?

Thanks in advance