Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1943964 - "dnf makecache" does not work when /etc/dnf/dnf.conf sets cacheonly=1
Summary: "dnf makecache" does not work when /etc/dnf/dnf.conf sets cacheonly=1
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: dnf-community
TreeView+ depends on / blocked
 
Reported: 2021-03-28 21:17 UTC by Neal Gompa
Modified: 2021-03-29 18:39 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Neal Gompa 2021-03-28 21:17:29 UTC
Description of problem:
When dnf.conf is set to cacheonly=1 to prevent automatically updating the cache, the dedicated makecache subcommand stops working, preventing *any* way to update the metadata without removing the setting.

Version-Release number of selected component (if applicable):
4.6.0-2.mga9 (same as 4.6.0-1.fc35)

How reproducible:
Always

Steps to Reproduce:
1. Edit /etc/dnf/dnf.conf to set cacheonly=True
2. Run "dnf makecache"

Actual results:
Does nothing and prints "Metadata cache created."

Expected results:
Overrides cacheonly setting and fetches metadata to cache.

Additional info:
Mageia would like DNF to only update metadata caches when "dnf makecache" is run rather than when the metadata expires, but this functionality does not work as expected.

Comment 1 Neal Gompa 2021-03-28 21:39:32 UTC
A few tests make me think that this whole path is broken:

[ngompa@mgacauldron-dev ~]$ sudo dnf clean expire-cache
Cache was expired
0 files removed
[ngompa@mgacauldron-dev ~]$ sudo dnf makecache
Metadata cache created.
[ngompa@mgacauldron-dev ~]$ sudo dnf clean all
206 files removed
[ngompa@mgacauldron-dev ~]$ sudo dnf makecache
Error: Cache-only enabled but no cache for 'cauldron-x86_64'

Comment 2 Daniel Mach 2021-03-29 12:11:33 UTC
`dnf makecache` should definitely ignore the cacheonly option.

Comment 3 Angelo Naselli 2021-03-29 18:33:00 UTC
I don't know if the code invoked is the same, though the output side effect look similar also if we force the cache to expire and then we update, hope this is the same case when the cache expires too:

- without cacheonly=True

# dnf clean expire-cache 
La cache è scaduta
0 file rimossi

# dnf update
Mageia 8 - x86_64                                                                                                                          7.4 kB/s | 4.3 kB     00:00    
Mageia 8 - x86_64 - Updates                                                                                                                6.4 kB/s | 3.3 kB     00:00    
Dipendenze risolte.
Nessuna operazione da compiere.
Fatto!

- with cacheonly=True
# dnf clean expire-cache 
La cache è scaduta
0 file rimossi
# dnf update
Ultima verifica della scadenza dei metadati: 0:00:32 fa il lun 29 mar 2021, 20:26:34.
Dipendenze risolte.
Nessuna operazione da compiere.
Fatto!

Comment 4 Angelo Naselli 2021-03-29 18:39:32 UTC
hmm well dnf clean expire-cache seems not to work either with cacheonly=True
as you can see "Ultima verifica della scadenza dei metadati: 0:00:32 fa il lun 29 mar 2021, 20:26:34." means that metadata is still timestamped to the before update.

So the above experiment should be performed adding cacheonly=True just after dnf clean expire-cache.

Then the output is:

# dnf update
Dipendenze risolte.
Nessuna operazione da compiere.
Fatto!

then if i remove cacheonly=True now:

# dnf update
Mageia 8 - x86_64                                                                                                                          6.4 kB/s | 4.3 kB     00:00    
Mageia 8 - x86_64 - Updates                                                                                                                6.0 kB/s | 3.3 kB     00:00    
Dipendenze risolte.
Nessuna operazione da compiere.
Fatto!


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