slice bounds out of range in function: /modules/git.newSignatureFromCommitline #12346

Closed
opened 2025-11-02 10:06:27 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @h7su on GitHub (Jan 18, 2024).

Description

create a mirror from linux kernel repo, it clone the repo to disk successful but prompt "panic: runtime error: slice bounds out of range [:-1]" on the web. then i use cmd: gitea.exe admin repo-sync-releases, it show below log:

2024/01/18 15:02:39 .../setting/security.go:168:loadSecurityFrom() [W] Enabling Query API Auth tokens is not recommended. DISABLE_QUERY_AUTH_TOKEN will default to true in gitea 1.23 and will be removed in gitea 1.24.
panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
code.gitea.io/gitea/modules/git.newSignatureFromCommitline({0xc001ebacb8, 0x0, 0x20})
/source/modules/git/signature_gogit.go:37 +0x3fa
code.gitea.io/gitea/modules/git.parseTagRef(0xc001ebafd8?)
/source/modules/git/repo_tag.go:184 +0x22f
code.gitea.io/gitea/modules/git.(*Repository).GetTagInfos(0xc001cba1e0, 0x0, 0x3a071c5?)
/source/modules/git/repo_tag.go:142 +0x7fc
code.gitea.io/gitea/modules/repository.pullMirrorReleaseSync({0x4b4c9f0, 0xc000d4bcc0}, 0xc0020c6800, 0x27?)
/source/modules/repository/repo.go:502 +0x114
code.gitea.io/gitea/modules/repository.SyncReleasesWithTags({0x4b4c9f0?, 0xc000d4bcc0}, 0xc0020c6800, 0xc001cba1e0)
/source/modules/repository/repo.go:294 +0x18a
code.gitea.io/gitea/cmd.runRepoSyncReleases(0xc00045d720?)
/source/cmd/admin.go:392 +0x5ca
code.gitea.io/gitea/cmd.prepareSubcommandWithConfig.prepareWorkPathAndCustomConf.func1(0x2f16c00?)
/source/cmd/main.go:117 +0x1ec
github.com/urfave/cli/v2.(*Command).Run(0x2f16c00, 0xc000ebd380, {0xc0001260e0, 0x1, 0x1})
/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:274 +0x998
github.com/urfave/cli/v2.(*Command).Run(0x2f18d00, 0xc000ebd080, {0xc0001eb200, 0x2, 0x2})
/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:267 +0xbe5
github.com/urfave/cli/v2.(*Command).Run(0xc001bf78c0, 0xc000ebcdc0, {0xc000194140, 0x3, 0x4})
/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:267 +0xbe5
github.com/urfave/cli/v2.(*App).RunContext(0xc0009683c0, {0x4b4c780?, 0x6960640}, {0xc000194140, 0x3, 0x4})
/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/app.go:332 +0x5b7
github.com/urfave/cli/v2.(*App).Run(...)
/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/app.go:309
code.gitea.io/gitea/cmd.RunMainApp(0xc0009683c0, {0xc000194140?, 0xc0020530e0?, 0x4a?})
/source/cmd/main.go:176 +0x39
main.main()
/source/main.go:46 +0x79

Gitea Version

1.21.4

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

v1.21.4 is downloaded from github release,and used in win11x64

Database

SQLite

Originally created by @h7su on GitHub (Jan 18, 2024). ### Description create a mirror from linux kernel repo, it clone the repo to disk successful but prompt "panic: runtime error: slice bounds out of range [:-1]" on the web. then i use cmd: gitea.exe admin repo-sync-releases, it show below log: 2024/01/18 15:02:39 .../setting/security.go:168:loadSecurityFrom() [W] Enabling Query API Auth tokens is not recommended. DISABLE_QUERY_AUTH_TOKEN will default to true in gitea 1.23 and will be removed in gitea 1.24. panic: runtime error: slice bounds out of range [:-1] goroutine 1 [running]: code.gitea.io/gitea/modules/git.newSignatureFromCommitline({0xc001ebacb8, 0x0, 0x20}) /source/modules/git/signature_gogit.go:37 +0x3fa code.gitea.io/gitea/modules/git.parseTagRef(0xc001ebafd8?) /source/modules/git/repo_tag.go:184 +0x22f code.gitea.io/gitea/modules/git.(*Repository).GetTagInfos(0xc001cba1e0, 0x0, 0x3a071c5?) /source/modules/git/repo_tag.go:142 +0x7fc code.gitea.io/gitea/modules/repository.pullMirrorReleaseSync({0x4b4c9f0, 0xc000d4bcc0}, 0xc0020c6800, 0x27?) /source/modules/repository/repo.go:502 +0x114 code.gitea.io/gitea/modules/repository.SyncReleasesWithTags({0x4b4c9f0?, 0xc000d4bcc0}, 0xc0020c6800, 0xc001cba1e0) /source/modules/repository/repo.go:294 +0x18a code.gitea.io/gitea/cmd.runRepoSyncReleases(0xc00045d720?) /source/cmd/admin.go:392 +0x5ca code.gitea.io/gitea/cmd.prepareSubcommandWithConfig.prepareWorkPathAndCustomConf.func1(0x2f16c00?) /source/cmd/main.go:117 +0x1ec github.com/urfave/cli/v2.(*Command).Run(0x2f16c00, 0xc000ebd380, {0xc0001260e0, 0x1, 0x1}) /go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:274 +0x998 github.com/urfave/cli/v2.(*Command).Run(0x2f18d00, 0xc000ebd080, {0xc0001eb200, 0x2, 0x2}) /go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:267 +0xbe5 github.com/urfave/cli/v2.(*Command).Run(0xc001bf78c0, 0xc000ebcdc0, {0xc000194140, 0x3, 0x4}) /go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:267 +0xbe5 github.com/urfave/cli/v2.(*App).RunContext(0xc0009683c0, {0x4b4c780?, 0x6960640}, {0xc000194140, 0x3, 0x4}) /go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/app.go:332 +0x5b7 github.com/urfave/cli/v2.(*App).Run(...) /go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/app.go:309 code.gitea.io/gitea/cmd.RunMainApp(0xc0009683c0, {0xc000194140?, 0xc0020530e0?, 0x4a?}) /source/cmd/main.go:176 +0x39 main.main() /source/main.go:46 +0x79 ### Gitea Version 1.21.4 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? v1.21.4 is downloaded from github release,and used in win11x64 ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 10:06:27 -06:00
Author
Owner

