Skip to content
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

LFS file is not remove when branch is removed. #26668

Closed
ChameleonRed opened this issue Aug 22, 2023 · 4 comments
Closed

LFS file is not remove when branch is removed. #26668

ChameleonRed opened this issue Aug 22, 2023 · 4 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@ChameleonRed
Copy link

ChameleonRed commented Aug 22, 2023

Description

I use:

  1. I create branch with files.
  2. I convert files to lfs.
  3. I push this to gitea.
  4. I turn track git lfs track data/**/*.pdf.
  5. I push it to gitea.
  6. I delete branch with git push origin --delete this_branch.

Result branch is deleted but LFS file is not.

  1. Clean up changed nothing (4000 files exists as before).
  2. Clean LFS changed nothing (4000 files exists as before).

After check of files for repository.
Found 4145 blob pointer(s) - 4145 associated, 0 unassociated (0 missing from store)

After long wait for single file check.
No Commits found for this LFS file

File are ophan -> when I check but is it not visible until check each file separetly.

Gitea Version

1.20.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

2023/08/22 20:10:55 .../context_response.go:74:HTML() [D] Template: repo/settings/lfs
2023/08/22 20:11:00 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-parse
2023/08/22 20:11:00 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch-check
2023/08/22 20:11:00 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch
2023/08/22 20:11:00 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= for-each-ref "--format=%(objectname) %(refname)" refs/heads/ --sort=-committerdate
2023/08/22 20:11:00 .../context_response.go:74:HTML() [D] Template: repo/settings/lfs_file
2023/08/22 20:11:00 ...rvices/lfs/server.go:151:DownloadHandler() [E] Error whilst copying LFS OID[58b0ba3e938e3cf315dee80a22a9a49e261ca81e9a88f278b958842a01d53e0c] to the response after 917504 bytes. Error: http2: stream closed
2023/08/22 20:11:04 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-parse
2023/08/22 20:11:04 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch
2023/08/22 20:11:04 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch-check
2023/08/22 20:11:04 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= for-each-ref "--format=%(objectname) %(refname)" refs/heads/ --sort=-committerdate
2023/08/22 20:11:04 .../context_response.go:74:HTML() [D] Template: repo/settings/lfs
2023/08/22 20:11:05 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-parse
2023/08/22 20:11:05 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch
2023/08/22 20:11:05 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch-check
2023/08/22 20:11:05 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= for-each-ref "--format=%(objectname) %(refname)" refs/heads/ --sort=-committerdate
2023/08/22 20:11:05 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch
2023/08/22 20:11:05 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch-check --batch-all-objects
2023/08/22 20:11:06 .../context_response.go:74:HTML() [D] Template: repo/settings/lfs_pointers
2023/08/22 20:11:39 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-parse
2023/08/22 20:11:39 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch
2023/08/22 20:11:39 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch-check
2023/08/22 20:11:39 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= for-each-ref "--format=%(objectname) %(refname)" refs/heads/ --sort=-committerdate
2023/08/22 20:11:39 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-list --all
2023/08/22 20:12:28 ...dules/git/command.go:281:Run() [D] git.Command.RunDir(C:\Users\Cezary Wagner\gitea-repositories\cezary.wagner\medptr-v2.git): "C:\\Program Files\\Git\\cmd\\git.exe" -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= name-rev --stdin --name-only --always
2023/08/22 20:12:28 .../context_response.go:74:HTML() [D] Template: repo/settings/lfs_file_find

Git Version

2.42.0

Operating System

Windows 10

How are you running Gitea?

Windows 10 as service.

Database

SQLite

@lunny
Copy link
Member

lunny commented Aug 23, 2023

There is a background LFS GC task will do that later because of two reasons.
1 the LFS files maybe very big, so deletion needs some time
2 LFS pointers are shared across repositories, so we have a ref count in database.

@lunny lunny added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Aug 23, 2023
@ChameleonRed
Copy link
Author

ChameleonRed commented Aug 24, 2023

There is a background LFS GC task will do that later because of two reasons. 1 the LFS files maybe very big, so deletion needs some time 2 LFS pointers are shared across repositories, so we have a ref count in database.

It is different position and what you wrote do not apply to it.

  1. View shows that file has relation and has not relation - nothing can be both true and false.
  2. Not take time. -> Cron job is off - so it is not need time - I run job manually multiple time - no change I found.
  3. Pointers is not shared. -> Files are specific to one project.

I try to test it on docker image maybe to check if Linux version also has bug.

@ChameleonRed
Copy link
Author

Looks same problem is with gitea\gitea docker image - no clean action is done after removal branch with LFS files - not used LFS file is not removed and visible as used before specific file check.

Same behavior I think.

@GiteaBot
Copy link
Collaborator

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

3 participants