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

Failed mirror will be not deleted #17571

Closed
somera opened this issue Nov 6, 2021 · 7 comments · Fixed by #17575
Closed

Failed mirror will be not deleted #17571

somera opened this issue Nov 6, 2021 · 7 comments · Fixed by #17575

Comments

@somera
Copy link

somera commented Nov 6, 2021

Gitea Version

1.15.6

Git Version

2.25.1

Operating System

Ubuntu 20.04.3

How are you running Gitea?

Self hostet

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

Just try to mirror an not existing project. Gitea (can be resproduce on Gitea demo site with 1.60.x too) creates a new project. Afte the error will be shown, the created project will be not remowed. If you open it in Giteate (https://try.gitea.io/somera/nethogss) than you see HTTP ERROR 500. The project could be deleted only in the admin repo view.

This bug exists (I think) since Gitea 1.15.4 or 1.15.5.

Screenshots

No response

@zeripath
Copy link
Contributor

zeripath commented Nov 6, 2021

@somera
Copy link
Author

somera commented Nov 6, 2021

Yes, this works in gitea 1.15.6. I didn't try this before.

But you changed behavior in the latest versions. Was there a reason for this?

@zeripath
Copy link
Contributor

zeripath commented Nov 6, 2021

When you say mirror, exactly what do you mean? A repository migration from git, github, gitea or other?

Do you have any logs from when the mirror failed?

@somera
Copy link
Author

somera commented Nov 6, 2021

When you say mirror, exactly what do you mean? A repository migration from git, github, gitea or other?

Yes, just start new mirror.

Do you have any logs from when the mirror failed?

Nope. I can't see any error. Cause I disabled logging. You can reproduce it on your local instance too.

Try with this: https://github.com/screeps/driverr.git (right URL is https://github.com/screeps/driver.git). With the wrong URL (or if there are some problems cause GitHub is temporary blocking you) Gitea creates an corrupted repo. In the earlier Gitea versions this repo was automatically deleted.

@zeripath
Copy link
Contributor

zeripath commented Nov 6, 2021

When you say mirror, exactly what do you mean? A repository migration from git, github, gitea or other?

Yes, just start new mirror.

This is not enough information. Using the Git migration does not reproduce the bug - it appears I need to use the Github migration to reproduce this.

Do you have any logs from when the mirror failed?

Nope. I can't see any error. Cause I disabled logging. You can reproduce it on your local instance too.

!!

Please help us to help you. Give us logs in future.

None of us are paid to work on Gitea it's not fair to make us run around reproducing things.

Try with this: https://github.com/screeps/driverr.git (right URL is https://github.com/screeps/driver.git). With the wrong URL (or if there are some problems cause GitHub is temporary blocking you) Gitea creates an corrupted repo. In the earlier Gitea versions this repo was automatically deleted.

Thanks! This is the information I needed to reproduce.


2021/11/06 22:48:14 ...ers/web/repo/view.go:585:checkHomeCodeViewable() [E] models.GetMigratingTask: task is not exist [id: 0, repo_id: 166, type: 0]
2021/11/06 22:48:14 ...s/context/context.go:185:HTML() [D] Template: status/500

This is the Error.

To reproduce:

@somera
Copy link
Author

somera commented Nov 6, 2021

When you say mirror, exactly what do you mean? A repository migration from git, github, gitea or other?

Yes, just start new mirror.

This is not enough information. Using the Git migration does not reproduce the bug - it appears I need to use the Github migration to reproduce this.

Do you have any logs from when the mirror failed?

Nope. I can't see any error. Cause I disabled logging. You can reproduce it on your local instance too.

!!

Please help us to help you. Give us logs in future.

I run my gitea instance with logging. But this slows it down. And I follow you words about logging (#15412)

  • Please, just set STACKTRACE_LEVEL = none it's not helpful except in very very rare levels.
  • Please, if it is at all possible, when sending us logs, send all of your logs to the console as it is the simplest way to get them all together and nicely interleaved.
  • Setting the LEVEL=error for everything including the xorm logger is the reason you're not seeing any SQL logs.
  • In this case SQL logs will be helpful

and I had no logg error message in my logs. I can't every time edid the config and restart my Gitea instance. In this case I reproduced the problem on the Gitea try instance. And I was sure, you can check the logs there.

None of us are paid to work on Gitea it's not fair to make us run around reproducing things.

This is right. but at the end you have to reproduce the problem. This is the development way. If it'S easy to reproduce. Or not.

Try with this: https://github.com/screeps/driverr.git (right URL is https://github.com/screeps/driver.git). With the wrong URL (or if there are some problems cause GitHub is temporary blocking you) Gitea creates an corrupted repo. In the earlier Gitea versions this repo was automatically deleted.

Thanks! This is the information I needed to reproduce.

2021/11/06 22:48:14 ...ers/web/repo/view.go:585:checkHomeCodeViewable() [E] models.GetMigratingTask: task is not exist [id: 0, repo_id: 166, type: 0]
2021/11/06 22:48:14 ...s/context/context.go:185:HTML() [D] Template: status/500

This is the Error.

I don't see this errro on my instance. And my logging is set to error.

I see this error (I added stacktraces):

==> gitea.log <==
2021/11/07 00:12:36 modules/task/task.go:54:handle() [E] Run task failed: GET https://api.github.com/repos/screeps/driverr: 404 Not Found []
        /source/modules/task/task.go:54 (0x202e232)
        /source/modules/queue/workerpool.go:408 (0x1e59e68)
        /source/modules/queue/workerpool.go:261 (0x1e5c824)
        /usr/local/go/src/runtime/asm_amd64.s:1371 (0x47aa80)

To reproduce:

Or If you will be blocked by too many requests (HTTP ERROR 429) Gitea is creating an corrupted repo since 1.15.5. Before this version the mirror was deleted.

@somera
Copy link
Author

somera commented Nov 6, 2021

The other error message was:

2021/10/23 13:15:38 modules/task/task.go:54:handle() [E] Run task failed: GET https://api.github.com/repos/jcuda/jcuda: 403 API rate limit of 60 still exceeded until 2021-10-23 13:23:45 +0200 CEST, not making remote request. [rate reset in 8m07s]

I reported it 15 days ago.

zeripath added a commit to zeripath/gitea that referenced this issue Nov 6, 2021
There is a bug in handling failed migrations whereby the migration task gets decoupled
from the migration repository. This leads to a failure of the task to get deleted with
the repository and also leads to the migration failed page resulting in a ISE.

This PR removes the zeroing out of the task id from the migration but also makes
the migration handler tolerate missing tasks much nicer.

Fix go-gitea#17571

Signed-off-by: Andrew Thornton <art27@cantab.net>
wxiaoguang pushed a commit that referenced this issue Nov 13, 2021
* Correctly handle failed migrations

There is a bug in handling failed migrations whereby the migration task gets decoupled
from the migration repository. This leads to a failure of the task to get deleted with
the repository and also leads to the migration failed page resulting in a ISE.

This PR removes the zeroing out of the task id from the migration but also makes
the migration handler tolerate missing tasks much nicer.

Fix #17571

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Dec 25, 2021
* Correctly handle failed migrations

There is a bug in handling failed migrations whereby the migration task gets decoupled
from the migration repository. This leads to a failure of the task to get deleted with
the repository and also leads to the migration failed page resulting in a ISE.

This PR removes the zeroing out of the task id from the migration but also makes
the migration handler tolerate missing tasks much nicer.

Fix go-gitea#17571

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Dec 25, 2021
* Correctly handle failed migrations

There is a bug in handling failed migrations whereby the migration task gets decoupled
from the migration repository. This leads to a failure of the task to get deleted with
the repository and also leads to the migration failed page resulting in a ISE.

This PR removes the zeroing out of the task id from the migration but also makes
the migration handler tolerate missing tasks much nicer.

Fix #17571

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
* Correctly handle failed migrations

There is a bug in handling failed migrations whereby the migration task gets decoupled
from the migration repository. This leads to a failure of the task to get deleted with
the repository and also leads to the migration failed page resulting in a ISE.

This PR removes the zeroing out of the task id from the migration but also makes
the migration handler tolerate missing tasks much nicer.

Fix go-gitea#17571

Signed-off-by: Andrew Thornton <art27@cantab.net>
@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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants