1.1.0 index error panic: runtime error: slice bounds out of range #463

Closed
opened 2025-11-02 03:24:18 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @avelino on GitHub (Mar 10, 2017).

  • Gitea version (or commit ref): 1.1.0
  • Git version:
  • Operating system: Linux (docker image 1.1)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

web_1       | 2017/03/10 02:34:43 [T] Custom path: /data/gitea
web_1       | 2017/03/10 02:34:43 [T] Log path: /app/gitea/log
web_1       | error: patch failed: src/filmow/bluke/signals.py:1
web_1       | error: src/filmow/bluke/signals.py: patch does not apply
web_1       | error: patch failed: src/filmow/commenting/signals.py:45
web_1       | error: src/filmow/commenting/signals.py: patch does not apply
web_1       | error: patch failed: src/filmow/commenting/templatetags/commenting.py:1
web_1       | error: src/filmow/commenting/templatetags/commenting.py: patch does not apply
web_1       | error: patch failed: src/filmow/commenting/views.py:16
web_1       | error: src/filmow/commenting/views.py: patch does not apply
web_1       | error: patch failed: src/templates/commenting/_comment.html:6
web_1       | error: src/templates/commenting/_comment.html: patch does not apply
web_1       | error: patch failed: src/templates/commenting/_comment_base.html:1
web_1       | error: src/templates/commenting/_comment_base.html: patch does not apply
web_1       | error: patch failed: src/templates/commenting/comments.html:1
web_1       | error: src/templates/commenting/comments.html: patch does not apply
web_1       | error: patch failed: src/templates/commenting/comments_page_movie.html:13
web_1       | error: src/templates/commenting/comments_page_movie.html: patch does not apply
web_1       |
web_1       | error: patch failed: compose-backend.yml:17
web_1       | error: compose-backend.yml: patch does not apply
web_1       | error: patch failed: compose-thumbor.yml:1
web_1       | error: compose-thumbor.yml: patch does not apply
web_1       | error: src/filmow/settings/defaults/base.py: does not exist in index
web_1       | error: src/filmow/settings/defaults/elasticsearch.py: does not exist in index
web_1       | error: patch failed: src/filmow/settings/production.py:61
web_1       | error: src/filmow/settings/production.py: patch does not apply
web_1       |
web_1       | error: patch failed: src/filmow/artists/models.py:79
web_1       | error: src/filmow/artists/models.py: patch does not apply
web_1       |
web_1       | panic: runtime error: slice bounds out of range
web_1       |
web_1       | goroutine 53 [running]:

In 1.0 of the error and UP the gitea and 1.1 won't go up

Screenshots

If this issue involves the Web Interface, please include a screenshot

Originally created by @avelino on GitHub (Mar 10, 2017). - Gitea version (or commit ref): 1.1.0 - Git version: - Operating system: Linux (docker image 1.1) - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description ``` web_1 | 2017/03/10 02:34:43 [T] Custom path: /data/gitea web_1 | 2017/03/10 02:34:43 [T] Log path: /app/gitea/log web_1 | error: patch failed: src/filmow/bluke/signals.py:1 web_1 | error: src/filmow/bluke/signals.py: patch does not apply web_1 | error: patch failed: src/filmow/commenting/signals.py:45 web_1 | error: src/filmow/commenting/signals.py: patch does not apply web_1 | error: patch failed: src/filmow/commenting/templatetags/commenting.py:1 web_1 | error: src/filmow/commenting/templatetags/commenting.py: patch does not apply web_1 | error: patch failed: src/filmow/commenting/views.py:16 web_1 | error: src/filmow/commenting/views.py: patch does not apply web_1 | error: patch failed: src/templates/commenting/_comment.html:6 web_1 | error: src/templates/commenting/_comment.html: patch does not apply web_1 | error: patch failed: src/templates/commenting/_comment_base.html:1 web_1 | error: src/templates/commenting/_comment_base.html: patch does not apply web_1 | error: patch failed: src/templates/commenting/comments.html:1 web_1 | error: src/templates/commenting/comments.html: patch does not apply web_1 | error: patch failed: src/templates/commenting/comments_page_movie.html:13 web_1 | error: src/templates/commenting/comments_page_movie.html: patch does not apply web_1 | web_1 | error: patch failed: compose-backend.yml:17 web_1 | error: compose-backend.yml: patch does not apply web_1 | error: patch failed: compose-thumbor.yml:1 web_1 | error: compose-thumbor.yml: patch does not apply web_1 | error: src/filmow/settings/defaults/base.py: does not exist in index web_1 | error: src/filmow/settings/defaults/elasticsearch.py: does not exist in index web_1 | error: patch failed: src/filmow/settings/production.py:61 web_1 | error: src/filmow/settings/production.py: patch does not apply web_1 | web_1 | error: patch failed: src/filmow/artists/models.py:79 web_1 | error: src/filmow/artists/models.py: patch does not apply web_1 | web_1 | panic: runtime error: slice bounds out of range web_1 | web_1 | goroutine 53 [running]: ``` In 1.0 of the error and UP the gitea and 1.1 won't go up ## Screenshots **If this issue involves the Web Interface, please include a screenshot**
GiteaMirror added the type/bug label 2025-11-02 03:24:18 -06:00
Author
Owner

