Skip to content

Action (accept_transfer): The process cannot access the file because it is being used by another process. #17885

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
doggy8088 opened this issue Dec 2, 2021 · 3 comments · Fixed by #18049
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@doggy8088
Copy link
Contributor

Gitea Version

1.15.6

Git Version

2.34.1

Operating System

Windows Server 2019

How are you running Gitea?

I'm running Gitea as a Windows Service on Windows Server 2019 using LocalSystem identity.

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/doggy8088/24746886bc6f55ff933dfef676b8c215

Description

I want to transfer repo's ownership to another account in my On-Prem Gitea installation. After I applied transfer to another account, the account opened his own notification message. Then press the green Approved button. The screen shows 500. All the detailed error log has been attached on this issue.

I doubted it's a bug on Windows Gitea.

Screenshots

N/A

@silverwind
Copy link
Member

This is almost certainly a Windows-only issue where some other process might "lock" the file by keeping a handle open. You can try using https://docs.microsoft.com/en-us/sysinternals/downloads/handle to find out which process it is.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Dec 4, 2021
@doggy8088
Copy link
Contributor Author

@silverwind
It seems gitea.exe locked the repo folder/files by itself. After I press "Accept Transfer" button, I tried to run the following command. Nothing been locked. Is it possible Gitea on Windows locked the repo folder before accept transfer due to some unknown reason?

handle D:\Gitea

image

@zeripath
Copy link
Contributor

zeripath commented Dec 6, 2021

Yup almost certainly we've locked the repo ourselves. Probably it's in ctx.Repo.GitRepo and we need to close that before we move the repo.

zeripath added a commit to zeripath/gitea that referenced this issue Dec 20, 2021
Repository Transfer requires that the repository directory is renamed - which
is not possible on Windows if the git repository is open.

Fix go-gitea#17885

Signed-off-by: Andrew Thornton <[email protected]>
lunny added a commit that referenced this issue Dec 21, 2021
Repository Transfer requires that the repository directory is renamed - which
is not possible on Windows if the git repository is open.

Fix #17885

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this issue Dec 21, 2021
Backport go-gitea#18049

Repository Transfer requires that the repository directory is renamed - which
is not possible on Windows if the git repository is open.

Fix go-gitea#17885

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
zeripath added a commit that referenced this issue Dec 21, 2021
Backport #18049

Repository Transfer requires that the repository directory is renamed - which
is not possible on Windows if the git repository is open.

Fix #17885

Signed-off-by: Andrew Thornton <[email protected]>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
Repository Transfer requires that the repository directory is renamed - which
is not possible on Windows if the git repository is open.

Fix go-gitea#17885

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
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

Successfully merging a pull request may close this issue.

4 participants