Skip to content

Attachments are not deleted in Minio storage after removing them from a Release #23728

@belidzs

Description

@belidzs

Description

I'm using B2 (their S3-compatible API) as my storage backend to store attachments, more specifically to store files attached to releases.

Uploading and downloading these attachments works as expected, however if I edit a release to remove an attachment, the file never gets deleted from the remote storage. It is removed from the database and from the UI as expected though.

Steps

  1. Set up an S3 compatible storage for attachments
  2. Create a new release on a repo
  3. Upload a file as an attachment
  4. Save the release
  5. Make note of the object name by hovering the mouse over it
  6. Edit the release
  7. Click on Remove next to the file
  8. Click on Update Release
  9. Verify that the object is still present in the object storage

Gitea Version

1.19.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/belidzs/ab40b7e65f7a8cac9b2434754ad07fa8

Screenshots

No response

Git Version

2.38.4

Operating System

Linux

How are you running Gitea?

It's running in a kubernetes cluster. I've used https://gitea.com/gitea/helm-chart/ to deploy it

Database

PostgreSQL

Activity

added this to the 1.19.1 milestone on Apr 1, 2023
lunny

lunny commented on Apr 1, 2023

@lunny
Member

ref https://github.com/go-gitea/gitea/blob/main/services/release/release.go#LL230C36-L230C36 . Looks like the last parameter is false which means not deleting the attachments.

added a commit that references this issue on Apr 6, 2023
e5dcd6a
added a commit that references this issue on Apr 6, 2023
5f12884
added a commit that references this issue on Apr 6, 2023
001d3fb
locked as resolved and limited conversation to collaborators on May 22, 2023
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

    Relationships

    None yet

      Development

      Participants

      @lunny@belidzs

      Issue actions

        Attachments are not deleted in Minio storage after removing them from a Release · Issue #23728 · go-gitea/gitea