@lunny commented on GitHub (Mar 10, 2017):

Maybe because we import github.com/facebookgo/grace/gracehttp?

@lunny commented on GitHub (Mar 10, 2017): Maybe because we import `github.com/facebookgo/grace/gracehttp`?
Author
Owner

@lunny commented on GitHub (Mar 10, 2017):

cannot find anything from the log.

@lunny commented on GitHub (Mar 10, 2017): cannot find anything from the log.
Author
Owner

@avelino commented on GitHub (Mar 10, 2017):

There's nothing else in the log, he is in infinite loop

@avelino commented on GitHub (Mar 10, 2017): There's nothing else in the log, he is in infinite loop
Author
Owner

@kaz commented on GitHub (Mar 15, 2017):

I got similar error such as below:

[Macaron] 2017-03-15 20:16:09: Started POST /ninja/RPG/pulls/16/merge for 106.161.178.184
[Macaron] 2017-03-15 20:16:10: Completed /ninja/RPG/pulls/16/merge 302 Found in 1.730748095s
error: patch failed: .gitignore:7
error: .gitignore: patch does not apply
error: Disastoria/Assets/Battle.meta: already exists in index
error: Disastoria/Assets/Battle/Prefabs.meta: already exists in index
error: Disastoria/Assets/Battle/Prefabs/Enemy.prefab: already exists in index
error: Disastoria/Assets/Battle/Prefabs/Enemy.prefab.meta: already exists in index
error: Disastoria/Assets/Battle/Scripts.meta: already exists in index
error: Disastoria/Assets/Battle/Scripts/BattleManager.cs: already exists in index
error: Disastoria/Assets/Battle/Scripts/BattleManager.cs.meta: already exists in index
error: Disastoria/Assets/Battle/Scripts/Enemy.cs: already exists in index
error: Disastoria/Assets/Battle/Scripts/Enemy.cs.meta: already exists in index
error: Disastoria/Assets/Battle/Scripts/Fighter.cs: already exists in index
error: Disastoria/Assets/Battle/Scripts/Fighter.cs.meta: already exists in index
error: Disastoria/Assets/Battle/Scripts/FightingHeroine.cs: already exists in index
error: Disastoria/Assets/Battle/Scripts/FightingHeroine.cs.meta: already exists in index
error: Disastoria/Assets/Battle/Scripts/FightingPlayer.cs: already exists in index
error: Disastoria/Assets/Battle/Scripts/FightingPlayer.cs.meta: already exists in index
error: Disastoria/Assets/Battle/Scripts/SkillBase.cs: already exists in index
error: Disastoria/Assets/Battle/Scripts/SkillBase.cs.meta: already exists in index
error: Disastoria/Assets/Battle/Scripts/Skills.cs: already exists in index
error: Disastoria/Assets/Battle/Scripts/Skills.cs.meta: already exists in index
error: patch failed: Disastoria/ProjectSettings/EditorBuildSettings.asset:7
error: Disastoria/ProjectSettings/EditorBuildSettings.asset: patch does not apply
error: patch failed: Disastoria/ProjectSettings/ProjectSettings.asset:415
error: Disastoria/ProjectSettings/ProjectSettings.asset: patch does not apply
error: patch failed: Disastoria/ProjectSettings/TagManager.asset:3
error: Disastoria/ProjectSettings/TagManager.asset: patch does not apply
panic: runtime error: slice bounds out of range

