Bug 1226322 - dnf clean all does not clean package metadata for local repos
dnf clean all does not clean package metadata for local repos
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
22
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-29 08:40 EDT by Tomáš Kašpárek
Modified: 2016-02-16 23:23 EST (History)
13 users (show)

See Also:
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-16 23:23:10 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Requested file listings before and after dnf operations (15.49 KB, text/plain)
2015-08-11 22:15 EDT, AWF
no flags Details

  None (edit)
Description Tomáš Kašpárek 2015-05-29 08:40:29 EDT
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 05:36:48 EDT
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 05:14:20 EDT
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-11 22:15:13 EDT
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-11 22:17:17 EDT
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 05:47:38 EDT
related --refresh + clean all: https://lists.fedoraproject.org/pipermail/users/2015-August/463964.html
Comment 6 Michal Domonkos 2015-12-10 06:49:39 EST
(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 07:30:21 EST
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 07:50:06 EST
(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 05:34:25 EST
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 05:35:44 EST
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 14:52:47 EST
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 13:20:07 EST
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 18:19:24 EST
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 08:06:40 EST
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 18:26:55 EST
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-16 23:22:15 EST
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.

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