Bug 1899852 - repomanage is broken, reports not existing packages
Summary: repomanage is broken, reports not existing packages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: amatej
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-20 09:01 UTC by Remi Collet
Modified: 2021-05-03 01:48 UTC (History)
9 users (show)

Fixed In Version: dnf-plugins-core-4.0.21-1.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-03 01:48:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Remi Collet 2020-11-20 09:01:09 UTC
Was working fine in F31 (version 4.0.18-1)

Is broken in F33 (version 4.0.18-1)


Playing with my repository, ex https://rpms.remirepo.net/SRPMS/
Were I keep 8 versions of each package, and also 8 versions of the metadata


$ dnf repomanage --keep 8 --old .
Added repomanage_repo repo from .
./ImageMagick6-6.9.11.30-1.remi.src.rpm
./ImageMagick7-7.0.10.30-1.remi.src.rpm
./php-pecl-datadog-trace-0.47.0-1.remi.src.rpm
./php-pecl-ip2location-8.0.1-2.remi.src.rpm
./php-pecl-skywalking-3.2.6-1.remi.src.rpm
./php80-php-8.0.0~beta2-29.remi.src.rpm


These packages don't exist (but are probably referenced in some old metadata)

So looks like repomanage is not reading the proper data.

Comment 1 Remi Collet 2020-11-20 09:02:57 UTC
Side effects, some packages are not reported so are not removed... thus more than 8 versions exist in the repo

Comment 2 amatej 2020-11-23 07:50:37 UTC
In order to support modular repositories repomanage now has to use the present repodata, but I made an error while adding this functionality which causes repomanage to use old (cached) repodata when running it multiple times. 

So in your case its possible it keeps using some old version of the metadata that still has the deleted packages. Can you please try running repomanage with option --setopt=metadata_expire=1 as a workaround to see if this fixes your problem?

Comment 3 Remi Collet 2020-11-23 08:05:43 UTC
$ dnf repomanage --keep 8 --old . --setopt=metadata_expire=1
Ajout du dépôt repomanage_repo depuis le .
./ImageMagick6-6.9.11.31-1.remi.src.rpm
./ImageMagick7-7.0.10.31-1.remi.src.rpm
./php-pecl-swoole4-4.5.3-1.remi.src.rpm


So, yes, this seems to work as expected.

Comment 4 Remi Collet 2020-11-23 08:08:07 UTC
> In order to support modular repositories repomanage now has to use the present repodata

Does that mean, repomanage have to be run "after" a createrepo ?

Old process was

- repomanage
- createrepo

Do I have to

- createrepo
- repomanage
- createrepo

Comment 5 Remi Collet 2020-11-23 08:27:13 UTC
From a new test it seems that process have change as described in my previous comment...

Comment 6 amatej 2020-11-23 08:31:45 UTC
Here is a PR to fix the mentioned bug with caching:
https://github.com/rpm-software-management/dnf-plugins-core/pull/414
and a test:
https://github.com/rpm-software-management/ci-dnf-stack/pull/913

> Does that mean, repomanage have to be run "after" a createrepo ?

It depends, but if you have old out of date repodata present (meaning you added/removed rpms since last run of createrepo) then yes, you have to either update the repodata (running createrepo) or remove them (modules won't work).

Comment 7 Remi Collet 2020-11-23 08:53:50 UTC
Thanks for your effort, but looks like this command doesn't suit my needs anymore.

Switching to a small PHP script doing the work instead

Comment 8 Fedora Update System 2021-04-19 16:12:43 UTC
FEDORA-2021-447fb19490 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-447fb19490

Comment 9 Fedora Update System 2021-04-19 18:33:36 UTC
FEDORA-2021-447fb19490 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-447fb19490`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-447fb19490

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2021-05-03 01:48:14 UTC
FEDORA-2021-447fb19490 has been pushed to the Fedora 33 stable repository.
If problem still persists, 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.