Bug 227136

Summary: Failure on adding update repo in yast (license)
Product: [openSUSE] openSUSE 10.2 Reporter: Dominique Leuenberger <dimstar>
Component: libzyppAssignee: Duncan Mac-Vicar <dmacvicar>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: aj, dmacvicar, kkaempf, lslezak
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Yast logfiles

Description Dominique Leuenberger 2006-12-08 14:19:07 UTC
I try to explain, how I got to this error (did not try to recreate it yet, but I might do so.. it's a VM installation):

### Explanation ###
While installing 10.2 (behind a firewall restricting FTP), the
installer failed to add an update repository (as far as I can see from
the log, only ftp.suse.com was tried)(that is reported in bug #227059)

So I decided to add one by myself later (using HTTP, as FTP is not
working). The proxy is set in Yast.

When adding the update repo, it takes a while (it is downloading some
files) and at once I get a message:
"Curl error for:
http://ftp4.gwdg.de/pub/suse/update/10.2/media.1/license.zip: Error
code: HTTP resonse: 403 Error message: The requested URL returned error:
403"
Comment 1 Dominique Leuenberger 2006-12-08 14:25:17 UTC
Created attachment 108877 [details]
Yast logfiles
Comment 2 Matej Horvath 2006-12-08 15:47:01 UTC
Well, I'm getting 404 while trying to download that file.

In your logs there is also several times the 404, as well as the 403.

Most probably you have a bad URL, or the server was encountering problems.
 
However this message is also interesting:
martyr(6415) [media] MediaCurl.cc(attachTo):614 Not allowed to parse '/root/.curlrc': bad file owner 

So, please check the file owner and permissions. Also please try to find a valid address for that file and try to reproduce it. 

Thank you. 
Comment 3 Dominique Leuenberger 2006-12-08 16:01:02 UTC
Why should I try to find that license.zip? Why should yast even try to download that file when I add a repository?

I don't think this file exists anywhere... I was trying to add an update repo (http://ftp-1.gwdg.de/pub/suse/update/10.2)

The file /root/.curlrc does not exist on my installation. so the error message is wrong: It should not be not allowed, but file not found.
Comment 4 Dominique Leuenberger 2006-12-08 20:38:37 UTC
Just remember: the 403 can be ignored, as it was a reply by the corp Proxy: ZIP files are blocked in general.

But as this file is not even needed, nor existing, this should not avoid me from adding a repo using Yast. Adding it with rug worked.
Comment 5 Ladislav Slezák 2006-12-14 14:20:14 UTC
It seems that zypp is trying to download a non-existing file, probably during source probing.
Comment 6 Duncan Mac-Vicar 2006-12-18 15:11:10 UTC
zypp only download files either listed in content file or directory.yast files.

The problem is YaST once more skipping layers and doing work that should be done in zypp, in ProductLicense.ycp:

string license_file = Pkg::SourceProvideOptionalFile (src_id, 1,
      "/media.1/license.zip");

Without checking if it is a YUM source. That is why YaST should not even know about source types, that is the reason of zypp. If a license is needed, then lets add license to the API, and we can provide different implementations for YUM and YaST sources.
Comment 7 Jiri Srain 2006-12-21 07:39:33 UTC
The problem is a bit deeper

1. Even if ZYPP profided its own function to provide license data, the media backend doesn't check directory.yast if it is asked for a specific file. Therefore this error would occurre anyway

2. Directory.yast doesn't exist at all paths, only where getting whole directory is expected

3. When adding any repository (which may be 3rd party), we must check whether a license exists, and show it to user

4. If there was not proxy, user would have got 404 and error would be ignored (no license required). However, in this case there was another error, and we don't know whether the license exists, and therefore it is OK to give user an error.
Comment 14 Stefan Hundhammer 2007-02-07 13:13:45 UTC
Somebody please assume ownership of this bug. yast2-maintainers@suse.de is only an inbox for reassigning bugs. It is not a permanent place for bugs.
Comment 15 Stefan Hundhammer 2007-02-07 13:18:52 UTC
pkg-bindings or pkg source management - one way or the other -> lszezak
Comment 16 Juergen Weigert 2007-02-07 14:45:38 UTC
I cannot find any URL containing /media.1/license.zip -- 
Do we actually have one?
Comment 17 Ladislav Slezák 2007-02-07 15:09:52 UTC
AFAIK the license file is only on shipped media, update sources are YUM which don't have any license file.
Comment 21 Ladislav Slezák 2007-02-23 08:45:04 UTC
According to comment #6 and #7 this should be solved in libzypp (new license API).
Comment 26 Duncan Mac-Vicar 2007-10-03 15:15:12 UTC
This was fixed for 10.3