Bug 1262313 - Providing invalid URL for a custom repo, WebUI raises exception but stores it
Summary: Providing invalid URL for a custom repo, WebUI raises exception but stores it
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.1.1
Hardware: x86_64
OS: Linux
high vote
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact: Jitendra Yejare
Depends On:
TreeView+ depends on / blocked
Reported: 2015-09-11 11:59 UTC by Pavel Moravec
Modified: 2019-11-14 06:57 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-07-28 14:38:50 UTC
Target Upstream Version:

Attachments (Terms of Use)
Step 4. Enter invalid URL. (111.74 KB, image/png)
2016-07-26 15:38 UTC, Brad Buckingham
no flags Details
Step 5. Click cancel and observe original URL. (115.00 KB, image/png)
2016-07-26 15:39 UTC, Brad Buckingham
no flags Details
Step 6. Resync repo without error. (76.80 KB, image/png)
2016-07-26 15:40 UTC, Brad Buckingham
no flags Details

Description Pavel Moravec 2015-09-11 11:59:09 UTC
Description of problem:
Having a custom product for a custom repository and updating URL of the repo: if one provides an invalid URL (say http://username:password@@example.com/repo), WebUI complains about the invalid URL but it _stores_ the invalid URL.

Consequent attempt to synchronize the repository fails with obscure / unexpected error.

This bug is dangerous especially due to the fact WebUI convicts the user it detected URL invalid and _rejected_ the change. So the user is convicted previous valid URL is used.

Version-Release number of selected component (if applicable):
Sat 6.1.1 / foreman-

How reproducible:

Steps to Reproduce:
1. Create a custom product and a custom repo
2. Provide some valid URL there
3. Try to sync it
4. Try to update the URL to some invalid one.
5. WebUI raises some exception, so click to Cancel
6a Check the URL of the repo
6b Try to sync the repo.
(6a+6b can be done in any order)

Actual results:
6a: the URL is updated to the invalid one

6b: repo sync fails with "Importer indicated invalid response" pulp error (details depends on how you malform the URL / if you use credentials there etc.)

Expected results:
6a: original URL is stored there

6b: repo sync succeeds (most probably with no update done due to recent sync done)

Additional info:

Comment 2 Brad Buckingham 2016-03-07 22:17:53 UTC
I have tried several tests on Satellite 6.2; however, I haven't been able to reproduce the behavior described.  I am going to move the BZ to ON_QA for verification.

Test env included: tfm-rubygem-katello-

Comment 3 Jitendra Yejare 2016-03-22 09:58:47 UTC
Verified this issue in Sat 6.2 snap 4.

The issue is still reproducible.

On updating the repo url to invalid, it accepts the invalid url and stores it.
And on syncing the repo with that invalid url, the sync fails with 'RPM1004: Error retrieving metadata: Not found'.

So currently updating the status as 'Failed QA'.

Comment 7 Brad Buckingham 2016-07-24 16:06:59 UTC
Created redmine issue http://projects.theforeman.org/issues/15810 from this bug

Comment 8 Brad Buckingham 2016-07-26 15:37:18 UTC
I tried this again with Satellite 6.2 SNAP 21.1 using the url that was provided in the description (http://username:password@@example.com/repo) and the behavior appears correct.

1. create repo with valid url
2. sync repo
3. update url to invalid (http://username:password@@example.com/repo)
4. observe validation failed error
5. click 'cancel' and observe the original url (unchanged)
6. re-sync the repo without error

Attaching a few screenshots for 4, 5 & 6.

Comment 9 Brad Buckingham 2016-07-26 15:38:56 UTC
Created attachment 1184316 [details]
Step 4. Enter invalid URL.

Comment 10 Brad Buckingham 2016-07-26 15:39:32 UTC
Created attachment 1184317 [details]
Step 5. Click cancel and observe original URL.

Comment 11 Brad Buckingham 2016-07-26 15:40:09 UTC
Created attachment 1184319 [details]
Step 6. Resync repo without error.

Comment 12 Brad Buckingham 2016-07-26 15:41:53 UTC
Hi Jitendra, per comment 8, I re-tested this and did not observe the error with the scenario described.  Can you take a quick look?  If you are still seeing the issue, we'll need more specifics on the scenario.  Thanks!

Comment 13 Jitendra Yejare 2016-07-27 14:23:32 UTC
Verified !

@Sat 6.2 GA Snap 21.2


1. Created a custom product and a custom repo
2. Provided some valid URL
3. Synced it
4. Updated the URL to some invalid url

WebUI raised exception on clicking Cancel the url is reverted back to the valid one.
On syncing the repo again, the sync completed with valid url and not with invalid one.

So moving this to Verified !

Comment 14 Bryan Kearney 2016-07-28 14:38:50 UTC
This was delivered with Satellite 6.2 GA which was delivered on 27 July, 2017.

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