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 1023125 - hammer-cli: trying to create duplicate org throws unhandled ISE
Summary: hammer-cli: trying to create duplicate org throws unhandled ISE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Daniel Lobato Garcia
QA Contact: Og Maciel
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1062306 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-24 16:47 UTC by Corey Welton
Modified: 2019-09-26 15:45 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-02 14:06:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 3519 0 None None None 2016-04-22 16:05:46 UTC

Description Corey Welton 2013-10-24 16:47:17 UTC
Description of problem:

When trying to create an org in foreman when an org with the same name already exists, an ISE is thrown.  This is incongruent with such behavior for other subcommands

Version-Release number of selected component (if applicable):
Satellite-6.0.2-RHEL-6-20131023.1


How reproducible:


Steps to Reproduce:
1. 'hammer -u admin -p admin organization create --name foobar' ; note org is created
2.  'hammer -u admin -p admin organization create --name foobar'
3.  View results

Actual results:
[root@cloud-qe-21 ~]# hammer -u admin -p admin organization create --name foobar
Could not create the organization:
  Error: 500 Internal Server Error


Expected results:
Something like "Organization creation failed: An organization with this name already exists"

Additional info:

Comment 1 Corey Welton 2013-10-24 16:48:56 UTC
Likewise, attempting to modify an org to have the same name as an existing one throws the same error.

Comment 4 Dominic Cleal 2013-10-25 13:46:48 UTC
Turns out to be a Foreman API error.  Please include production.log info when you get HTTP error codes like this.

Comment 7 Dominic Cleal 2014-02-06 16:57:37 UTC
*** Bug 1062306 has been marked as a duplicate of this bug. ***

Comment 9 Bryan Kearney 2014-02-18 14:40:35 UTC
checked into upstream.

Comment 11 Og Maciel 2014-03-11 16:28:52 UTC
DEBUG basecli:43: Running test TestOrg/test_bugzilla_1023125
DEBUG ssh:100: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization create --name='ucwoer'
DEBUG ssh:153: <<< ['Message,Id,Name', 'Organization created,171,ucwoer', '']
DEBUG ssh:100: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization info --id='171'
DEBUG ssh:153: <<< ['Id,Name,Created at,Updated at,Label,Description', '171,ucwoer,2014/03/11 16:27:16,2014/03/11 16:27:16,ucwoer,""', '']
DEBUG ssh:100: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization list --search='label="ucwoer"'
DEBUG ssh:153: <<< ['Id,Name,Label,Description', '171,ucwoer,ucwoer,""', '']
DEBUG ssh:100: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization create --name='ucwoer'
DEBUG ssh:156: <<< [ERROR 2014-03-11 12:27:26 Exception] Name has already been taken
Name has already been taken
Title has already been taken
Label already exists (including organizations being deleted)
Organization Names and labels must be unique across all organizations
Could not create the organization:
  Name has already been taken
  Name has already been taken
  Title has already been taken
  Label already exists (including organizations being deleted)
  Organization Names and labels must be unique across all organizations

DEBUG factory:78: [ERROR 2014-03-11 12:27:26 Exception] Name has already been taken
Name has already been taken
Title has already been taken
Label already exists (including organizations being deleted)
Organization Names and labels must be unique across all organizations
Could not create the organization:
  Name has already been taken
  Name has already been taken
  Title has already been taken
  Label already exists (including organizations being deleted)
  Organization Names and labels must be unique across all organizations

.
----------------------------------------------------------------------
Ran 1 test in 16.700s

OK

Comment 12 Bryan Kearney 2014-07-02 14:06:09 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.


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