Project

General

Profile

Bug #27548

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

Added by Martin Bacovsky 6 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Hammer
Target version:
-
Difficulty:
medium
Triaged:
Yes
Bugzilla link:
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:

Associated revisions

Revision 63e9f595 (diff)
Added by Oleh Fedorenko about 2 months ago

Fixes #27548 - Better handling of server exceptions

History

#1 Updated by Martin Bacovsky 5 months ago

  • Triaged changed from No to Yes

#2 Updated by Martin Bacovsky 3 months ago

  • Team Backlog Hammer added

#3 Updated by Oleh Fedorenko about 2 months ago

  • Difficulty set to medium
  • Assignee set to Oleh Fedorenko
  • Status changed from New to Assigned

#4 Updated by Oleh Fedorenko about 2 months ago

  • Category changed from Other commands to Hammer
  • Project changed from Hammer CLI to Katello
  • Team Backlog deleted (Hammer)

#5 Updated by The Foreman Bot about 2 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/Katello/hammer-cli-katello/pull/709 added

#6 Updated by Oleh Fedorenko about 2 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF