Skip to content

Error "failed to update size for mirror repository: updateSize: lstat [...] no such file or directory" #26765

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
pboguslawski opened this issue Aug 28, 2023 · 4 comments · Fixed by #28276
Labels

Comments

@pboguslawski
Copy link
Contributor

pboguslawski commented Aug 28, 2023

Description

Errors like

2023/08/27 17:07:40 ...irror/mirror_pull.go:308:runSync() [E] [64eb66a8-2] SyncMirrors [repo: 2:someorg/somerepo]: failed to update size for mirror repository: updateSize: lstat /path/to/repo/someorg/somerepo.git/objects/05/tmp_obj_Y5itXx: no such file or directory

rarely occur in gitea 1.19 while syncing mirror. No such problem on next mirror sync.

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Compiled from source.

Database

MySQL

@CaiCandong
Copy link
Member

Weird, the code already handles this situation

err := filepath.WalkDir(path, func(_ string, info os.DirEntry, err error) error {
if err != nil {
if os.IsNotExist(err) { // ignore the error because the file maybe deleted during traversing.
return nil
}

@wxiaoguang
Copy link
Contributor

Because, the fix is incomplete

image

@CaiCandong
Copy link
Member

But the message he got is the file doesn't exist

lstat /path/to/repo/someorg/somerepo.git/objects/05/tmp_obj_Y5itXx: no such file or directory

@wxiaoguang
Copy link
Contributor

Yes, info.Info() calls lstat

wxiaoguang added a commit that referenced this issue Nov 29, 2023
#28276)

The git command may operate the git directory (add/remove) files in any
time.

So when the code iterates the directory, some files may disappear during
the "walk". All "IsNotExist" errors should be ignored.

Fix #26765
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2024
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
go-gitea#28276)

The git command may operate the git directory (add/remove) files in any
time.

So when the code iterates the directory, some files may disappear during
the "walk". All "IsNotExist" errors should be ignored.

Fix go-gitea#26765
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
go-gitea#28276)

The git command may operate the git directory (add/remove) files in any
time.

So when the code iterates the directory, some files may disappear during
the "walk". All "IsNotExist" errors should be ignored.

Fix go-gitea#26765
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.

3 participants