Migration from GitHub fails with Error 1213 (40001): Deadlock found when trying to get lock; try restarting transaction #1323

Open
opened 2023-10-25 17:43:25 +00:00 by VadZ · 8 comments

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.

### 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!

@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.

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".

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.

This is very likely related to https://codeberg.org/forgejo/forgejo/issues/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.

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.

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

PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1

this time.

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 > PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1 this time.

Relevant log output:

/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, bdca91c629c752bb733490dbb317c590646c4120, 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, include/wx/private/smartrowheightcache.h]: object does not exist [id: 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, rel_path: ]
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: io: read/write on closed pipe - 
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: io: read/write on closed pipe - 
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: io: read/write on closed pipe - 
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, bdca91c629c752bb733490dbb317c590646c4120, 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, include/wx/private/smartrowheightcache.h]: strconv.ParseInt: parsing "<mail@jensgoepfert.de> 1542805549 +0100": invalid syntax
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, bdca91c629c752bb733490dbb317c590646c4120, 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, include/wx/private/smartrowheightcache.h]: strconv.ParseInt: parsing "<mail@jensgoepfert.de> 1542805549 +0100": invalid syntax
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, bdca91c629c752bb733490dbb317c590646c4120, 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, include/wx/private/smartrowheightcache.h]: strconv.ParseInt: parsing "GetLineAt keeps unsigned int": invalid syntax
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ices/task/migrate.go:47:func1() [E] PANIC during runMigrateTask[28366] by DoerID[104903] to RepoID[156486] for OwnerID[104903]: runtime error: index out of range [1] with length 1
/data/git/log/gitea.log.2023-10-27.003.gz-Stacktrace: /home/build/build-deploy-forgejo/build/go-1.20.10/go/src/runtime/panic.go:113 (0x44203e)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/modules/git/diff.go:99 (0xd504f1)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/migrations/gitea_uploader.go:865 (0x22cffcf)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/migrations/migrate.go:445 (0x22e4c73)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/migrations/migrate.go:130 (0x22e2d9c)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/task/migrate.go:124 (0x25edca4)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/task/task.go:32 (0x25eebe4)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/task/task.go:50 (0x25eee8d)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/modules/queue/workerqueue.go:246 (0x1cb119c)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/modules/queue/workergroup.go:98 (0x1cb398d)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/modules/queue/workergroup.go:162 (0x1cb0ba8)
/data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/go-1.20.10/go/src/runtime/asm_amd64.s:1598 (0x47ba80)
/data/git/log/gitea.log.2023-10-27.003.gz:2023/10/27 07:46:06 ...ices/task/migrate.go:60:func1() [E] runMigrateTask[28366] by DoerID[104903] to RepoID[156486] for OwnerID[104903] failed: PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: signal: killed - 
/data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: signal: killed - 
/data/git/log/gitea.log.2023-10-27.003.gz:2023/10/27 07:46:06 ...ervices/task/task.go:51:handler() [E] Run task failed: PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1

Not sure what to take out of this. Did it simply timeout?

Relevant log output: ~~~ /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, bdca91c629c752bb733490dbb317c590646c4120, 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, include/wx/private/smartrowheightcache.h]: object does not exist [id: 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, rel_path: ] /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: io: read/write on closed pipe - /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: io: read/write on closed pipe - /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: io: read/write on closed pipe - /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, bdca91c629c752bb733490dbb317c590646c4120, 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, include/wx/private/smartrowheightcache.h]: strconv.ParseInt: parsing "<mail@jensgoepfert.de> 1542805549 +0100": invalid syntax /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, bdca91c629c752bb733490dbb317c590646c4120, 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, include/wx/private/smartrowheightcache.h]: strconv.ParseInt: parsing "<mail@jensgoepfert.de> 1542805549 +0100": invalid syntax /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, bdca91c629c752bb733490dbb317c590646c4120, 50e86881c9da270ea5d16390dcb53ffb5bebf5e8, include/wx/private/smartrowheightcache.h]: strconv.ParseInt: parsing "GetLineAt keeps unsigned int": invalid syntax /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ices/task/migrate.go:47:func1() [E] PANIC during runMigrateTask[28366] by DoerID[104903] to RepoID[156486] for OwnerID[104903]: runtime error: index out of range [1] with length 1 /data/git/log/gitea.log.2023-10-27.003.gz-Stacktrace: /home/build/build-deploy-forgejo/build/go-1.20.10/go/src/runtime/panic.go:113 (0x44203e) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/modules/git/diff.go:99 (0xd504f1) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/migrations/gitea_uploader.go:865 (0x22cffcf) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/migrations/migrate.go:445 (0x22e4c73) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/migrations/migrate.go:130 (0x22e2d9c) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/task/migrate.go:124 (0x25edca4) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/task/task.go:32 (0x25eebe4) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/services/task/task.go:50 (0x25eee8d) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/modules/queue/workerqueue.go:246 (0x1cb119c) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/modules/queue/workergroup.go:98 (0x1cb398d) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/gitea/modules/queue/workergroup.go:162 (0x1cb0ba8) /data/git/log/gitea.log.2023-10-27.003.gz-/home/build/build-deploy-forgejo/build/go-1.20.10/go/src/runtime/asm_amd64.s:1598 (0x47ba80) /data/git/log/gitea.log.2023-10-27.003.gz:2023/10/27 07:46:06 ...ices/task/migrate.go:60:func1() [E] runMigrateTask[28366] by DoerID[104903] to RepoID[156486] for OwnerID[104903] failed: PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1 /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: signal: killed - /data/git/log/gitea.log.2023-10-27.003.gz-2023/10/27 07:46:06 ...ns/gitea_uploader.go:880:func2() [W] GetRepoRawDiffForFile failed when migrating [/mnt/ceph-cluster/git/gitea-repositories/vadz/wxwidgets.git, 44b99195bc4395944bab8071c6d7adcbdcdf8773, da3117cbcc3cf311ef62d893ed48988b0d0c964c, configure.in]: Run: signal: killed - /data/git/log/gitea.log.2023-10-27.003.gz:2023/10/27 07:46:06 ...ervices/task/task.go:51:handler() [E] Run task failed: PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1 ~~~ Not sure what to take out of this. Did it simply timeout?
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Codeberg/Community#1323
There is no content yet.