@yp05327 commented on GitHub (Jan 18, 2024):

Want to confirm:

  1. It seems that you are using gogit version.
  2. When creating the mirror, did you select migrate the releases?
@yp05327 commented on GitHub (Jan 18, 2024): Want to confirm: 1. It seems that you are using gogit version. 2. When creating the mirror, did you select migrate the releases?
Author
Owner

@h7su commented on GitHub (Jan 18, 2024):

  1. Yes,I didn't know there is another gitea before your answer, now I try the no gogit version, it works good, no error.
  2. When i use the 'import outside repo' function from top-right, I just check 'use it as a mirror' , not seen 'migrate the releases'.
  3. So, should this issue be treat as a bug?
@h7su commented on GitHub (Jan 18, 2024): 1. Yes,I didn't know there is another gitea before your answer, now I try the no gogit version, it _works good, no error_. 2. When i use the 'import outside repo' function from top-right, I just check 'use it as a mirror' , not seen 'migrate the releases'. 3. So, _should this issue be treat as a bug_?
Author
Owner

@yp05327 commented on GitHub (Jan 18, 2024):

now I try the no gogit version, it works good, no error.

So only gogit version has this issue. Thanks for your test.

When i use the 'import outside repo' function from top-right, I just check 'use it as a mirror' , not seen 'migrate the releases'.

OK

So, should this issue be treat as a bug?

Not sure. Maybe caused by some special tags in this repo, like https://github.com/go-gitea/gitea/issues/28843#issuecomment-1898213975

@yp05327 commented on GitHub (Jan 18, 2024): > now I try the no gogit version, it works good, no error. So only gogit version has this issue. Thanks for your test. > When i use the 'import outside repo' function from top-right, I just check 'use it as a mirror' , not seen 'migrate the releases'. OK > So, should this issue be treat as a bug? Not sure. Maybe caused by some special tags in this repo, like https://github.com/go-gitea/gitea/issues/28843#issuecomment-1898213975
Author
Owner

@yp05327 commented on GitHub (Jan 19, 2024):

OK, I got it.
image

@yp05327 commented on GitHub (Jan 19, 2024): OK, I got it. ![image](https://github.com/go-gitea/gitea/assets/18380374/79e6eba7-5df0-422d-add7-83d8f5d089a0)
Author
Owner

@yp05327 commented on GitHub (Jan 19, 2024):

The reason is that the creator is empty in tag v2.6.13-rc3
image

@yp05327 commented on GitHub (Jan 19, 2024): The reason is that the creator is empty in tag `v2.6.13-rc3` ![image](https://github.com/go-gitea/gitea/assets/18380374/0cef49ef-d981-46ef-a25c-d3076a43062a)
Author
Owner

@lunny commented on GitHub (Feb 4, 2024):

The reason is that the creator is empty in tag v2.6.13-rc3 image

So we have to use a ghost here if creator is empty.

@lunny commented on GitHub (Feb 4, 2024): > The reason is that the creator is empty in tag `v2.6.13-rc3` ![image](https://private-user-images.githubusercontent.com/18380374/297918054-0cef49ef-d981-46ef-a25c-d3076a43062a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDcwNTM0MzksIm5iZiI6MTcwNzA1MzEzOSwicGF0aCI6Ii8xODM4MDM3NC8yOTc5MTgwNTQtMGNlZjQ5ZWYtZDk4MS00NmVmLWEyNWMtZDMwNzZhNDMwNjJhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjA0VDEzMjUzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZiYjRkMzczODIwMzcwMTVjMzI1ZDFkYzYyNGY4ZjEzYWY3N2NjODA0Y2ZlOGE0YzBhNmU1MjJlYjc4YmE2YTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bfIxotXuunLdA-fbtrR2fLPFYkdeOjU5Jdd8Sb5Viic) So we have to use a ghost here if creator is empty.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 28, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Feb 28, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12346