Bug 154990

Summary: autorefresh does not work
Product: [openSUSE] SUSE Linux 10.1 Reporter: Andreas Jaeger <aj>
Component: libzyppAssignee: Duncan Mac-Vicar <dmacvicar>
Status: RESOLVED FIXED QA Contact: Klaus Kämpf <kkaempf>
Severity: Blocker    
Priority: P5 - None CC: aj, suse-beta
Version: Beta 6   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Andreas Jaeger 2006-03-03 13:53:23 UTC
I added factory as autorefresh source in the yast2 installation-source module and a week later tried to install packages from there.  This did not work, I got media errors.  Debugging this closer showed that the local cache was outdated, after removing it I could install again.

so, autorefresh is not working right now - and the error message is confusing ("media exception").
Comment 1 Klaus Kämpf 2006-03-03 14:03:33 UTC
Stano is currently working on this one.
Comment 2 Stanislav Visnovsky 2006-03-06 09:53:53 UTC
Michael, how did autorefresh work? If the ID in media.1/media did not match, it did refresh?
Comment 3 Stanislav Visnovsky 2006-03-06 09:54:08 UTC
Michael, how did autorefresh work? If the ID in media.1/media did not match, it did refresh?
Comment 4 Michael Andres 2006-03-06 14:21:30 UTC
Depends on the kind of source.

- Associated with each Source is an autorefresh flag. Default value on creation 
  of a Source is:

  - TRUE for non SuSE sources

  - FALSE for SuSE sources, UNLESS "volatile_content" flag is set int the 
    content file.
  
- Before enabling a Source the first time, Source::refresh was called, if 
  autorefresh is TRUE for this Source.

- Source::refresh is a NOOP if media is CD/DVD. Otherwise the Source 
  implementations refresh was called, if the Source media_id has changed.

  - Susetags refreshes if the 2nd line in media.1/media changed.

  - Yum refreshes if the sha1sum of repomd.xml has changed (that's been used as 
    media_id for a Yum Source).

Comment 5 Stanislav Visnovsky 2006-03-08 07:58:38 UTC
Jiri, please, take a look.
Comment 6 Jiri Srain 2006-03-09 20:01:25 UTC
I adapted the SourceImpl::enable function to call refresh if autorefresh().
Comment 7 Stanislav Visnovsky 2006-03-10 12:31:36 UTC
I'm afraid refresh() does not implement the special behavior for CD vs. network sources.
Comment 8 Stefan Hundhammer 2006-03-10 13:19:28 UTC
With this refresh() on I don't see any objects any more from any kind of source. To double-check this, I commented out that call to refresh():

===================================================================
--- source/SourceImpl.cc        (Revision 2392)
+++ source/SourceImpl.cc        (Arbeitskopie)
@@ -227,8 +227,10 @@

     void SourceImpl::enable()
     {
+#if 0
       if (autorefresh())
        refresh();
+#endif
       _enabled = true;
     }

Then I can see packages, patches, patterns and selections again on my installation sources.
Comment 9 Stanislav Visnovsky 2006-03-28 06:11:27 UTC
Lukas, please, add to online_update.ycp a code to refresh all sources
that have autorefresh enabled by calling Pkg::SourceRefresh().

This is a temporary solution.
Comment 10 Lukas Ocilka 2006-03-28 07:59:32 UTC
Fixed for yast online update

--- cut ---

- Refreshing all sources (with autorefresh enabled) before the
  online is started (#154990).
- yast2-online-update 2.13.15

--- cut ---
Comment 11 Stanislav Visnovsky 2006-04-05 07:42:56 UTC
libzypp rev. 2919 disables autorefresh for non-remote sources.
Comment 12 Andreas Jaeger 2006-04-10 19:16:25 UTC
Is this fixed/hacked around now and can we therefore downgrade the severity?
Comment 13 Jiri Srain 2006-04-10 21:30:10 UTC
I think so.
Comment 15 Andreas Jaeger 2006-04-20 14:09:15 UTC
Marking as enhancement for 10.2.
Comment 16 Stanislav Visnovsky 2006-05-11 15:06:00 UTC
I think Duncan did a lot of work in this area lately.
Comment 17 Duncan Mac-Vicar 2006-05-19 12:04:25 UTC
*** Bug 175642 has been marked as a duplicate of this bug. ***
Comment 21 Duncan Mac-Vicar 2006-05-29 10:07:20 UTC
I have a question. The network can be down. And current zmd design wipes the catalog before calling parse-metadata. In this case you will end with a empty catalog.
Comment 22 Duncan Mac-Vicar 2006-05-29 10:09:10 UTC
Reading a source in zypp does not download anything unless cache does not exist
or you call store metadata to reread from the URL to the local cache.
Comment 23 Andreas Jaeger 2006-05-29 10:57:59 UTC
zmd checks the network status AFAIK but we should whether this works in this case.

Ws should download to a temporary and only remove the files if the new ones can be downloaded.  I think this is the same that zmd does with yum services.
Comment 24 Klaus Kämpf 2006-05-29 12:13:20 UTC
comment #23: zmd checks NetworkManager which does not really support Modem and ISDN connections.
Comment 25 Duncan Mac-Vicar 2006-05-29 13:42:54 UTC
I am implementing safe download for storeMetadata.
This means yum will download not to SourceManager-managed cache dir but to a tmpdir. In case of success it will be copied over. That means parse-metadata can call storemetadata safely.
Comment 27 Andreas Jaeger 2006-06-01 07:42:27 UTC
Can we markt this bug now as fixed?
Comment 28 Harald Mueller-Ney 2006-06-01 12:38:24 UTC
Bug 178334 is closed - coudl we mark as fixed?
Comment 30 Duncan Mac-Vicar 2006-06-01 13:08:07 UTC
yes. But it is not that bad, zypp does not do download if the source has not changed, and a failed refresh for any reason should result in the same data as before (after a completely unneeded parsing sadly).