Project

General

Profile

Actions

Bug #27548

closed

hammer throws "too few arguments (ArgumentError)" when Satellite returns 500

Added by Martin Bacovsky over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer
Target version:
Difficulty:
medium
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1692698

Description of problem:
When Satellite returns 500 errors (because Passenger is unhappy), running hammer commands like "hammer ping" results in an ugly error instead of a nice message saying that the Satellite could not be reached.

Version-Release number of selected component (if applicable):
tfm-rubygem-hammer_cli-0.15.1.1-1.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. make Passenger return an error (like "Web application could not be started" by installing an incompatible GEM version)
2. hammer ping

Actual results:
  1. hammer ping
    Traceback (most recent call last):
    14: from /bin/hammer:23:in `<main>'
    13: from /bin/hammer:23:in `load'
    12: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/bin/hammer:147:in `<top (required)>'
    11: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    10: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/abstract.rb:28:in `run'
    9: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/abstract.rb:32:in `rescue in run'
    8: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/abstract.rb:188:in `handle_exception'
    7: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/exception_handler.rb:31:in `handle_exception'
    6: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/exception_handler.rb:65:in `handle_general_exception'
    5: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/exception_handler.rb:48:in `print_error'
    4: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/output/output.rb:23:in `print_error'
    3: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/output/adapter/abstract.rb:33:in `print_error'
    2: from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.15.1.1/lib/hammer_cli/utils.rb:13:in `format'
    1: from /opt/theforeman/tfm/root/usr/share/gems/gems/fast_gettext-1.4.1/lib/fast_gettext/vendor/string.rb:70:in `%'
    /opt/theforeman/tfm/root/usr/share/gems/gems/fast_gettext-1.4.1/lib/fast_gettext/vendor/string.rb:70:in `%': too few arguments (ArgumentError)
Expected results:
A human readable error. Compare this to the error you get when httpd is completely down:
  1. hammer ping
    Could not load the API description from the server:
    Failed to open TCP connection to sat-6-5-qa-rhel7.kangae.example.com:443 (Connection refused - connect(2) for "sat-6-5-qa-rhel7.kangae.example.com" port 443)
    - is the server down?
    - was 'foreman-rake apipie:cache' run on the server when using apipie cache? (typical production settings)

Additional info:

Actions

Also available in: Atom PDF