Bug 1962132 - Creating ansible collection repo fails with: "Invalid URL Ensure the URL ends '/'" but repo gets created
Summary: Creating ansible collection repo fails with: "Invalid URL Ensure the URL ends...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: 6.10.0
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
: 1970960 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-19 11:25 UTC by Peter Ondrejka
Modified: 2021-11-16 14:11 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-katello-4.1.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:10:56 UTC
Target Upstream Version:


Attachments (Terms of Use)
screenshot1 (88.09 KB, image/png)
2021-05-19 11:25 UTC, Peter Ondrejka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32867 0 Normal New Creating ansible collection repo fails with: "Invalid URL Ensure the URL ends '/'" but repo gets created 2021-06-23 16:43:35 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:11:11 UTC

Description Peter Ondrejka 2021-05-19 11:25:44 UTC
Created attachment 1784790 [details]
screenshot1

Description of problem:

Creating a repo using one of the hints in UI hint leads to pop-up error in the repository dialog, but repo gets created in the background

Version-Release number of selected component (if applicable):
Satellite 6.10 snap 1

How reproducible:
always

Steps to Reproduce:
1. Create product, create repo within it
2. In the repository creation dialog, select ansible collection type
3. For Upstream URL you can pick from example urls from the popup hint ( https://galaxy.ansible.com/api/v2/collections, 
https://galaxy.ansible.com/api/v2/collections/testing/k8s_demo_collection), or use different url in the suggested from (I used https://galaxy.ansible.com/api/v2/collections/theforeman/foreman), click save
4. Red pop-up error box shows up with the following content:

Task c158e696-c92f-4f24-b7f4-7daf2eec41fd: PulpAnsibleClient::ApiError: Error message: the server returns an error HTTP status code: 400 Response headers: {"Date"=>"Wed, 19 May 2021 10:36:05 GMT", "Server"=>"gunicorn/20.0.4", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"GET, POST, HEAD, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN", "Content-Length"=>"127", "Correlation-ID"=>"13312c8a-5d2b-4118-8f34-4b7d3ea835fc", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 dhcp-2-198.vms.sat.rdu2.redhat.com", "Connection"=>"close"} Response body: {"non_field_errors":["Invalid URL https://galaxy.ansible.com/api/v2/collections/theforeman/foreman. Ensure the URL ends '/'."]}

5. Add trailing '/' to the url, click save again -- form complains "name already taken" -- the repository actually got created in step 3
6. Trying to sync that repo fails with:
"Required lock is already taken by other running tasks"

Actual results:
described above

Expected results:
The repository shouldn't be created contrary to the UI error message. Also the message could be clearer and the UI hint shouldn't suggest the invalid repo form. Or, the check for the trailing / should be relaxed...

Comment 1 Marek Hulan 2021-06-11 14:50:36 UTC
*** Bug 1970960 has been marked as a duplicate of this bug. ***

Comment 2 Samir Jha 2021-06-23 16:43:35 UTC
Created redmine issue http://projects.theforeman.org/issues/32867 from this bug

Comment 3 Bryan Kearney 2021-06-30 16:03:54 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32867 has been resolved.

Comment 4 Peter Ondrejka 2021-07-22 11:06:43 UTC
Verified on sat 6.10 sn 10, the requirement for the trailing slash is now clearly enforced

Comment 7 errata-xmlrpc 2021-11-16 14:10:56 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 (Moderate: Satellite 6.10 Release), 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-2021:4702


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