This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2249109 - param :source_url not working with the sync API
Summary: param :source_url not working with the sync API
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.10.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: stream
Assignee: satellite6-bugs
QA Contact: Sam Bible
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-10 18:31 UTC by David Moore
Modified: 2024-06-06 16:32 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-06 16:32:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36987 0 Low New param :source_url not working with the sync API 2023-12-14 18:33:55 UTC
Red Hat Issue Tracker   SAT-21273 0 None Migrated None 2024-06-06 16:32:18 UTC

Description David Moore 2023-11-10 18:31:51 UTC
Description of problem:

- When using Hammer to sync a repository, the option --source-url is not used for the sync, it will use existing url.
- However, when I pass --source-url on a repo with no existing url, it will try and sync, not giving a hammer error, 
  and will fail with HTTP 400: Server Error for no remote.

Version-Release number of selected component (if applicable):
6.10 and up
Reproduced on 6.15.0 snap 36.0

How reproducible:
Every time

Steps to Reproduce:
1. Create some repository with no upstream_url defined. (--url in hammer).
2. >> hammer repository synchronize --id {repo_id} --source-url {valid_source_url}
3. Add a valid url to the repository field upstream_url (--url in hammer).
4. >> hammer repository synchronize --id {repo_id} --source-url {some_other_valid_url}



Actual results:
2: Unsuccessful sync, does not use --source_url, gives 400 error that there is no remote (See Additional details).
4: The repository is synced to the existing url, instead of respecting the temporary --source-url passed.


Expected results:
Successful sync to the temporary '--source-url' passed in 'hammer repository synchronize'.
  Or we can drop references to '--source-url', if we do not plan to support it.



Additional details:

*** When synchronizing a repository that has no existing url, and passed --source-url: 

[root@HOST ~]# hammer repository synchronize --id 362 --source-url "https://partha.fedorapeople.org/test-repos/pteradactyl/"
[................................................................................................................] [100%]
Error: Error message: the server returns an error
HTTP status code: 400
Response headers: {"Date"=>"Fri, 10 Nov 2023 16:02:17 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"POST, OPTIONS", "X-Frame-Options"=>"DENY", "Content-Length"=>"82", "X-Content-Type-Options"=>"nosniff", "Referrer-Policy"=>"same-origin", "Cross-Origin-Opener-Policy"=>"same-origin", "Correlation-ID"=>"***", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 HOSTNAME.redhat.com", "Connection"=>"close"}
Response body: {"remote":["This field is required since a remote is not set on the repository."]}

^^ Instead, would expect source_url to be used for sync, or a hammer error like- 
   """  Could not synchronize the repository:
          attempted to sync without a feed URL.  """


*** When synchronizing a repository that has an existing url that was already synced, 
    perform sync again passing a different --source-url: 

[root@HOST ~]# hammer repository synchronize --id 363 --source-url "https://partha.fedorapeople.org/test-repos/pteradactyl/"
[................................................................................................................] [100%]
No content added.
Total steps: 1/1
--------------------------------
Skipping Sync (no change from previous sync): 1/1

Comment 1 Brad Buckingham 2023-11-13 13:09:33 UTC
Is this a regression in behavior from a previous release?

Comment 5 Samir Jha 2023-12-14 18:33:54 UTC
Created redmine issue https://projects.theforeman.org/issues/36987 from this bug

Comment 6 Bryan Kearney 2023-12-20 16:02:45 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36987 has been resolved.

Comment 8 Sam Bible 2024-03-27 17:37:17 UTC
Verified on Satellite Stream - snap 49

Steps to Verify:
1) Create a Repository.
2) Attempt to use --source-url argument for hammer repository syncronize

Expected Results:
--source-url isn't a recognized argument, and isn't listed as such in the help text

Actual Results:
--source-url isn't a recognized argument, and isn't listed as such in the help text

Comment 9 Eric Helms 2024-06-06 16:32:20 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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