GitHub Migration: PANIC whilst trying to do migrate task: runtime error: index out of range #12142

Closed
opened 2025-11-02 09:59:55 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @joseluisq on GitHub (Dec 3, 2023).

Description

When migrating one of my projects using two GH tokens (comma-separated), it panics at run time after some minutes. Here are the relevant lines.

2023/12/03 02:57:48 ...ers/web/user/home.go:506:buildIssueOverview() [E] CountIssuesByRepo: context canceled
2023/12/03 03:32:59 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [480]static-web-server/static-web-server#46[master...richbayliss/support-try-files]>]: branch does not exist [repo_id: 0 name: richbayliss/support-try-files]
2023/12/03 03:34:16 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [536]static-web-server/static-web-server#198[master...wasix-fixes]>]: branch does not exist [repo_id: 0 name: wasix-fixes]
2023/12/03 03:34:16 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [522]static-web-server/static-web-server#168[master...dependabot/cargo/tokio-1.23.1]>]: branch does not exist [repo_id: 0 name: dependabot/cargo/tokio-1.23.1]
2023/12/03 03:34:16 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [523]static-web-server/static-web-server#170[master...dependabot/cargo/tokio-1.24.2]>]: branch does not exist [repo_id: 0 name: dependabot/cargo/tokio-1.24.2]
2023/12/03 03:34:16 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [555]static-web-server/static-web-server#247[master...async-io]>]: branch does not exist [repo_id: 0 name: async-io]
2023/12/03 03:34:59 ...ices/task/migrate.go:48:func1() [E] PANIC during runMigrateTask[125] by DoerID[1] to RepoID[273] for OwnerID[35]: runtime error: index out of range [1] with length 1
Stacktrace: /usr/local/go/src/runtime/panic.go:114 (0x43cc5b)
/go/src/code.gitea.io/gitea/modules/git/diff.go:99 (0xd9328a)
/go/src/code.gitea.io/gitea/services/migrations/gitea_uploader.go:866 (0x2245add)
/go/src/code.gitea.io/gitea/services/migrations/migrate.go:445 (0x225a3e6)
/go/src/code.gitea.io/gitea/services/migrations/migrate.go:130 (0x22585ca)
/go/src/code.gitea.io/gitea/services/task/migrate.go:125 (0x24ee548)
/go/src/code.gitea.io/gitea/services/task/task.go:34 (0x24ef4a4)
/go/src/code.gitea.io/gitea/services/task/task.go:52 (0x24ef73a)
/go/src/code.gitea.io/gitea/modules/queue/workerqueue.go:246 (0x1e35991)
/go/src/code.gitea.io/gitea/modules/queue/workergroup.go:98 (0x1a61d22)
/go/src/code.gitea.io/gitea/modules/queue/workergroup.go:162 (0x1e34269)
/usr/local/go/src/runtime/asm_amd64.s:1650 (0x475860)
2023/12/03 03:34:59 ...ices/task/migrate.go:61:func1() [E] runMigrateTask[125] by DoerID[1] to RepoID[273] for OwnerID[35] failed: PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1
2023/12/03 03:34:59 ...ervices/task/task.go:53:handler() [E] Run task failed: PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1

See the complete log gists.

It can be related to https://github.com/go-gitea/gitea/issues/25245 but it is not the same problem.

Gitea Version

1.21.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/joseluisq/8af3222f4a879acf732adcf6a6f36b81

Screenshots

image

Git Version

2.40.1

Operating System

Debian Linux 11 x86_64

How are you running Gitea?

On Docker 24.0.7 with Postgres 13

Database

PostgreSQL 13

