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

Renaming repositories does result in 500 error. #16427

Closed
2 of 6 tasks
onlygecko opened this issue Jul 14, 2021 · 15 comments · Fixed by #16435 or #16479
Closed
2 of 6 tasks

Renaming repositories does result in 500 error. #16427

onlygecko opened this issue Jul 14, 2021 · 15 comments · Fixed by #16435 or #16479

Comments

@onlygecko
Copy link

onlygecko commented Jul 14, 2021

  • Gitea version (or commit ref): 1.14.4
  • Git version: 2.32.0
  • Operating system: Windows 2019, Downloaded runable file from github, runs as a Windows service
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

I want to rename a repository but it isn't possible. I just get a "500" error. The log file contains the following message but not more:

2021/07/14 15:52:30 ...ters/repo/setting.go:102:SettingsPost() [E] ChangeRepositoryName: rename repository directory: rename C:\gitea\gitea-repositories\frohp\frohp-themen.git C:\gitea\gitea-repositories\frohp\frohp-themen-2.git: Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.
2021/07/14 15:52:30 ...s/context/context.go:184:HTML() [D] Template: status/500

In English the message is something like: The process can't access the file. It is open by another process.

Screenshots

Not relevant.

@zeripath
Copy link
Contributor

are you running the go-git or non-go-git variant?

@julian-go
Copy link

I am having the exact same issue, running this release on windows -> https://dl.gitea.io/gitea/1.14.4

@lunny
Copy link
Member

lunny commented Jul 14, 2021

Maybe you could close your anti-virus software and try again.

@julian-go
Copy link

julian-go commented Jul 14, 2021

Okay, I have found something. It seems to only happen if you use the option "initialize repository". It might be git doesn't free the .git file in the background.

Edit: If I create an empty repository I can rename it. If I initialize OR push to it, I cannot rename it any longer, resulting in error 500.

@zeripath
Copy link
Contributor

@julian-go are you running the go-git variant or not?

@zeripath
Copy link
Contributor

Can you try on 1.15 also.

@julian-go
Copy link

@julian-go are you running the go-git variant or not?

How can I find out?
It's this installer.

https://dl.gitea.io/gitea/1.14.4/gitea-1.14.4-windows-4.0-amd64.exe

@zeripath
Copy link
Contributor

OK you're running the non-gogit variant.

@zeripath
Copy link
Contributor

As lunny asks above are you @julian-go running antivirus?

@julian-go
Copy link

Yes, but its a corporate environment and I cannot turn it off unfortunately.

@onlygecko
Copy link
Author

I asked my admin if the virus scanner can be turned of for 10 minutes for testing purpose. I will let You know asap when I got a chance to test the behavior.

I use the same download file as @julian-go .

zeripath added a commit to zeripath/gitea that referenced this issue Jul 15, 2021
Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix go-gitea#16427

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath
Copy link
Contributor

Please try #16435

@onlygecko
Copy link
Author

The error occurs also with a disabled McAfee virus scanner. I will test again when a release with the commit #zeripath@05d4a69 is available.

@zeripath
Copy link
Contributor

It won't get released or merged without someone doing some testing.

@zeripath
Copy link
Contributor

I can make a build with #16435 backported to 1.14

techknowlogick added a commit that referenced this issue Jul 15, 2021
* Retry rename on lock induced failures

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix #16427

Signed-off-by: Andrew Thornton <art27@cantab.net>

* resolve CI fail

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
zeripath added a commit to zeripath/gitea that referenced this issue Jul 15, 2021
Backport go-gitea#16435

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix go-gitea#16427

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
lafriks pushed a commit that referenced this issue Jul 15, 2021
Backport #16435

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix #16427

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
zeripath added a commit to zeripath/gitea that referenced this issue Jul 18, 2021
…and to end

Fix go-gitea#16427 (again!)

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Jul 18, 2021
…and to end (go-gitea#16479)

Fix go-gitea#16427 (again!)

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Jul 18, 2021
…and to end

Fix go-gitea#16427 (again!)

Signed-off-by: Andrew Thornton <art27@cantab.net>
lafriks added a commit that referenced this issue Jul 20, 2021
…and to end (#16479)

Fix #16427 (again!)

* handle sharing violation error code

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
6543 pushed a commit that referenced this issue Jul 20, 2021
…and to end (#16479) (#16480)

* Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479)

Fix #16427 (again!)

* handle sharing violation error code

Signed-off-by: Andrew Thornton <art27@cantab.net>
6543 pushed a commit that referenced this issue Jul 21, 2021
…and to end (#16479) (#16481)

* Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end

Fix #16427 (again!)

* handle sharing violation error code

Signed-off-by: Andrew Thornton <art27@cantab.net>
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
* Retry rename on lock induced failures

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix go-gitea#16427

Signed-off-by: Andrew Thornton <art27@cantab.net>

* resolve CI fail

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
…and to end (go-gitea#16479)

Fix go-gitea#16427 (again!)

* handle sharing violation error code

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants