Bug 1293910 - The behaviour of metadata_expire=0
Summary: The behaviour of metadata_expire=0
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1410388 (view as bug list)
Depends On: 1230508
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-23 13:31 UTC by Miroslav Suchý
Modified: 2019-05-28 22:39 UTC (History)
16 users (show)

Fixed In Version: mock-1.4.8-1.fc26 mock-1.4.8-1.fc27 mock-1.4.8-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1230508
Environment:
Last Closed: 2019-05-28 22:39:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miroslav Suchý 2015-12-23 13:31:14 UTC
+++ This bug was initially created as a clone of Bug #1230508 +++

Despite
 metadata_expire=0
DNF still download metadata even when they are fresh.

Steps to reproduce:

1. Make sure that:
  /etc/mock/fedora-rawhide-x86_64.cfg
 contains 

config_opts['yum.conf'] = """
....
[main]
metadata_expire=0
...

2. Make sure that
  ~/.mock/user.cfg
  contains:
  config_opts['plugin_conf']['root_cache_enable'] = True

3. mock -r fedora-rawhide-x86_64 --scrub=all
4. mock -r fedora-rawhide-x86_64 --init
5. mock -r fedora-rawhide-x86_64 some.src.rpm

Notice that in step 5 DNF is again downloading metadata in spite of being few minutes old.

Note that per discussion with J. Silhan the 
  metadata_expire=0
should be "sent HTTP HEAD with if-modified-since and download the file only if it is newer", but this is nowhere documented (at least not in man dnf.conf)

Comment 1 Honza Silhan 2016-01-04 13:58:42 UTC
*** Bug 1285316 has been marked as a duplicate of this bug. ***

Comment 2 Honza Silhan 2016-01-11 12:14:37 UTC
Seems like duplicate of bug 1226724. We'll fix this.

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

Comment 3 Vít Ondruch 2017-05-05 12:51:32 UTC
Re-opening this. This seems to be cause by this [1] PR. I.e. there both sides to blame:

1) DNF is changing behavior and breaking backward compatibility, since it is now checking timestamp of the config file to expire the cache. And although the "metadata_expire=-1" is set and hence it should not care about any timestamps at all, it still fiddles around with them. Actually the default value in Mock is "metadata_expire=0" which is not documented and I am not really sure it works as it used to work for YUM ...

2) Mock in theory could set the "check_config_file_age=0" in the config file, but why it fiddles with the config file all the time, although the configuration is not changing, that is mystery to me ...


[1]: https://github.com/rpm-software-management/dnf/pull/611

Comment 4 Martin Hatina 2017-05-10 11:23:59 UTC
Fixed by https://github.com/rpm-software-management/dnf/pull/806

Comment 5 Miroslav Suchý 2017-07-10 13:57:35 UTC
*** Bug 1410388 has been marked as a duplicate of this bug. ***

Comment 6 Jaroslav Mracek 2017-11-28 10:05:21 UTC
It looks like that the problem is that mock copy conf files without time stamps, therefore dnf thinks that conf was changed and try to re-download metadata. I believe that copying confs with timestamps should solve the issue.

Comment 7 Miroslav Suchý 2017-11-29 12:21:30 UTC
Fixed by
* 4a3db64 when creating yum/dnf.conf copy timestamp from host [RHBZ#1293910]

Comment 8 Fedora Update System 2017-12-22 12:57:25 UTC
mock-1.4.8-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-e954edb1bb

Comment 9 Fedora Update System 2017-12-22 12:58:07 UTC
mock-1.4.8-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ac67357aa1

Comment 10 Fedora Update System 2017-12-22 12:58:47 UTC
mock-1.4.8-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-0c8682fd2a

Comment 11 Fedora Update System 2017-12-23 19:13:38 UTC
mock-1.4.8-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-e954edb1bb

Comment 12 Fedora Update System 2017-12-23 19:43:50 UTC
mock-1.4.8-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ac67357aa1

Comment 13 Fedora Update System 2017-12-23 22:36:05 UTC
mock-1.4.8-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-0c8682fd2a

Comment 14 Vít Ondruch 2018-01-02 15:14:35 UTC
This does not work:

~~~
$ rpm -q mock
mock-1.4.8-1.fc28.noarch

$ rpm -q dnf
dnf-2.7.5-4.fc28.noarch

$ ls -la /var/lib/mock/fedora-rawhide-x86_64/root/etc/dnf/dnf.conf 
-rw-rw-r--. 1 root root 626 Jan  2 16.04 /var/lib/mock/fedora-rawhide-x86_64/root/etc/dnf/dnf.conf

$ mock -r fedora-rawhide-x86_64 -i rubygems ruby-irb rubygem-rake ruby-devel rubygem-rdoc rubygem-test-unit rubygem-minitest rubygem-net-telnet rubygem-did_you_mean ruby-doc rubygem-bigdecimal rubygem-json rubygems-devel rubygem-xmlrpc
INFO: mock.py version 1.4.8 starting (python version = 3.6.3)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
Start: chroot init
INFO: LVM plugin enabled. Allocated pool data: 26.15%. Allocated metadata: 14.98%.
WARNING: For multilib systems, both architectures of nosync library need to be installed
INFO: calling preinit hooks
INFO: enabled dnf cache
Start: cleaning dnf metadata
Finish: cleaning dnf metadata
INFO: enabled HW Info plugin
Mock Version: 1.4.8
INFO: Mock Version: 1.4.8
Finish: chroot init
INFO: installing package(s): rubygems ruby-irb rubygem-rake ruby-devel rubygem-rdoc rubygem-test-unit rubygem-minitest rubygem-net-telnet rubygem-did_you_mean ruby-doc rubygem-bigdecimal rubygem-json rubygems-devel rubygem-xmlrpc
local                                                                                                                                                                              3.3 MB/s |  54 MB     00:16    
Last metadata expiration check: 0:00:00 ago on Út 2. leden 2018, 16:11:10 CET.
Package rubygems-2.6.13-100.fc28.noarch is already installed, skipping.
Package ruby-irb-2.4.2-85.fc28.noarch is already installed, skipping.
Package rubygem-rake-12.3.0-100.fc28.noarch is already installed, skipping.
Package ruby-devel-2.4.2-85.fc28.x86_64 is already installed, skipping.
Package rubygem-rdoc-5.1.0-2.fc27.noarch is already installed, skipping.
Package rubygem-test-unit-3.2.7-100.fc28.noarch is already installed, skipping.
Package rubygem-minitest-5.10.3-100.fc27.noarch is already installed, skipping.
Package rubygem-net-telnet-0.1.1-85.fc28.x86_64 is already installed, skipping.
Package rubygem-did_you_mean-1.1.0-85.fc28.x86_64 is already installed, skipping.
Package ruby-doc-2.4.2-85.fc28.noarch is already installed, skipping.
Package rubygem-bigdecimal-1.3.0-85.fc28.x86_64 is already installed, skipping.
Package rubygem-json-2.1.0-102.fc27.x86_64 is already installed, skipping.
Package rubygems-devel-2.6.13-100.fc28.noarch is already installed, skipping.
Package rubygem-xmlrpc-0.2.1-85.fc28.noarch is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
INFO: 
Finish: run

$ ls -la /var/lib/mock/fedora-rawhide-x86_64/root/etc/dnf/dnf.conf 
-rw-rw-r--. 1 root root 626 Jan  2 16.10 /var/lib/mock/fedora-rawhide-x86_64/root/etc/dnf/dnf.conf
~~~

But it seems that the yum.conf (which is empty) timestamp has not changed since creation of the build root

~~~
$ ls -la /var/lib/mock/fedora-rawhide-x86_64/root/etc/yum.conf 
lrwxrwxrwx. 1 root root 12 Jan  2 15:12 /var/lib/mock/fedora-rawhide-x86_64/root/etc/yum.conf -> yum/yum.conf
~~~

Comment 15 Fedora Update System 2018-01-02 16:26:10 UTC
mock-1.4.8-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2018-01-02 16:53:17 UTC
mock-1.4.8-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2018-01-09 16:18:04 UTC
mock-1.4.8-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora End Of Life 2018-02-20 15:39:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 19 Ben Cotton 2019-05-02 20:47:52 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 20 Ben Cotton 2019-05-28 22:39:19 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.