Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1088442 - "bad request" exceptions and their messages are not displayed to hammer user
Summary: "bad request" exceptions and their messages are not displayed to hammer user
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Adam Price
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1091313 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-16 15:57 UTC by Tom McKay
Modified: 2019-09-26 18:16 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-11 12:24:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 5215 0 None None None 2016-04-22 15:38:31 UTC

Description Tom McKay 2014-04-16 15:57:01 UTC
Try creating an activation key using the same name/label as another. A generic "400 bad request" message is printed instead of indicating that the name is already in use (the server log contains this message).

Two fixes probably needed:
1. hammer-cli-foreman does not handle bad request
2. hammer-cli-katello should make sure the 'displayMessage' gets used in the error type (and all the others?)
   -or-
   katello needs to return json data in the same format as foreman does ('message'?)

Comment 1 Tom McKay 2014-04-16 15:58:12 UTC
Created redmine issue http://projects.theforeman.org/issues/5215 from this bug

Comment 3 David Davis 2014-07-24 13:22:31 UTC
*** Bug 1091313 has been marked as a duplicate of this bug. ***

Comment 4 David Davis 2014-07-24 13:24:14 UTC
For testing this bug, you can use 1091313 as a test case.

Comment 5 Adam Price 2014-08-04 17:55:09 UTC
tom, i'm unable to reproduce this issue. would you mind trying again with your setup?

▶ hammer activation-key create --organization acme --name actkey1
Activation key created
▶ hammer activation-key create --organization acme --name actkey1
Could not create the activation key:
  Validation failed: Name has already been taken

if this issue is more wide-spread than `activation-key create` would you please create a list of the hammer commands which don't display error messages properly? thanks.

Comment 6 David Davis 2014-08-05 16:40:23 UTC
Looks like this was fixed in hammer-cli-katello commit 317f20c7017956d6d0a343b862531ed687c23d16:

https://github.com/Katello/hammer-cli-katello/pull/194/files#diff-69c7957f57f06b23014adb6e7afcfab9R7

Comment 7 Tazim Kolhar 2014-08-08 06:19:09 UTC
VERIFIED

# hammer  activation-key create --help
[Foreman] password for admin: 
Usage:
    hammer activation-key create [OPTIONS]

Options:
    --content-view CONTENT_VIEW_NAME Content view name to search by
    --content-view-id CONTENT_VIEW_ID content view numeric identifier
    --description DESCRIPTION     description
    --lifecycle-environment LIFECYCLE_ENVIRONMENT_NAME Name to search by
    --lifecycle-environment-id LIFECYCLE_ENVIRONMENT_ID  
    --max-content-hosts MAX_CONTENT_HOSTS maximum number of registered content hosts
    --name NAME                   name
    --organization ORGANIZATION_NAME Organization name to search by
    --organization-id ORGANIZATION_ID  
    --organization-label ORGANIZATION_LABEL Organization label to search by
    --unlimited-content-hosts UNLIMITED_CONTENT_HOSTS can the activation key have unlimited content hosts
    -h, --help                    print help

Here,as you see only name and organization is sufficient no option of adding label

# hammer  activation-key create --name act_key --organization testorg 
[Foreman] password for admin: 
Activation key created

Comment 9 Bryan Kearney 2014-09-11 12:24:10 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.


Note You need to log in before you can comment on or make changes to this bug.