I need a bit of help here trying to understand if a breakage was introduced to Foreman in the past 1-2 months. Our pipelines have been largely broken with the shift over to Rails 5.1 and Ruby 2.4 so this breakage could have been introduced over the course of these months.
What I am currently seeing is that with organizations and locations enabled, when puppet creates a host that host ends up created with no organization (as expected). However, when hammer attempts to search for that host’s info as the admin user, no data is returned. I can replicate this with an API call directly as well.
If I go into the UI, as the admin user, I can see the host just fine. This is blocking a number of nightly tests so any help figuring this out or pointing me in the right direction would be greatly appreciated.
Thanks Tom for the link. Note that particular issue is separate from the threads issue. There are two fixes that need to be figured out. One for that Redmine issue and one for the thread topic.
If I go to api/hosts?search=name+%3D+"centos7-katello-bats-ci.woodford.example.com" I do see the host. Apparently, I had tried to curl that earlier and it had not put the hostname in quotes which fails the query (which does seem odd).
Via hammer:
[root@centos7-katello-bats-ci katello-installer-base]# hammer host info --id 1
/opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/appender.rb:139: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
Resource host not found by id '1'
[root@centos7-katello-bats-ci katello-installer-base]# hammer host list
/opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/appender.rb:139: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
---|------|------------------|------------|----|-----|--------------|----------------------
ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | CONTENT VIEW | LIFECYCLE ENVIRONMENT
---|------|------------------|------------|----|-----|--------------|----------------------
[root@centos7-katello-bats-ci katello-installer-base]#
So this does make it seem like this may be more of a hammer issue.
The hammer version used is upstream/master?
Can I have output of hammer -d host info --id 1? I would expect it to translate to the API call you’ve used (/api/v2/hosts/1). Last week a hammer PR was merged that could influence this so I’d love to help to investigate.
Current evidence suggests this is a packaging issue with out dated nightly hammer packages. I am working on re-building these with the new SCL in mind and re-testing. I will report back here on my findings.