Originally created by @joseluisq on GitHub (Dec 3, 2023). ### Description When migrating one of [my projects](https://github.com/static-web-server/static-web-server/) using two GH tokens (comma-separated), it panics at run time after some minutes. Here are the relevant lines. ```log 2023/12/03 02:57:48 ...ers/web/user/home.go:506:buildIssueOverview() [E] CountIssuesByRepo: context canceled 2023/12/03 03:32:59 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [480]static-web-server/static-web-server#46[master...richbayliss/support-try-files]>]: branch does not exist [repo_id: 0 name: richbayliss/support-try-files] 2023/12/03 03:34:16 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [536]static-web-server/static-web-server#198[master...wasix-fixes]>]: branch does not exist [repo_id: 0 name: wasix-fixes] 2023/12/03 03:34:16 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [522]static-web-server/static-web-server#168[master...dependabot/cargo/tokio-1.23.1]>]: branch does not exist [repo_id: 0 name: dependabot/cargo/tokio-1.23.1] 2023/12/03 03:34:16 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [523]static-web-server/static-web-server#170[master...dependabot/cargo/tokio-1.24.2]>]: branch does not exist [repo_id: 0 name: dependabot/cargo/tokio-1.24.2] 2023/12/03 03:34:16 ...rvices/pull/check.go:361:testPR() [E] testPatch[<PullRequest [555]static-web-server/static-web-server#247[master...async-io]>]: branch does not exist [repo_id: 0 name: async-io] 2023/12/03 03:34:59 ...ices/task/migrate.go:48:func1() [E] PANIC during runMigrateTask[125] by DoerID[1] to RepoID[273] for OwnerID[35]: runtime error: index out of range [1] with length 1 Stacktrace: /usr/local/go/src/runtime/panic.go:114 (0x43cc5b) /go/src/code.gitea.io/gitea/modules/git/diff.go:99 (0xd9328a) /go/src/code.gitea.io/gitea/services/migrations/gitea_uploader.go:866 (0x2245add) /go/src/code.gitea.io/gitea/services/migrations/migrate.go:445 (0x225a3e6) /go/src/code.gitea.io/gitea/services/migrations/migrate.go:130 (0x22585ca) /go/src/code.gitea.io/gitea/services/task/migrate.go:125 (0x24ee548) /go/src/code.gitea.io/gitea/services/task/task.go:34 (0x24ef4a4) /go/src/code.gitea.io/gitea/services/task/task.go:52 (0x24ef73a) /go/src/code.gitea.io/gitea/modules/queue/workerqueue.go:246 (0x1e35991) /go/src/code.gitea.io/gitea/modules/queue/workergroup.go:98 (0x1a61d22) /go/src/code.gitea.io/gitea/modules/queue/workergroup.go:162 (0x1e34269) /usr/local/go/src/runtime/asm_amd64.s:1650 (0x475860) 2023/12/03 03:34:59 ...ices/task/migrate.go:61:func1() [E] runMigrateTask[125] by DoerID[1] to RepoID[273] for OwnerID[35] failed: PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1 2023/12/03 03:34:59 ...ervices/task/task.go:53:handler() [E] Run task failed: PANIC whilst trying to do migrate task: runtime error: index out of range [1] with length 1 ``` See the complete [log gists](https://gist.github.com/joseluisq/8af3222f4a879acf732adcf6a6f36b81). It can be related to https://github.com/go-gitea/gitea/issues/25245 but it is not the same problem. ### Gitea Version 1.21.1 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist https://gist.github.com/joseluisq/8af3222f4a879acf732adcf6a6f36b81 ### Screenshots <img width="587" alt="image" src="https://github.com/go-gitea/gitea/assets/1700322/5f7f40f4-6bfc-4743-9a5a-ede2715e62fc"> ### Git Version 2.40.1 ### Operating System Debian Linux 11 x86_64 ### How are you running Gitea? On Docker 24.0.7 with Postgres 13 ### Database PostgreSQL 13
GiteaMirror added the type/bug label 2025-11-02 09:59:55 -06:00
Author
Owner

@lng2020 commented on GitHub (Dec 4, 2023):

Is there a PR with an empty diff?. Never Mind.

@lng2020 commented on GitHub (Dec 4, 2023): ~~Is there a PR with an empty diff?~~. Never Mind.
Author
Owner

@joseluisq commented on GitHub (Dec 12, 2023):

I updated to v1.21.2 and my project is now successfully migrated.
Thanks!

@joseluisq commented on GitHub (Dec 12, 2023): I updated to `v1.21.2` and my project is now successfully migrated. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12142