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 1223345 - hammer import organization of an existing name fails to use any recover strategy
Summary: hammer import organization of an existing name fails to use any recover strategy
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Transitions
Version: Unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Christine Fouant
QA Contact: Lukas Pramuk
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-20 11:32 UTC by Lukas Pramuk
Modified: 2017-02-23 20:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 14:00:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 10696 0 None None None 2016-04-22 16:07:19 UTC

Description Lukas Pramuk 2015-05-20 11:32:17 UTC
Description of problem:
hammer import organization of an existing name fails to use any recover strategy

Version-Release number of selected component (if applicable):
Satellite-6.1.0-RHEL-6-20150513.0
rubygem-hammer_cli_import-0.10.6.5-1.el6_6sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. Sat6 has an organization already created manually (for reproducer we can use a CLI)
# hammer import organization --verbose --csv-file users.csv
Importing from users.csv
Creating new organization: ORGANIZATION
Summary
  Created 1 organization.

2. Reset the import tool
# rm -rf ~/.transition_data/

3. Import org of the same name
# hammer import organization --verbose --csv-file users.csv
Importing from users.csv
Creating new organization: ORGANIZATION
Caught RestClient::InternalServerError:500 Internal Server Error while processing CSV line:
{"organization_id"=>"1", "organization"=>"ORGANIZATION"}
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `transmit'
/usr/lib/ruby/1.8/net/http.rb:543:in `start'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/resource.rb:71:in `post'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:279:in `send'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:279:in `call_client'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:210:in `http_call'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:161:in `call'
/usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/resource.rb:14:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:128:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:138:in `api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:143:in `mapped_api_call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:416:in `_create_entity'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:370:in `create_entity'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/organization.rb:84:in `import_single_row'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:511:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:511:in `cvs_iterate'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/importtools.rb:303:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/importtools.rb:303:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:510:in `cvs_iterate'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/csvhelper.rb:52:in `csv_each'
/usr/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:1545:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/csvhelper.rb:43:in `csv_each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:509:in `cvs_iterate'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:517:in `import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.6.5/lib/hammer_cli_import/base.rb:553:in `execute'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4.10/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4.10/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4.10/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4.10/bin/hammer:108
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19
Summary
  No action taken.

Actual results:
ISE, organization not created

Expected results:
avoid ISE and create organization with differrent name or reuse existing one, depends on chosen recover strategy

Comment 1 RHEL Program Management 2015-05-20 11:32:52 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 4 Lukas Pramuk 2015-05-20 12:04:39 UTC
Updated to rubygem-hammer_cli_import-0.10.13-1.el7.noarch
The bug still present (though traceback msg is hidden)

# hammer import organization --verbose --csv-file users.csv
Importing from users.csv
Creating new organization: ORGANIZATION
Caught RestClient::InternalServerError:500 Internal Server Error while processing CSV line:
{"organization_id"=>"1", "organization"=>"ORGANIZATION"}
Summary
  No action taken.

Comment 6 Christine Fouant 2015-06-03 21:11:12 UTC
Created redmine issue http://projects.theforeman.org/issues/10696 from this bug

Comment 7 Bryan Kearney 2015-06-04 06:05:53 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10696 has been closed
-------------
Christine Fouant
Applied in changeset commit:katello|45aec9b88a184ab820ba298f23fa433c695ecd22.

Comment 10 Lukas Pramuk 2015-06-11 11:45:56 UTC
VERIFIED.
rubygem-hammer_cli_import-0.10.17-1.el6_6sat
@Satellite-6.1.0-RHEL-6-20150610.5

by comment#0 reproducer:

...
3. # hammer import organization --verbose --csv-file users.csv
Importing from users.csv
Creating new organization: ORGANIZATION
 Creation of organization failed.
 Recovering by renaming to: "name"="1-ORGANIZATION"
Creating new organization: 1-ORGANIZATION
Summary
  Created 1 organization.

Comment 11 Bryan Kearney 2015-08-11 13:26:02 UTC
This bug is slated to be released with Satellite 6.1.

Comment 12 Bryan Kearney 2015-08-12 14:00:39 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.


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