Bug 1262313

Summary: Providing invalid URL for a custom repo, WebUI raises exception but stores it
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: RepositoriesAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.1CC: bbuckingham, bkearney, cwelton, jyejare, oshtaier, riehecky
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-28 14:38:50 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:
Embargoed:
Attachments:
Description Flags
Step 4. Enter invalid URL.
none
Step 5. Click cancel and observe original URL.
none
Step 6. Resync repo without error. none

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-1.7.2.34-1.el7sat.noarch


How reproducible:
100%


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-3.0.0.5-1.el7sat.noarch

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

Steps:

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

Observed:
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.