Bug 1450445

Summary: spacewalk-repo-sync doesn't check protocol in prefix of url (http, nfs, file)
Product: Red Hat Satellite 5 Reporter: Pavel Studeník <pstudeni>
Component: Satellite SynchronizationAssignee: Gennadii Altukhov <galtukho>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: dyordano, galtukho, lhellebr, tkasparek, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-backend-2.5.3-156 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-13 07:58:38 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:
Bug Depends On:    
Bug Blocks: 1450111    

Description Pavel Studeník 2017-05-12 15:01:21 UTC
Description of problem:
I received ERROR "list index out of range" when I forgot fill protocol for option url http://, file://, ...

>> spacewalk-repo-sync -c pstudeni-channel --sync-kickstart --url yum.spacewalkproject.org/nightly-client/Fedora/24/x86_64/
17:53:17 ======================================
17:53:17 | Channel: pstudeni-channel
17:53:17 ======================================
17:53:17 Sync of channel started.
17:53:17 Repo URL: yum.spacewalkproject.org/nightly-client/Fedora/24/x86_64/
17:53:17 ERROR: list index out of range
17:53:17 Sync of channel completed in 0:00:00.
17:53:17 Total time: 0:00:00

manual page:
"The  repository  URL.  Any  protocol  supported  by yum is supported including http://, nfs://, file://."

Version-Release number of selected component (if applicable):
spacewalk-backend-tools-2.5.3-130.el6sat.noarch

How reproducible:
aways

Steps to Reproduce:
1. run command:
>> spacewalk-repo-sync -c pstudeni-channel --sync-kickstart --url yum.spacewalkproject.org/nightly-client/Fedora/24/x86_64/

Actual results:
ERROR: list index out of range

Expected results:
some better message then error or set http as default protocol.

Comment 1 Pavel Studeník 2017-05-12 15:08:30 UTC
NFS protocol is not supported:

>> spacewalk-repo-sync -c pstudeni-channel --sync-kickstart --url nfs://localhost/mnt/export
18:07:20 ERROR: Error parsing "mirrorlist = 'nfs://localhost/mnt/export'": URL must be http, ftp, file or https not "nfs"

Comment 2 Gennadii Altukhov 2017-08-07 13:58:44 UTC
The bug is fixed in upstream. spacewalk.git:
bcffee0bdd21c77ec779c65bb67234238c564c66

Comment 10 Lukáš Hellebrandt 2017-11-20 11:19:21 UTC
Verified with spacewalk-backend-2.5.3-157.

Used reproducer from comment 5. When URL is not entered, the following error is shown:

06:15:31 ERROR: Unknown protocol in repo URL: copr-be.cloud.fedoraproject.org/results/@spacewalkproject/nightly-client/fedora-26-x86_64

Also, the return value is 1.

Note that manual page says nfs is an acceptable protocol while actually, entering it leads to error. That is, however, unrelated to this BZ and not a regression.

Comment 13 errata-xmlrpc 2017-12-13 07:58:38 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, 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/RHBA-2017:3445