LFS files not deleted with repository #4078

Closed
opened 2025-11-02 05:36:51 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @8ctopus on GitHub (Oct 8, 2019).

  • Gitea version (or commit ref): 1.9.3
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04.3 LTS
  • Database (use [x]):
    • MySQL
  • Can you reproduce the bug at https://try.gitea.io:
    • Not relevant
  • Log gist:

How to reproduce:

  1. Clean installation of gitea 1.9.3 on Ubuntu with git LFS enabled and path set
ROOT = /home/gitea/gitea-repositories
LFS_START_SERVER = true
LFS_CONTENT_PATH = /home/gitea/data/lfs
  1. Create a new repository "repo" in gitea
  2. Clone the repository
git clone https://mydomain/gitea/company/repo.git
  1. Add LFS tracking and add a file to LFS
cd repo
git lfs track "*.zip"
cp ../file.zip .
git add .gitattributes file.zip
git commit -m "added: zip file LFS tracked"
git push origin master
  1. In gitea, delete the repository.
  2. On the server filesystem, the /home/gitea/data/lfs directory is not empty and still contains the zip file.
/home/gitea/data/lfs # ls -alRh
.:
total 12K
drwxr-xr-x 3 gitea gitea 4.0K Oct  8 07:20 .
drwxr-xr-x 3 gitea gitea 4.0K Oct  3 11:30 ..
drwxr-x--- 3 gitea gitea 4.0K Oct  8 07:20 31

./31:
total 12K
drwxr-x--- 3 gitea gitea 4.0K Oct  8 07:20 .
drwxr-xr-x 3 gitea gitea 4.0K Oct  8 07:20 ..
drwxr-x--- 2 gitea gitea 4.0K Oct  8 07:22 7e

./31/7e:
total 7.5M
drwxr-x--- 2 gitea gitea 4.0K Oct  8 07:22 .
drwxr-x--- 3 gitea gitea 4.0K Oct  8 07:20 ..
-rw-r----- 1 gitea gitea 7.5M Oct  8 07:21 ff4325718b51c0fabcd514539af2d1d6db8b8d458a2cc8a724d57d615bd8
Originally created by @8ctopus on GitHub (Oct 8, 2019). - Gitea version (or commit ref): 1.9.3 - Git version: 2.17.1 - Operating system: Ubuntu 18.04.3 LTS - Database (use `[x]`): - [x] MySQL - Can you reproduce the bug at https://try.gitea.io: - [x] Not relevant - Log gist: How to reproduce: 1. Clean installation of gitea 1.9.3 on Ubuntu with git LFS enabled and path set ``` ROOT = /home/gitea/gitea-repositories LFS_START_SERVER = true LFS_CONTENT_PATH = /home/gitea/data/lfs ``` 2. Create a new repository "repo" in gitea 3. Clone the repository ``` git clone https://mydomain/gitea/company/repo.git ``` 4. Add LFS tracking and add a file to LFS ``` cd repo git lfs track "*.zip" cp ../file.zip . git add .gitattributes file.zip git commit -m "added: zip file LFS tracked" git push origin master ``` 5. In gitea, delete the repository. 6. On the server filesystem, the /home/gitea/data/lfs directory is not empty and still contains the zip file. ``` /home/gitea/data/lfs # ls -alRh .: total 12K drwxr-xr-x 3 gitea gitea 4.0K Oct 8 07:20 . drwxr-xr-x 3 gitea gitea 4.0K Oct 3 11:30 .. drwxr-x--- 3 gitea gitea 4.0K Oct 8 07:20 31 ./31: total 12K drwxr-x--- 3 gitea gitea 4.0K Oct 8 07:20 . drwxr-xr-x 3 gitea gitea 4.0K Oct 8 07:20 .. drwxr-x--- 2 gitea gitea 4.0K Oct 8 07:22 7e ./31/7e: total 7.5M drwxr-x--- 2 gitea gitea 4.0K Oct 8 07:22 . drwxr-x--- 3 gitea gitea 4.0K Oct 8 07:20 .. -rw-r----- 1 gitea gitea 7.5M Oct 8 07:21 ff4325718b51c0fabcd514539af2d1d6db8b8d458a2cc8a724d57d615bd8 ```
GiteaMirror added the issue/regression label 2025-11-02 05:36:51 -06:00
Author
Owner

@zeripath commented on GitHub (Oct 10, 2019):

Hmm this was previously fixed ... This must be a regression.

Is there an error in the logs on repository deletion?

@zeripath commented on GitHub (Oct 10, 2019): Hmm this was previously fixed ... This must be a regression. Is there an error in the logs on repository deletion?
Author
Owner

@zeripath commented on GitHub (Oct 10, 2019):

Damn I think this is my fault. LFS files need to be deleted relative to the root of the content path.

#8455 should fix this.

@zeripath commented on GitHub (Oct 10, 2019): Damn I think this is my fault. LFS files need to be deleted relative to the root of the content path. #8455 should fix this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4078