Bug 1324968

Summary: /katello/api/repositories/:id/import_uploads is async but doesn't return taskid.
Product: Red Hat Satellite Reporter: Andrew Schofield <andrew.schofield>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WORKSFORME QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.8CC: andrew.schofield, bbuckingham, bkearney, daviddavis, jrfuller, kabbott, mhulan, sthirugn
Target Milestone: UnspecifiedKeywords: Reopened, 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: 2017-01-05 20:03:13 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:

Description Andrew Schofield 2016-04-07 17:24:53 UTC
Description of problem:

The API call /katello/api/repositories/:id/import_uploads is performed async but doesn't return a taskid so we can't monitor its progress.

Version-Release number of selected component (if applicable):
6.1.8

How reproducible:
Always.

Expected results:

The call should return a taskid so we can monitor the status.

Comment 2 Brad Buckingham 2016-04-19 13:09:19 UTC
Hi Andrew, thank you for raising the bugzilla.

In the API referenced, it actually executes the request using a synch task versus an async one.  As a result, when the API returns the request should be completed; therefore, no monitoring of the task should be needed.

e.g.
  sync_task(::Actions::Katello::Repository::ImportUpload, @repository, upload_id)

Based upon this, I am going to close this bugzilla; however, please feel free to reopen if you are not seeing the expected behavior.

Comment 4 Johnray Fuller 2016-06-22 20:19:35 UTC
There is sample code that illustrates the issue. Can this be evaluated relative to the code posted?

Comment 5 David Davis 2016-06-28 15:16:11 UTC
I tried several times to reproduce but was unable to. Even when I was calling the api to add the puppet module to the content view within 2 seconds after getting a response from import_uploads, it seemed to work fine (see the log output below). If we can get a foreman-debug output or /var/log/foreman/production.log output, that would help us to debug the problem.

2016-06-28 15:02:13 [I] Processing by Katello::Api::V2::RepositoriesController#import_uploads as application/json;version=2
2016-06-28 15:02:17 [I] Completed 200 OK in 3895ms (Views: 0.8ms | ActiveRecord: 95.2ms)
2016-06-28 15:02:17 [I] Processing by Katello::Api::V2::ContentUploadsController#destroy as application/json;version=2
2016-06-28 15:02:17 [I] Completed 200 OK in 64ms (Views: 1.0ms | ActiveRecord: 9.9ms)
2016-06-28 15:02:19 [I] Processing by Katello::Api::V2::ContentViewPuppetModulesController#create as application/json;version=2
2016-06-28 15:02:19 [I] Completed 200 OK in 253ms (Views: 82.6ms | ActiveRecord: 0.7ms)

Comment 6 Brad Buckingham 2016-06-28 15:24:02 UTC
Hi Andrew, would you be able to share a foreman-debug?  See comment 5.  Thanks!

Comment 10 Andrew Schofield 2016-07-12 13:46:38 UTC
This is pending an internal retest.

Comment 11 Marek Hulan 2016-12-02 12:48:04 UTC
Seems like specific to repositories API.

Comment 12 Brad Buckingham 2016-12-13 20:48:57 UTC
Hello Andrew, any updates on the re-test?  If not, should we close the bugzilla and later re-open if/when it is reproduced?

Comment 13 Bryan Kearney 2017-01-05 20:03:13 UTC
I emailed with Andrew, here is hte response:

<Andrew>
This can be closed out. The reporter hasn't been able to supply me with steps to replicate. Again, this was against 6.1 we're 6.2 now. If I see this as an issue again I can re-raise (I have code which uses this for puppet modules and I've not seen an issue).
</Andrew>