Bugzilla – Bug 163784
zmd fails download of package from 'yum' type repository
Last modified: 2006-06-30 19:27:40 UTC
# rug in java-1_5_0-sun Resolving Dependencies... The following packages will be installed: java-1_5_0-sun 1.5.0_06-13 (http://ftp.suse.com//pub/suse/install/10.1/SUSE-Linux10.1-Beta9-Extra/suse) Downloading Packages... 0% Download failed: Download failed: (http://ftp.suse.com//pub/suse/install/10.1/SUSE-Linux10.1-Beta9-Extra/suse/x86_64/java-1_5_0-sun-1.5.0_06-13.x86_64.rpm) The remote server returned an error: (404) Not Found.
If I copy and paste the Url mentioned in "Download failed:(...)" to wget, it works without problems.
If I put a little snippet of code into zmd that tells it to download that url, it works fine, so I'm a little confused. You can still reproduce this? Like, you're sure it's not a real 404? Can you perhaps run ethereal (or something) to see the request it's making?
ethereal revealed that zmd tries to access /%2Fpub/suse/install/10.1/SUSE-Linux10.1-Beta9-Extra/suse/x86_64/java-1_5_0-sun-1.5.0_06-13.x86_64.rpm which matches the package_url from zmd.db: http://ftp.suse.com/%2Fpub/suse/install/10.1/SUSE-Linux10.1-Beta9-Extra/suse/x86_64/java-1_5_0-sun-1.5.0_06-13.x86_64.rpm
parse-metadata was called with http://ftp.suse.com//pub/suse/install/10.1/SUSE-Linux10.1-Beta9-Extra/suse as catalog id, the %2F gets inserted by the zypp-interal Url class. Imho, the Url class is right in 'escaping' the leading slash. I do remember similar issues in Code9 where yast failed to do such escaping and it was impossible to distinguish between rooted and non-rooted pathes.
The http server is returning a real 404 ;-)
Adding Marius to CC.
Specifying a 'sane' url to rug fixed this rug sa http://ftp.suse.com/pub/suse/install/10.1/SUSE-Linux10.1-Beta9-Extra/suse (its only a single slash between ".com" and "pub" closing as invalid
I remember several mailinglist posts (about SL <= 10.0) where similar problems were caused by a simple slash. ("Must I enter '/somewhere' or just 'somewhere' for the server path?") I don't know what caused the doubled slash in your case, but this problem can happen easily because the "add installation source" dialog is separated to server name and directory. IMHO there should be some URL checking for such simple configuration errors. (However, this is not a blocker.)
It should be easy for yast (or whatever) to normalize the path, so that we always get a sane url. -> Stano.
(In reply to comment #8) IMO it is really fine that yast allows the user to enter the url components separately. It also provides an additional / generic dialog, where you can enter the complete and propelly encoded url. But, the "/" handling in YaST is a little bit "unusual". You have to leave _out_ the first slash, except you have an ftp url with absolute path (ftp url's are a special case - see bellow). This means, for the url "http://foo/path/name", you have to enter just "path/name" in the dialog. This is not correct in the meaning of an Url component: the slash after the host _belongs_ to the path - it's not just a separator. "http://foo" -- empty path "http://foo/path" -- path is "/path" The ftp url allows to specifiy absolute or relative paths (rfc1738): "ftp://foo/path" -- relative path to ftp server's default directory (e.g. the user's home); this is the path that you see using the "PWD" ftp command directly after login. "ftp://foo/%2fpath" -- absolute path on the ftp server; the "%2f" is an encoded "/". This is required in some cases only (if there is no authority, that is the "//" behind ":"), but also valid if there is a authority "ftp://foo//path" -- absolute path on the ftp server In the YaST ftp dialog, you have to use "path" for relative paths and "/path" for absolute paths. Alternative implementation would be "/path" for http, "/path" for relative and "//path" for absolute ftp url's.
Raising severity to get on TPMs radar.
Let's not do the special %2f rewrite for http! Not a blocker -but should be fixed!
The %2F rewrite is currently done without taking the scheme into account.
I'm testing a fix in zypp avoiding encoding if scheme != ftp, but there is still a bug in yast2 that adds a "/" even if the path begins with a "/" and scheme != ftp.
Improved zypp::Url. Now it allways encodes if there is no authority (e.g. file:/%2fpath), but if there is an authority, it depends on a scheme config flag if it will be rewritten as "//" or as "/%2f" (for ftp/sftp only). This means, it will use "http://hostname//path" for http url (and other schemes, except ftp/sftp), when path contains two slashes. Submitted to SVN revision 3062.
Submitted above zypp fix to STABLE. Stano, please decide if you want to fix it in yast url dialogs or not -- see Comment #14. (If not, just change to resolved=FIXED).
Stano, see also Bug #163791.
Looks to be a duplicate then.
*** This bug has been marked as a duplicate of 163791 ***