Bug 1226322

Summary: dnf clean all does not clean package metadata for local repos
Product: [Fedora] Fedora Reporter: Tomáš Kašpárek <tkasparek>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: awfl.awfl, jsilhan, jzeleny, l4coa3fnjplr, mdomonko, mkubik, mluscon, packaging-team-maint, pnemade, pspacek, tim.lauridsen, tkasparek, vmukhame
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-1.1.6-1.fc23 dnf-1.1.6-2.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-17 04:23:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Requested file listings before and after dnf operations none

Description Tomáš Kašpárek 2015-05-29 12:40:29 UTC
Description of problem:
dnf clean all does remove package metadata which can be achieved by deleting /var/cache/dnf directory.

Version-Release number of selected component (if applicable):
dnf-1.0.0-1.fc22.noarch

How reproducible:
always

Steps to Reproduce:
1. create repo with some packages in it
2. force dnf to get metadata about repo created in step 1
3. add a package into repo
4. dnf clean all
5. dnf install/download/list newly added package

Actual results:
dnf is still using old repository metadata, albeit it does show that is creating new metadata, thus it ends up with error that package is not available

Expected results:
newly created metadata are valid and newly added package is present in dnf cache.

Additional info:
fully working (and workaround for the time being) is to rm -rf /var/cache/dnf

Comment 1 Petr Spacek 2015-07-16 09:36:48 UTC
I'm facing this, too.

Apparently 'clean all' does not clean metadata. Workaround is to run 'clean metadata' instead.

Comment 2 Honza Silhan 2015-07-24 09:14:20 UTC
Can you confirm whether it's fixed in dnf-1.0.2?
Petr, it doesn't clean metadata from local repo or any repo in general? Can you `tree /var/cache/dnf`, `dnf clean all`, `tree /var/cache/dnf`, `dnf clean metadata`, `tree /var/cache/dnf`, `dnf repolist` and share the output, please?

Comment 3 AWF 2015-08-12 02:15:13 UTC
Created attachment 1061767 [details]
Requested file listings before and after dnf operations

 The output of: tree /var/cache/dnf >junk.txt; dnf clean all >>junk.txt; tree /var/cache/dnf >>junk.txt; dnf clean metadata >>junk.txt; tree /var/cache/dnf >>junk.txt; dnf repolist >>junk.txt

Comment 4 AWF 2015-08-12 02:17:17 UTC
Fedup to F22 from F21; I noticed tonight that there some updates on the mirrors for well over a week that my system wasn't getting.

For example, dnf-1.0.2-3.fc22.noarch.rpm was on there July 31st and today is the 11th and it still was not seen by my system.

I went to /var/cache/dnf and believed that a "dnf clean all" wasn't cleaning everything. So I manually rm'ed the directory. It then immediately picked up several updates including the newer dnf-1.0.2-3.fc22.noarch.rpm.

Once updated, I once again then tried to do the dnf clean all and then dnf clean metadata, but it appeared that the metadata is still not being purged; that is, the .gz, .xz, and the repomd.xml file is still in the repodata folder(s) with old modification dates(?).

I really dont know how this works, but I have attached the requested info from above.

Comment 5 Honza Silhan 2015-08-12 09:47:38 UTC
related --refresh + clean all: https://lists.fedoraproject.org/pipermail/users/2015-August/463964.html

Comment 6 Michal Domonkos 2015-12-10 11:49:39 UTC
(In reply to Tomáš Kašpárek from comment #0)
> Description of problem:
> dnf clean all does remove package metadata which can be achieved by deleting
> /var/cache/dnf directory.
> 
> Version-Release number of selected component (if applicable):
> dnf-1.0.0-1.fc22.noarch
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> 1. create repo with some packages in it
> 2. force dnf to get metadata about repo created in step 1
> 3. add a package into repo
> 4. dnf clean all
> 5. dnf install/download/list newly added package
> 
> Actual results:
> dnf is still using old repository metadata, albeit it does show that is
> creating new metadata, thus it ends up with error that package is not
> available
> 
> Expected results:
> newly created metadata are valid and newly added package is present in dnf
> cache.
> 
> Additional info:
> fully working (and workaround for the time being) is to rm -rf /var/cache/dnf

Hi Tomas,

Was it a local repo that you were seeing the issue with?

Thanks!

Comment 7 Michal Domonkos 2015-12-10 12:30:21 UTC
Hi,

First of all, thanks for sharing the info!

> Once updated, I once again then tried to do the dnf clean all and then dnf
> clean metadata, but it appeared that the metadata is still not being purged;
> that is, the .gz, .xz, and the repomd.xml file is still in the repodata
> folder(s) with old modification dates(?).

According to the output you attached, the cache cleanup seems to be working properly.  The /var/cache/dnf/google-earth-17f28a61f303b7a2 dir (the only one that had some cache data initially) was indeed purged after you ran "dnf clean all".

I suppose you were referring to the files you saw under the x86_64 dir; these have actually been obsoleted in 1.0.2 which introduced a change in the cache structure and are no longer managed by dnf 1.0.2 going forward.  That's why you never see them getting purged on "dnf clean".

What puzzles me, though, is that the x86_64 dir apparently wasn't removed for you automatically when you upgraded dnf.  It should have been done by the %posttrans script.  I'll have a closer look.

Comment 8 Tomáš Kašpárek 2015-12-10 12:50:06 UTC
(In reply to Michal Domonkos from comment #6)
> 
> Hi Tomas,
> 
> Was it a local repo that you were seeing the issue with?
> 
> Thanks!

Yes, I was using local repo.

Comment 9 Fedora Update System 2016-01-26 10:34:25 UTC
dnf-plugins-core-0.1.16-1.fc23 dnf-1.1.6-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-80cbf309b4

Comment 10 Fedora Update System 2016-01-26 10:35:44 UTC
dnf-plugins-core-0.1.16-1.fc22 dnf-1.1.6-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37

Comment 11 Fedora Update System 2016-01-26 19:52:47 UTC
dnf-1.1.6-1.fc23, dnf-plugins-core-0.1.16-1.fc23 has been pushed to the Fedora 23 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-2016-80cbf309b4

Comment 12 Fedora Update System 2016-01-28 18:20:07 UTC
dnf-1.1.6-1.fc23, dnf-plugins-core-0.1.16-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-01-28 23:19:24 UTC
dnf-1.1.6-1.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 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-2016-573eba7b37

Comment 14 Fedora Update System 2016-02-03 13:06:40 UTC
dnf-1.1.6-2.fc22 dnf-plugins-core-0.1.16-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37

Comment 15 Fedora Update System 2016-02-03 23:26:55 UTC
dnf-1.1.6-2.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 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-2016-573eba7b37

Comment 16 Fedora Update System 2016-02-17 04:22:15 UTC
dnf-1.1.6-2.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.