Bug 1389543

Summary: API call POST /katello/api/products/:id/sync fails
Product: Red Hat Satellite Reporter: Manikandan Somasundaram <msomasun>
Component: API - ContentAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.2CC: andrew.schofield, bkearney, jcallaha, jomitsch, kabbott, mbacovsk, omaciel, swadeley
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 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 Manikandan Somasundaram 2016-10-27 20:24:59 UTC
Description of problem:

  cu is facing an below error when they follow the documentation on the page “/apidoc/v2/products/sync.html”. 


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

How reproducible:
1)  Have a Satellite 6.2 Server
2)  Add several repositories for a product,
3)  Try to sync all of them using API call

Actual results:
 
Error:

POST /katello/api/products/:id/sync


{
  "displayMessage": "Organization required",
  "errors": [
    "Organization required"
  ]
}
  

Expected results:

 Sync all repos 

Additional info:
N/A

Comment 1 Stephen Wadeley 2016-11-16 10:02:44 UTC
I discussed this with Martin Bacovsky and it seems likely this is an API code issues.

Comment 4 John Mitsch 2016-12-19 20:27:48 UTC
I wasn't able to reproduce this:

[vagrant@sat-snap-rhel7 ~]$ rpm -qa | grep satellite
satellite-6.2.6-2.0.el7sat.noarch

[vagrant@sat-snap-rhel7 ~]$ curl -X POST -k -u admin:changeme -H "Content-Type: application/json" 192.168.121.167:3000/katello/api/v2/products/2/sync
  {"id":"fc11645b-b493-46dc-a2ea-0fd68c788e9c","label":"Actions::BulkAction","pending":true,"username":"admin","started_at":"2016-12-19 20:25:59 UTC","ended_at":null,"state":"planned","result":"pending","progress":0.0,"input":{"action_class":"Actions::Katello::Repository::Sync","target_ids":[1],"target_class":"Katello::Repository","args":[],"current_user_id":3,"locale":"en"},"output":{},"humanized":{"action":"Bulk action","input":null,"output":null,"errors":[]},"cli_example":null}

Comment 5 Stanislav Tkachenko 2017-02-24 13:10:42 UTC
Verified on Satellite 6.3 Snap 8.0 ( satellite-6.3.0-11.1.beta.el7sat.noarch) and Satellite 6.2.8 Snap 3.0 (satellite-6.2.8-1.0.el7sat.noarch)


Sync task completed without errors, repositories synced and have updated content-count.
2017-02-24 14:59:59 - nailgun.client - DEBUG - Making HTTP POST request to https://sat6.com/katello/api/v2/products/48/sync with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} and no data.
2017-02-24 15:00:01 - nailgun.client - DEBUG - Received HTTP 202 response:   {"id":"0fd0c6e6-fa7a-4b8a-b50e-ccf3e2caefb2","label":"Actions::BulkAction","pending":true,"username":"admin","started_at":"2017-02-24 13:00:02 UTC","ended_at":null,"state":"planned","result":"pending","

Comment 6 Bryan Kearney 2017-05-17 20:30:44 UTC
Moving to 6.3 to track verification on that thread.

Comment 9 Satellite Program 2018-02-21 16:54:17 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336