Bug 1262313 - Providing invalid URL for a custom repo, WebUI raises exception but stores it
Providing invalid URL for a custom repo, WebUI raises exception but stores it
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Repositories (Show other bugs)
6.1.1
x86_64 Linux
high Severity high (vote)
: 6.2.3
: --
Assigned To: Brad Buckingham
Jitendra Yejare
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-11 07:59 EDT by Pavel Moravec
Modified: 2017-09-05 08:18 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-28 10:38:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Pavel Moravec 2015-09-11 07:59:09 EDT
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 17:17:53 EST
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 05:58:47 EDT
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 12:06:59 EDT
Created redmine issue http://projects.theforeman.org/issues/15810 from this bug
Comment 8 Brad Buckingham 2016-07-26 11:37:18 EDT
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 11:38 EDT
Created attachment 1184316 [details]
Step 4. Enter invalid URL.
Comment 10 Brad Buckingham 2016-07-26 11:39 EDT
Created attachment 1184317 [details]
Step 5. Click cancel and observe original URL.
Comment 11 Brad Buckingham 2016-07-26 11:40 EDT
Created attachment 1184319 [details]
Step 6. Resync repo without error.
Comment 12 Brad Buckingham 2016-07-26 11:41:53 EDT
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 10:23:32 EDT
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 10:38:50 EDT
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.