Bug 1029919

Summary: zypper crashes when baseurl does not contain http/https
Product: [openSUSE] openSUSE Tumbleweed Reporter: Forgotten User uytXIYOK7E <forgotten_uytXIYOK7E>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bwiedemann, forgotten_uytXIYOK7E
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User uytXIYOK7E 2017-03-17 14:45:10 UTC
zypper crashes when a repo file is missing the protocol in the download URL.  For example, the following repo file causes zypper to crash.

[home_Ximi1970_openSUSE_Extra]
baseurl=download.opensuse.org/repositories/home:/Ximi1970:/openSUSE:/Extra/openSUSE_Tumbleweed
enabled=1
gpgcheck=1
gpgkey=download.opensuse.org/repositories/home:/Ximi1970:/openSUSE:/Extra/openSUSE_Tumbleweed//repodata/repomd.xml.key
priority=99
autorefresh=1
keeppackages=1
type=rpm-md

Running any zypper command results in a crash as follows.

linux-0yvh:~ # zypper search bacula
Unexpected exception.
Url scheme is a required component
Please file a bug report about this.
See http://en.opensuse.org/Zypper/Troubleshooting for instructions
Comment 1 Michael Andres 2017-03-20 09:27:52 UTC
Where does the .repo file come from?

It needs to be fixed. As the message says, an URL schema is required to tell whether you want cd: dvd: ftp: http: https: hd: dir: iso: nfs: nfs4: smb: cifs: or obs:.
Comment 2 Forgotten User uytXIYOK7E 2017-03-22 18:15:18 UTC
The repo file was created by puppet.  I have resolve the issue and zypper is working again.
Comment 3 Bernhard Wiedemann 2022-10-13 18:59:39 UTC
It could still issue a more helpful error output, e.g.
# zypper search bacula
Error:
The /etc/zypp/repo.d/foo.repo baseurl= value
requires a URL scheme such as http://