Migration from GitHub fails with Error 1213 (40001): Deadlock found when trying to get lock; try restarting transaction #1323
Labels
No labels
accessibility
bug
bug
infrastructure
Codeberg
contributions welcome
docs
duplicate
enhancement
infrastructure
legal
licence / ToS
please chill
we are volunteers
public relations
question
question
user support
s/Forgejo
s/Forgejo/migration
s/Pages
s/Weblate
s/Woodpecker
security
service
upstream
wontfix
No milestone
No project
No assignees
12 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Codeberg/Community#1323
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Comment
I tried to migrate a (rather big) https://github.com/wxWidgets/wxWidgets.git repository from GitHub for testing it on Codeberg but migration unfortunately failed with the error message in the subject (there are no further details).
I used a token for migration, if it matters, and I didn't delete the repository just in case there could be something useful for diagnosing this issue in it.
@VadZ I cannot support technically but wanted to contribute that I am happy to hear you consider migrating this interesting and busy (75k+ commits and counting) repository to code berg. Welcome!
To be perfectly honest, this was just the first exploratory step, we don't have any concrete plans for migrating from GitHub yet, but I'd like to have a solution if this turns out to be necessary.
My bad, I used the wrong word "migrating" (I guess because most services suggest that).
What I really meant was more like "porting".
This is very likely related to forgejo/forgejo#220
We fixed a number of deadlocks in the past and for others we improved performance and optimized queries to reduce the chances that they occur. I am currently not aware of any other deadlocks that occur often or persist, but this one could be.
@VadZ I recommend that you retry the migration once, avoiding the rush hour during european evenings (16 - 23 CEST). If it still fails, we'll have a closer look. Please give us a precise timestamp.
Thanks, do you mean to give the time when I'll start the migration in advance or the time when it happens? I could try launching the migration again this night (2-3 CEST), but I wouldn't necessarily know when exactly it stops.
Try to tell us afterwards. We can search a little bit in the logs, but the more precise the better.
Sorry, no precise time stamp because it was taking too long and I logged off, but after retrying the migration last night, it ended with
this time.
Relevant log output:
Not sure what to take out of this. Did it simply timeout?
I've bumped into this issue earlier today while trying to migrate a repo from Gitea (https://codeberg.org/btlogy/trac-2024-05-23-deadlock):
Restarting is not possible and retrying has not helped: it either raises this error or get stuck w/o sending more request.
I only see the
Go-http-clientagent requesting all issues and comments from our self-hosted instance and stopping mid-migration and raising this error.Any idea what could be blocking this?
BTW: I've managed to migrate the same repository on the latest Forgejo (here).
Hmm, the deadlock problem is typically a load problem on Codeberg. Some time ago we fixed quite a lot of them, but there is no guarantee that we found all the problems.
Especially with many issues it is unfortunately rather hard to migrate to Codeberg, especially during times of high load.
I recommend to retry at a time with less activity (avoiding 12 - 24 CEST). I'll try to take a closer look, too.
Thank you @fnetX : I've migrated this morning and it has worked w/o raising this error.
This is still an issue today.
I got this error today trying to migrate from GitHub.
I got this error today while migrating https://codeberg.org/fsfe/reuse-tool from GitHub. I tried a few times, and then it worked.
@carmenbianca Glad that you managed to get in here after all. We are having database deadlocks in some cases from time to time, mostly related to some cron jobs that might or might not run in parallel. We still haven't figured out what exactly causes them. Retrying some hours later usually does the trick.
I am trying to migrate https://github.com/GCWizard/GCWizard but getting the deadlock issue as well, every time. Is there any fix right now?
It always happens on step "Migrating Issues", btw
@GC-Wizard test migration (git/issues/pull requests) of your repo to a forgejo instance took me about ~2,5hrs but succeeded.
I am trying to migrate https://github.com/blackmagic-debug/blackmagic if I have anything beyond just the basic repository enabled for migration I am hitting the Deadlock issue.
I have now tried to migrate this repository about 4 times over the last two weeks. And still getting the Deadlock error.
Is the only advise to continue attempting migration until it succeeds? Or is there some other method to get the migration accomplished?
Would be great if at least it kept trying on the background or in a cron. Does it?
Trying to setup a mirror from GitHub at https://codeberg.org/m0wer/joinmarket-ng
I've tried migrating https://github.com/bewcloud/bewcloud a few times already into https://codeberg.org/bewcloud/bewcloud and I keep getting that same error, unfortunately. Any suggestions?
i have experienced this too
I have observed that, for large migrations that fail with this error, waiting till fewer users are likely using the codeberg platform (3-4 am UTC) seemed to be a strategy that helped. This seems to be an issue related to contention for database access