After that, launching gitea results in errors:
(won't up)

panic: runtime error: slice bounds out of range
goroutine 136 [running]:
code.gitea.io/gitea/models.(*PullRequest).getMergeCommit(0xc4201682a0, 0x0, 0x0, 0x0)
        /root/go/src/code.gitea.io/gitea/models/pull.go:504 +0xfea
code.gitea.io/gitea/models.(*PullRequest).manuallyMerged(0xc4201682a0, 0x0)
        /root/go/src/code.gitea.io/gitea/models/pull.go:439 +0x43
code.gitea.io/gitea/models.TestPullRequests.func1(0x0, 0x116db40, 0xc4201682a0, 0x0, 0x0)
        /root/go/src/code.gitea.io/gitea/models/pull.go:1067 +0xf9
code.gitea.io/gitea/vendor/github.com/go-xorm/xorm.(*Session).Iterate(0xc420240780, 0x1178220, 0xc4201681c0, 0xc4200ebe00, 0x0, 0x0)
        /root/go/src/code.gitea.io/gitea/vendor/github.com/go-xorm/xorm/session_iterate.go:35 +0x182
code.gitea.io/gitea/vendor/github.com/go-xorm/xorm.(*Engine).Iterate(0xc42025b180, 0x1178220, 0xc4201681c0, 0xc4201bde00, 0x0, 0x0)
        /root/go/src/code.gitea.io/gitea/vendor/github.com/go-xorm/xorm/engine.go:1484 +0x98
code.gitea.io/gitea/models.TestPullRequests()
        /root/go/src/code.gitea.io/gitea/models/pull.go:1076 +0x12c
created by code.gitea.io/gitea/models.InitTestPullRequests
        /root/go/src/code.gitea.io/gitea/models/pull.go:1105 +0x35

I removed this row on table pull_request, then gitea was up.
default
Changing status from 1 to 0 is also OK.

Gitea 1.1.0 with MySQL

@kaz commented on GitHub (Mar 15, 2017): I got similar error such as below: ``` [Macaron] 2017-03-15 20:16:09: Started POST /ninja/RPG/pulls/16/merge for 106.161.178.184 [Macaron] 2017-03-15 20:16:10: Completed /ninja/RPG/pulls/16/merge 302 Found in 1.730748095s error: patch failed: .gitignore:7 error: .gitignore: patch does not apply error: Disastoria/Assets/Battle.meta: already exists in index error: Disastoria/Assets/Battle/Prefabs.meta: already exists in index error: Disastoria/Assets/Battle/Prefabs/Enemy.prefab: already exists in index error: Disastoria/Assets/Battle/Prefabs/Enemy.prefab.meta: already exists in index error: Disastoria/Assets/Battle/Scripts.meta: already exists in index error: Disastoria/Assets/Battle/Scripts/BattleManager.cs: already exists in index error: Disastoria/Assets/Battle/Scripts/BattleManager.cs.meta: already exists in index error: Disastoria/Assets/Battle/Scripts/Enemy.cs: already exists in index error: Disastoria/Assets/Battle/Scripts/Enemy.cs.meta: already exists in index error: Disastoria/Assets/Battle/Scripts/Fighter.cs: already exists in index error: Disastoria/Assets/Battle/Scripts/Fighter.cs.meta: already exists in index error: Disastoria/Assets/Battle/Scripts/FightingHeroine.cs: already exists in index error: Disastoria/Assets/Battle/Scripts/FightingHeroine.cs.meta: already exists in index error: Disastoria/Assets/Battle/Scripts/FightingPlayer.cs: already exists in index error: Disastoria/Assets/Battle/Scripts/FightingPlayer.cs.meta: already exists in index error: Disastoria/Assets/Battle/Scripts/SkillBase.cs: already exists in index error: Disastoria/Assets/Battle/Scripts/SkillBase.cs.meta: already exists in index error: Disastoria/Assets/Battle/Scripts/Skills.cs: already exists in index error: Disastoria/Assets/Battle/Scripts/Skills.cs.meta: already exists in index error: patch failed: Disastoria/ProjectSettings/EditorBuildSettings.asset:7 error: Disastoria/ProjectSettings/EditorBuildSettings.asset: patch does not apply error: patch failed: Disastoria/ProjectSettings/ProjectSettings.asset:415 error: Disastoria/ProjectSettings/ProjectSettings.asset: patch does not apply error: patch failed: Disastoria/ProjectSettings/TagManager.asset:3 error: Disastoria/ProjectSettings/TagManager.asset: patch does not apply panic: runtime error: slice bounds out of range ``` After that, launching gitea results in errors: (won't up) ``` panic: runtime error: slice bounds out of range goroutine 136 [running]: code.gitea.io/gitea/models.(*PullRequest).getMergeCommit(0xc4201682a0, 0x0, 0x0, 0x0) /root/go/src/code.gitea.io/gitea/models/pull.go:504 +0xfea code.gitea.io/gitea/models.(*PullRequest).manuallyMerged(0xc4201682a0, 0x0) /root/go/src/code.gitea.io/gitea/models/pull.go:439 +0x43 code.gitea.io/gitea/models.TestPullRequests.func1(0x0, 0x116db40, 0xc4201682a0, 0x0, 0x0) /root/go/src/code.gitea.io/gitea/models/pull.go:1067 +0xf9 code.gitea.io/gitea/vendor/github.com/go-xorm/xorm.(*Session).Iterate(0xc420240780, 0x1178220, 0xc4201681c0, 0xc4200ebe00, 0x0, 0x0) /root/go/src/code.gitea.io/gitea/vendor/github.com/go-xorm/xorm/session_iterate.go:35 +0x182 code.gitea.io/gitea/vendor/github.com/go-xorm/xorm.(*Engine).Iterate(0xc42025b180, 0x1178220, 0xc4201681c0, 0xc4201bde00, 0x0, 0x0) /root/go/src/code.gitea.io/gitea/vendor/github.com/go-xorm/xorm/engine.go:1484 +0x98 code.gitea.io/gitea/models.TestPullRequests() /root/go/src/code.gitea.io/gitea/models/pull.go:1076 +0x12c created by code.gitea.io/gitea/models.InitTestPullRequests /root/go/src/code.gitea.io/gitea/models/pull.go:1105 +0x35 ``` I removed this row on table `pull_request`, then gitea was up. <img width="1061" alt="default" src="https://cloud.githubusercontent.com/assets/12085646/23951213/e072f800-09d0-11e7-9a03-47a85fa8bc3f.PNG"> Changing `status` from 1 to 0 is also OK. Gitea 1.1.0 with MySQL
Author
Owner

@avelino commented on GitHub (Mar 31, 2017):

Any news about this error?

@avelino commented on GitHub (Mar 31, 2017): Any news about this error?
Author
Owner

@lunny commented on GitHub (Mar 31, 2017):

It seems nobody are working on this issue. Maybe @geek1011 could see this one.

@lunny commented on GitHub (Mar 31, 2017): It seems nobody are working on this issue. Maybe @geek1011 could see this one.
Author
Owner

@georgevanburgh commented on GitHub (May 11, 2017):

Just had the same issue on 1.1.1 with MSSQL backend. Removing a 'corrupt' pull request as @kaz suggested fixed the issue. Not sure if it's relevant, but the pull request was for a branch starting with origin/... (user error), for which an open pull request already existed.

@georgevanburgh commented on GitHub (May 11, 2017): Just had the same issue on 1.1.1 with MSSQL backend. Removing a 'corrupt' pull request as @kaz suggested fixed the issue. Not sure if it's relevant, but the pull request was for a branch starting with `origin/...` (user error), for which an open pull request already existed.
Author
Owner

@ethantkoenig commented on GitHub (May 31, 2017):

@avelino @kaz @FireEater64 Could one of you try to reproduce the problem using the changes from #1843? I've added some extra checks which should help in diagnosing the problem.

@ethantkoenig commented on GitHub (May 31, 2017): @avelino @kaz @FireEater64 Could one of you try to reproduce the problem using the changes from #1843? I've added some extra checks which should help in diagnosing the problem.
Author
Owner

@Avalancs commented on GitHub (Jun 15, 2017):

Just had the same issue today, and changing the status to 0 resolved it. Here is how we produced the error:

  1. Let's assume you have origin/master branch on commit n
  2. Create a branch and make a commit (I'll call it n+1)
  3. Create a pull request from the new branch to master
  4. (imagine another person doing this) checkout master, fast-forward it to the tip of new branch (commit n+1)
  5. make a new commit (n+2) and push it to origin
    So this puts commit n+1 into the master branch without using the pull request, leaving it active. The Gitea service crashed as soon as the push was done, and would display said error and not start until I closed the pull request in the database,
@Avalancs commented on GitHub (Jun 15, 2017): Just had the same issue today, and changing the status to 0 resolved it. Here is how we produced the error: 0. Let's assume you have origin/master branch on commit n 2. Create a branch and make a commit (I'll call it n+1) 3. Create a pull request from the new branch to master 4. (imagine another person doing this) checkout master, fast-forward it to the tip of new branch (commit n+1) 5. make a new commit (n+2) and push it to origin So this puts commit n+1 into the master branch without using the pull request, leaving it active. The Gitea service crashed as soon as the push was done, and would display said error and not start until I closed the pull request in the database,
Author
Owner

@ethantkoenig commented on GitHub (Jun 15, 2017):

@Avalancs Thank you for your detailed report on how to reproduce the bug! Looking into it now

@ethantkoenig commented on GitHub (Jun 15, 2017): @Avalancs Thank you for your detailed report on how to reproduce the bug! Looking into it now
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#463