Bug 163784 - zmd fails download of package from 'yum' type repository
Summary: zmd fails download of package from 'yum' type repository
Status: VERIFIED DUPLICATE of bug 163791
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Zenworks (show other bugs)
Version: Beta 9
Hardware: Other Other
: P5 - None : Critical (vote)
Target Milestone: ---
Assignee: Jiří Suchomel
QA Contact: Eric Waldow
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-05 15:15 UTC by Klaus Kämpf
Modified: 2006-06-30 19:27 UTC (History)
3 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Kämpf 2006-04-05 15:15:20 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.
Comment 1 Klaus Kämpf 2006-04-05 15:16:19 UTC
If I copy and paste the Url mentioned in "Download failed:(...)" to wget, it works without problems.
Comment 2 James Willcox 2006-04-05 16:31:09 UTC
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?
Comment 3 Klaus Kämpf 2006-04-05 17:49:53 UTC
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
Comment 4 Klaus Kämpf 2006-04-05 17:52:00 UTC
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.
Comment 5 Klaus Kämpf 2006-04-05 17:52:47 UTC
The http server is returning a real 404 ;-)
Comment 6 Klaus Kämpf 2006-04-05 18:06:35 UTC
Adding Marius to CC.
Comment 7 Klaus Kämpf 2006-04-05 18:19:11 UTC
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
Comment 8 Christian Boltz 2006-04-06 21:47:07 UTC
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.)
Comment 9 Dan Mills 2006-04-07 12:17:48 UTC
It should be easy for yast (or whatever) to normalize the path, so that we always get a sane url.

-> Stano.
Comment 10 Marius Tomaschewski 2006-04-07 12:37:53 UTC
(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.
Comment 11 Stanislav Visnovsky 2006-04-11 13:21:40 UTC
Raising severity to get on TPMs radar.
Comment 12 Andreas Jaeger 2006-04-11 13:34:35 UTC
Let's not do the special %2f rewrite for http!  Not a blocker -but should be fixed!
Comment 13 Klaus Kämpf 2006-04-11 13:45:26 UTC
The %2F rewrite is currently done without taking the scheme into account.
Comment 14 Marius Tomaschewski 2006-04-11 16:59:30 UTC
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.
Comment 15 Marius Tomaschewski 2006-04-11 18:08:24 UTC
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.
Comment 16 Marius Tomaschewski 2006-04-11 18:35:27 UTC
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).
Comment 17 Marius Tomaschewski 2006-04-12 01:44:51 UTC
Stano, see also Bug #163791.
Comment 18 Stanislav Visnovsky 2006-04-12 06:23:36 UTC
Looks to be a duplicate then.
Comment 19 Jiří Suchomel 2006-04-12 06:38:24 UTC

*** This bug has been marked as a duplicate of 163791 ***