Skip to content

Deleting RPMs via ui does not update filelists/other/primary xml metadata #34691

@lukester1975

Description

@lukester1975

Description

Hello

As per subject. Given a valid rpm registry state, e.g.

> curl -s --user ... http://localhost:3000/api/packages/test/rpm/fedora/42/repodata/other.xml.gz | gunzip | xmllint --format -

<?xml version="1.0" encoding="UTF-8"?>
<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="2">
  <package pkgid="d79745646597f9186213d64754acc39180e4b0058c659d2457d55d4d3096e141" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="2.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
  <package pkgid="fe3424957ed8f542b5efa7dd1960118de74e858950540c8287a80596cf689045" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="1.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
</otherdata>

Deleting a package via the UI (either the package settings page, or admin) does not update the registry's metadata:

> curl -s --user ... http://localhost:3000/api/packages/test/rpm/fedora/42/repodata/other.xml.gz | gunzip | xmllint --format -

<?xml version="1.0" encoding="UTF-8"?>
<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="2">
  <package pkgid="d79745646597f9186213d64754acc39180e4b0058c659d2457d55d4d3096e141" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="2.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
  <package pkgid="fe3424957ed8f542b5efa7dd1960118de74e858950540c8287a80596cf689045" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="1.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
</otherdata>

Both packages are still there, which obviously causes issues with dnf seeing incorrect state.

Deleting with a request directly to the rpm endpoint:

> curl --user ... -X DELETE http://localhost:3000/api/packages/test/rpm/fedora/42/package/onload/9.0.2_sdci-1.fc42/x86_64/

> curl -s --user ... http://localhost:3000/api/packages/test/rpm/fedora/42/repodata/other.xml.gz | gunzip | xmllint --format -

<?xml version="1.0" encoding="UTF-8"?>
<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="1">
  <package pkgid="d79745646597f9186213d64754acc39180e4b0058c659d2457d55d4d3096e141" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="2.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
</otherdata>

updates the metadata correctly.

The UI route services/packages/packages.go:RemovePackageVersion() never gets through to services/packages/rpm/repository.go:BuildSpecificRepositoryFiles() AFAICT. I'd offer to help figure out a solution, but go is not my thing... I'm guessing the rpm service needs to get the notification from notify_service.PackageDelete(ctx, doer, pd) from packages.go:RemovePackageVersion(), though.

Thanks

PS I have not looked if other registry types are similarly affected.

Gitea Version

1.24

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

n/a

Operating System

n/a

How are you running Gitea?

n/a

Database

PostgreSQL

Activity

ExplodingDragon

ExplodingDragon commented on Jun 11, 2025

@ExplodingDragon
Contributor

It looks a bug. There might be a similar issue in the package cleanup section, which needs to be investigated.

wxiaoguang

wxiaoguang commented on Jun 11, 2025

@wxiaoguang
Contributor

-> Deleting a debian package does not remove it from the apt Packages list that clients see #32830
-> Perform actions after a package was removed #22810

lukester1975

lukester1975 commented on Jun 11, 2025

@lukester1975
Author

Ah, very nice (sorry, didn't think to check for a similar debian issue).

A few conflicts needed fixing, but I've applied #22810 to 1.24 and it works. I guess this can be closed then.

Thanks!

wxiaoguang

wxiaoguang commented on Jun 11, 2025

@wxiaoguang
Contributor

Thank you for verifying that PR. It seems that PR needs someone to spend some time to polish and merge 😆

lukester1975

lukester1975 commented on Jun 11, 2025

@lukester1975
Author

That would be great. I'd offer but I'm too old to learn another language... The best I can offer is the trivial conflict fixes against 1.24: lukester1975@03654f2

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wxiaoguang@lukester1975@ExplodingDragon

        Issue actions

          Deleting RPMs via ui does not update filelists/other/primary xml metadata · Issue #34691 · go-gitea/gitea