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: 38
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: 2024-05-07 15:43 UTC (History)
10 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!

Comment 5 Ben Cotton 2021-08-10 13:45:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 6 Ben Cotton 2022-11-29 16:54:30 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
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
'version' of '35'.

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

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 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 Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 7 Ben Cotton 2023-02-07 15:08:51 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 8 Aoife Moloney 2024-05-07 15:43:22 UTC
This message is a reminder that Fedora Linux 38 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 38 on 2024-05-21.
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
'version' of '38'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 38 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 Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.


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