Bug 498875

Summary: package not found in Factory (yast2-2.18.14-1.1.ppc.rpm)
Product: [openSUSE] openSUSE 11.2 Reporter: Peter Poeml <poeml>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None CC: adrian.schroeter, ma, ro
Version: Factory   
Target Milestone: ---   
Hardware: PowerPC   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Peter Poeml 2009-04-28 15:30:15 UTC
Hi,

I am updating my powerbook to factory. zypper wants to download a
package which does not exist
("/factory/repo/oss/suse/ppc/yast2-2.18.14-1.1.ppc.rpm"). The package
does indeed not exist:

 # curl -sI http://powerpc.opensuse.org/factory/repo/oss/suse/ppc/yast2-2.18.14-1.1.ppc.rpm
HTTP/1.1 404 Not Found
[...]


(Of course, zypper happily updates other packages, before noticing this,
and aborting the update  :(
Comment 1 Peter Poeml 2009-04-28 15:36:40 UTC
The package was in fact deleted in the repository, during my ongoing update.

2009/04/28 17:05:24 [5687] buildservice2.suse.de del. suse/ppc/yast2-2.18.14-1.1.ppc.rpm 0 0

The PPC Factory doesn't have the staging, and keeping of old packages,
that the x86 Factory has, so the problem is inevitable.

Closing as wontfix...
Comment 2 Jan Kupec 2009-04-28 15:47:10 UTC
This is intended. You should run 'zypper refresh' before updating, or you should enable autorefresh for the repo(s). Whichever suits you. (still it can happen if a repo changes during the download/install process).

But yes, we could check for the files before actually starting with downloading (& installing). So that the apps could tell the user 'the repo is out of date, do a refresh'. I don't see why not (the additional does-file-exist requests should not harm, as long as we provide also progress reporting).

(not a bug, though, changing to enhancement)
Comment 3 Jan Kupec 2009-04-28 15:48:14 UTC
eh. forgot to change to enhancement (and you forgot to wontfix :O)
Comment 4 Jan Kupec 2009-04-28 15:50:43 UTC
BTW, keeping of a few old packages in repos is not a bad idea!
Comment 5 Peter Poeml 2009-04-28 15:58:46 UTC
(In reply to comment #2)
> This is intended. You should run 'zypper refresh' before updating, or you
> should enable autorefresh for the repo(s). Whichever suits you. (still it can
> happen if a repo changes during the download/install process).
> 
> But yes, we could check for the files before actually starting with downloading
> (& installing). So that the apps could tell the user 'the repo is out of date,
> do a refresh'. I don't see why not (the additional does-file-exist requests
> should not harm, as long as we provide also progress reporting).
> 
> (not a bug, though, changing to enhancement)

zypper refreshes by itself, if it hasn't run for some (unknown to me) time. This is what happened in my case. So there was no point in running 'zypper refresh' before updating in my case. Thus, the repository was not outdated when I started the update. It became outdated during the update (as proven by the rsync log line which shows the deletion of the requested package shortly before my powerbook attempted to download it).

zypper should 

a) NOT ruin your system by an incomplete update, and it should NOT start the update before all needed packages have been downloaded.

b) (if you ask me) if it encounters a 404 (from the server, not after a redirect) for a package, it should do a quick check on the timestamp of the repository to see whether it has changed since zypper was started. If so, it should refresh and restart.
Comment 6 Peter Poeml 2009-04-28 16:07:14 UTC
(In reply to comment #4)
> BTW, keeping of a few old packages in repos is not a bad idea!

JFYI, that's implemented for Factory since one or two months. Packages are kept 3 days after they become obsolete. Since then, I haven't seen any reports anymore about updates that fail in the middle of things; so it seems to be effective!
The price is that we need more space on the download server, and don't want to inflict the backlog of packages to the mirrors, and therefore only the download server itself has the old packages. In addition, this means that we cannot efficiently avoid redirects to "bad" mirrors for these packages, because they become deleted after some time, which we don't notice immediately. Thus, we depend on libzypp using aria2 to download these old packages, to be robust enough to fetch them from mirrors that still have them. Well, it seems to work...

Ideally, powerpc.opensuse.org (the download server for the PPC factory) should do the same and keep old packages, but it's not really worth the effort to set this up for the few users.
Comment 7 Jan Kupec 2009-04-29 08:35:34 UTC
(In reply to comment #5)
> zypper should 
> 
> a) NOT ruin your system by an incomplete update, and it should NOT start the
> update before all needed packages have been downloaded.

Michael Andres already works on this IIRC - this will be one (the default, i guess) mode of operation. The current mode being the other. With the current mode there is always this risk.

> b) (if you ask me) if it encounters a 404 (from the server, not after a
> redirect) for a package, it should do a quick check on the timestamp of the
> repository to see whether it has changed since zypper was started.

Yup, that's what i would do here....

> If so, it
> should refresh and restart.

... but i would only print a hint ("repo is out of date, do zypper refresh, and run the original command again."), instead of doing it automatically.


@zypp people: what about the idea from comment #2?
Comment 8 Jan Kupec 2009-04-29 08:39:22 UTC
c#7, uhm. But i would need info in the rpm callbacks about the repo from which the package was about to be downloaded. Or i can find the package in the install summary in zypper itself...
Comment 9 Michael Andres 2009-09-18 19:47:15 UTC
libzypp-6.16.0 has a commit.downloadMode option in zypp.conf. Using downloadInAdvance should solve this bug.