Bug 1124967

Summary: hammer import organization --upload-manifests-from randomly fails to upload manifests
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: TransitionsAssignee: Grant Gainey <ggainey>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: UnspecifiedCC: bbuckingham, cperry, ggainey, jmontleo, mkollar, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:21:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1125243    

Description Lukas Pramuk 2014-07-30 18:22:35 UTC
Description of problem:
hammer import organization --upload-manifests-from randomly fails to upload multiple manifests in a row. 3 out of 10 succeeded 

Version-Release number of selected component (if applicable):
rubygem-hammer_cli_import-0.9.0-1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
0. prepare multiple manifest files in /tmp/manifests named by imported organizations (in filename spaces are replaced by underscores)

1.run import tool
# hammer import organization --csv-file /tmp/exports/users.csv --upload-manifests-from '/tmp/manifests'

2. check for actual results
for org in [...]; do
 hammer --csv subscription manifest-history --organization $org
done

out of 10 only 3 uploads were successful - 1st, 7th, 9th one
others were failures or with upload results missing at all!

Actual results:
3/10 success

Expected results:
10/10 success

Additional info:
candlepin is not that fast seems we need to embbed some sleeps

Comment 1 RHEL Program Management 2014-07-30 18:23:45 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 3 Grant Gainey 2014-07-31 12:19:31 UTC
upload-manifest starts an asyn task, we need to wait for it to finish before starting a new one (per discussion w/jsherrill)

Comment 4 Grant Gainey 2014-07-31 18:24:34 UTC
commit e87cf91c9631929d93cd599fbf518e795b0d630e

Comment 6 Lukas Pramuk 2014-08-25 17:07:11 UTC
VERIFIED. rubygem-hammer_cli_import-0.10.1-1.el6.noarch

# hammer import organization --csv-file /tmp/exports/users.csv --upload-manifests-from /tmp/manifests
Summary
  Found 272 organizations.
  Uploaded 9 manifests.
  Created 9 organizations.

# hammer --csv subscription manifest-history --organization 'RED HAT SATELLITE ENGINEERING'
SUCCESS,RED_HAT_SATELLITE_ENGINEERING file imported successfully.,2014/08/24 20:35:46

# hammer --csv subscription manifest-history --organization 'Sec eng Brno Dept.'
SUCCESS,Sec_eng_Brno_Dept_ file imported successfully.,2014/08/24 20:36:13

# hammer --csv subscription manifest-history --organization 'QA Brno'
SUCCESS,QA_Brno file imported successfully.,2014/08/24 20:36:36

# hammer --csv subscription manifest-history --organization 'Security'
SUCCESS,Security file imported successfully.,2014/08/24 20:36:59

# hammer --csv subscription manifest-history --organization 'JBoss Brno QA'
SUCCESS,JBoss_Brno_QA file imported successfully.,2014/08/24 20:37:24

# hammer --csv subscription manifest-history --organization 'ClusterStorageQE'
SUCCESS,ClusterStorageQE file imported successfully.,2014/08/24 20:37:46

# hammer --csv subscription manifest-history --organization 'GSS'
SUCCESS,GSS file imported successfully.,2014/08/24 20:38:12

# hammer --csv subscription manifest-history --organization 'lvm-org'
SUCCESS,lvm-org file imported successfully.,2014/08/24 20:38:38

# hammer --csv subscription manifest-history --organization 'Red Hat OpenStack QE'
SUCCESS,Red_Hat_OpenStack_QE file imported successfully.,2014/08/24 20:39:03


--> 9 of 9 manifests uploaded

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