Hammer errors after 1.17 update

Problem:

I am still affected by this bug, which means I need to manually sync the repository in question using Hammer.

When I ran the command this morning, I got this error:

/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/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:27: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:45: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:45: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:48: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:49: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:50: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:51: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:51: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:51: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:52: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:52: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:53: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:53: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:54: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:55: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:55: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:55: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:57: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:57: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:57: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:59: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:60: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb:60: 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

I upgraded to Foreman 1.17/Katello 3.6 last week.

Expected outcome:

  1. Don’t get error messages for deprecations,
  2. resolve error.

Foreman and Proxy versions:
1.17.0

Foreman and Proxy plugin versions:
Katello 3.6

This are simply warning messages and don;t cause any breakages. I do think it is valid for us to fix at least the gems we control. Is there more output so that we can help diagnose the true Hammer breakage you are encountering?

Also, do you mind filing a Redmine issue to eliminate these warning messages?

Sure.

That’s it for the output, and it precedes execution of all commands (even hammer --help). Adding verbosity doesn’t add to the output.

Note that in redmine, the latest versioned release is 1.17.0_RC1 and nightly. No 1.17.0

[edit] ticket 23371

The issue appears at Ruby 2.4 only. I was originally reported by Lukas here: https://bugs.ruby-lang.org/issues/12739
Multiple gems are affected and we’ll probably need to update to higher versions for those that aren’t under our control.

You should be able to workaround the issue by export RUBYOPT="-W0" until we fix it properly (note that it will silence all warnings).

Ok, not 2.4 only but 2.4+ I should have been more precise.

Wrong link, I meant: Bug #23058: Warning: lib/hammer_cli_import/persistentmap.rb:27: warning: constant ::Fixnum is deprecated - Hammer CLI Import - Foreman

So, after some investigation, it turns out the problem has two parts:

1 Like

will this be resolved soon or should i stick to 1.16 ?

I don’t see any of the messages in my fresh 1.17 instance.

Not sure if this is still open or not, but a temp fix would just be to replace the word Fixnum with the word Integer.

sed -i 's/Fixnum/Integer/g' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb

Hammer cli import is deprecated. It’s archived on github and won’t receive updates anymore. If you still rely on this then we should find a replacement. Not sure what it is.

I compared the “hammer_cli_import-0.11.3/lib/hammer_cli_import/persistentmap.rb” to the file located in the read only github repo and it would seem that the github version actually does use “Integer” instead of “Fixnum”. I also verified that the package from the Katello repo (3.3 and no version after) does not have the updated “Integer” fix packaged in the RPM (tfm-rubygem-hammer_cli_import-0.11.3-1.el7.noarch.rpm).

To conclude. What this all means is:

  1. This package when performing a new install of Katello beyond version 3.3 does not get installed because it is not available in the repos beyond version 3.3
  2. If you have installed Katello version 3.3 at some point and no longer require the import plugin for hammer, just remove the RPM: yum remove tfm-rubygem-hammer_cli_import-0.11.3-1.el7.noarch
  3. If you for some reason require this import plugin, just perform the fix noted previously. Hammer errors after 1.17 update

And in all honesty, since 3.3 is outdated this should not be a huge deal to work out, however technically the RPM should be repackaged with the current fixes from github.

While I understand that hammer is deprecated, that this problem is solved/solvable, and therefore this thread should probably be closed, it doesn’t change the fact that my original problem stands - katello bug 22637 is still open and remains an issue for us.

Hammer itself isn’t deprecated, just the CLI import.