Fresh 1.20 Install Hammer Issues

Problem:

Hammer fails to run due to missing libararies. Of course, the library file it can’t find exists. The problem appears to be with the ruby 2.5 scl. This is a fresh baremetal RHEL 7.6 install, and a fresh Foreman 1.20 install, all defaults. Just following instructions on the quick start documentation. See trace below.

While troubleshooting the hammer-cli gem installation I notice that the ruby24 and ruby25 gem command fails with the same error.

Foreman and Proxy versions:

foreman-1.20.1-1.el7.noarch
foreman-proxy-1.20.1-1.el7.noarch

Foreman and Proxy plugin versions:

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

[root@foreman-ks-test ~]# hammer --help
Traceback (most recent call last):
        17: from /usr/bin/hammer:23:in `<main>'
        16: from /usr/bin/hammer:23:in `load'
        15: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1/bin/hammer:124:in `<top (required)>'
        14: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
        13: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
        12: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1/lib/hammer_cli.rb:17:in `<top (required)>'
        11: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
        10: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
         9: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1/lib/hammer_cli/abstract.rb:10:in `<top (required)>'
         8: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
         7: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
         6: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1/lib/hammer_cli/help/builder.rb:1:in `<top (required)>'
         5: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
         4: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
         3: from /opt/theforeman/tfm/root/usr/share/gems/gems/unicode-0.4.4.1/lib/unicode.rb:1:in `<top (required)>'
         2: from /opt/theforeman/tfm/root/usr/share/gems/gems/unicode-0.4.4.1/lib/unicode.rb:5:in `rescue in <top (required)>'
         1: from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require': libruby.so.2.4: cannot open shared object file: No such file or directory - /opt/theforeman/tfm/root/usr/lib64/gems/ruby/unicode-0.4.4.1/unicode/unicode_native.so (LoadError)

As an additional data point, I did a fresh, bare metal install of 1.19 and upgraded to 1.20. On 1.19 hammer ran as expected, the upgrade to 1.20 broke it with the same failure as above.

Still working on this, it appears the issue is related to my Satellite. If I install on RHEL 7.6 from RH directly everything works as intended. I’ve pared my satellite based builds down to simply RHEL 7 server, optional rpms, and satellite tools and still get the traceback with hammer.

I cannot fathom what is on the Satellite that’s different from upstream that is causing this issue. The Satellite is syncing correctly and appears to be up to date. I’ll keep working, if anybody has any ideas at all feel free to chime in.

Think I’ve got this worked out now. I’ll document in case anybody else is building with Satellite. The satellite tools repo is distributing rubygems that are also in the foreman repo. Naturally it installs the satellite tools version instead of the foreman versions and there are s u b t l e differences.

tfm-rubygem-unf_ext-0.0.6-8.el7sat.x86_64 —> tfm-rubygem-unf_ext-0.0.6-8.el7.x86_64
tfm-rubygem-unicode-0.4.4.1-5.el7sat.x86_64 —> tfm-rubygem-unicode-0.4.4.1-5.el7.x86_64
tfm-rubygem-unicode-display_width-1.0.5-4.el7sat.noarch —> tfm-rubygem-unicode-display_width-1.0.5-3.el7.noarch

After installing the non sat version hammer started working.

1 Like

Hello jwdeffen
I have the same issue after updating to Foreman 1.20 with Satellite 6.4 installed, what did you do to install the foreman versions?

I just removed the rhel-7-server-satellite-tools-6.4-rpms repository and the packages listed above prior to the upgrade. At that point foreman-installer pulled the correct versions down from the foreman repository.