Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
belidzs opened this issue Mar 26, 2023 · 1 comment · Fixed by #23913
Closed

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

belidzs opened this issue Mar 26, 2023 · 1 comment · Fixed by #23913
Labels
Milestone

Comments

@belidzs
Copy link

belidzs commented Mar 26, 2023

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

@lunny lunny added this to the 1.19.1 milestone Apr 1, 2023
@lunny
Copy link
Member

lunny commented Apr 1, 2023

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.

jolheiser pushed a commit that referenced this issue Apr 6, 2023
Previously, deleted release attachments were kept forever on the
external storage.
Note: It may be very slow now if there are many attachments to be
deleted on this release.

Fix #23728
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Apr 6, 2023
…#23913)

Previously, deleted release attachments were kept forever on the
external storage.
Note: It may be very slow now if there are many attachments to be
deleted on this release.

Fix go-gitea#23728
jolheiser pushed a commit that referenced this issue Apr 6, 2023
…23958)

Backport #23913 by @lunny

Previously, deleted release attachments were kept forever on the
external storage.
Note: It may be very slow now if there are many attachments to be
deleted on this release.

Fix #23728

Co-authored-by: Lunny Xiao <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants