Skip to content

The latest version gitea. terminate abnormal #16290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
coolincy opened this issue Jun 29, 2021 · 4 comments · Fixed by #16298
Closed

The latest version gitea. terminate abnormal #16290

coolincy opened this issue Jun 29, 2021 · 4 comments · Fixed by #16298
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@coolincy
Copy link

The latest version gitea. terminate abnormal

`2021/06/29 11:26:51 .../queue/workerpool.go:93:zeroBoost() [W] WorkerPool: 14 (for repo_stats_update-channel) has zero workers - adding 1 temporary workers for 5m0s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xa11e63]

goroutine 17332 [running]:
code.gitea.io/gitea/modules/git.(*TreeEntry).IsDir(...)
/go/src/code.gitea.io/gitea/modules/git/tree_entry_nogogit.go:66
code.gitea.io/gitea/modules/git.(*LastCommitCache).recursiveCache(0xc004c1d650, 0x3d94d68, 0xc0020bcfc0, 0xc003c15e00, 0xc003c15e10, 0x0, 0x0, 0x1, 0x1a, 0x25e8780)
/go/src/code.gitea.io/gitea/modules/git/last_commit_cache_nogogit.go:97 +0x4e3
code.gitea.io/gitea/modules/git.(*LastCommitCache).CacheCommit(...)
/go/src/code.gitea.io/gitea/modules/git/last_commit_cache_nogogit.go:68
code.gitea.io/gitea/modules/repository.CacheRef(0x3d94d68, 0xc0020bcfc0, 0xc005d7c000, 0xc004079aa0, 0xc003e1bcb0, 0x11, 0x76, 0xc00409f180)
/go/src/code.gitea.io/gitea/modules/repository/cache.go:47 +0x325
code.gitea.io/gitea/services/repository.pushUpdates(0xc00630cc30, 0x1, 0x1, 0x0, 0x0)
/go/src/code.gitea.io/gitea/services/repository/push.go:212 +0x1a18
code.gitea.io/gitea/services/repository.handle(0xc0011312c0, 0x1, 0x14)
/go/src/code.gitea.io/gitea/services/repository/push.go:32 +0x91
code.gitea.io/gitea/modules/queue.(*WorkerPool).doWork(0xc003cd0980, 0x3d94dd8, 0xc00558e240)
/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:408 +0x9a9
code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers.func1(0xc003cd0980, 0x3d94dd8, 0xc00558e240, 0xc005e17b00)
/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:261 +0x45
created by code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers
/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:260 +0x65
Received signal 15; terminating.`

@techknowlogick
Copy link
Member

please fill out the full details of the issue template.

@techknowlogick techknowlogick added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jun 29, 2021
@coolincy
Copy link
Author

coolincy commented Jun 29, 2021

Run with docker:

docker run -d --restart=unless-stopped \
--name gitea -h git.xxxx.xxx \
-u 0:0 \
-m 16G \
-e APP_NAME="Xxxxx Git Service" \
-e DOMAIN="git.xxxx.xxx" \
-e SSH_DOMAIN="git.xxxx.xxx" \
-e SSH_PORT=22 \
-e SSH_LISTEN_PORT=22 \
-e DISABLE_SSH=true \
-e HTTP_PORT=3000 \
-e ROOT_URL="https://git.xxxx.xxx" \
-e DB_TYPE=postgres \
-e DB_HOST="192.168.0.80" \
-e DB_NAME=gitea \
-e DB_USER=gitea \
-e DB_PASSWD=gitea \
-e INSTALL_LOCK=true \
-e SECRET_KEY="xxxxxxxx" \
-e DISABLE_REGISTRATION=false \
-e REQUIRE_SIGNIN_VIEW=true \
-p 3000:3000 \
-v /data/gitea:/data \
-v /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
gitea/gitea
  • Gitea version (or commit ref): 1.15.0+dev-509-g2f3d3ac20 built with GNU Make 4.3, go1.16.5 : bindata, timetzdata, sqlite, sqlite_unlock_notify
  • Git version: 2.30.2
  • Operating system: docker
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
2021/06/29 15:03:10 .../queue/workerpool.go:93:zeroBoost() [W] WorkerPool: 14 (for repo_stats_update-channel) has zero workers - adding 1 temporary workers for 5m0s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xa11e63]

goroutine 6576 [running]:
code.gitea.io/gitea/modules/git.(*TreeEntry).IsDir(...)
        /go/src/code.gitea.io/gitea/modules/git/tree_entry_nogogit.go:66
code.gitea.io/gitea/modules/git.(*LastCommitCache).recursiveCache(0xc004917650, 0x3d94d68, 0xc0004f01c0, 0xc0038c23c0, 0xc0038c23d0, 0x0, 0x0, 0x1, 0x26, 0x25e8780)
        /go/src/code.gitea.io/gitea/modules/git/last_commit_cache_nogogit.go:97 +0x4e3
code.gitea.io/gitea/modules/git.(*LastCommitCache).CacheCommit(...)
        /go/src/code.gitea.io/gitea/modules/git/last_commit_cache_nogogit.go:68
code.gitea.io/gitea/modules/repository.CacheRef(0x3d94d68, 0xc0004f01c0, 0xc00649a400, 0xc0056239e0, 0xc0041c2c00, 0xd, 0x82, 0xc002cbef60)
        /go/src/code.gitea.io/gitea/modules/repository/cache.go:47 +0x325
code.gitea.io/gitea/services/repository.pushUpdates(0xc004f470c8, 0x1, 0x1, 0x0, 0x0)
        /go/src/code.gitea.io/gitea/services/repository/push.go:212 +0x1a18
code.gitea.io/gitea/services/repository.handle(0xc00038fb80, 0x1, 0x14)
        /go/src/code.gitea.io/gitea/services/repository/push.go:32 +0x91
code.gitea.io/gitea/modules/queue.(*WorkerPool).doWork(0xc00372cd00, 0x3d94dd8, 0xc005623680)
        /go/src/code.gitea.io/gitea/modules/queue/workerpool.go:408 +0x9a9
code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers.func1(0xc00372cd00, 0x3d94dd8, 0xc005623680, 0xc007a6d860)
        /go/src/code.gitea.io/gitea/modules/queue/workerpool.go:261 +0x45
created by code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers
        /go/src/code.gitea.io/gitea/modules/queue/workerpool.go:260 +0x65
Received signal 15; terminating.

Description

...

Screenshots

@coolincy
Copy link
Author

random occurrence, then the docker container restarted.

@zeripath
Copy link
Contributor

This suggests that a nil TreeEntry snuck into the map here:

if entryMap[entry].IsDir() {

Which suggests that a path was missed in:

commits, err := GetLastCommitForPaths(ctx, commit, treePath, entryPaths)

Are you able to work out which repository was being cached at the time? It will have been a repository that was just recently pushed to?

Would you be able to check your repository on the web ui and if there is an error rendering it give me the logs - or better push it up to try.gitea.io for me to try to figure out what's happened.

zeripath added a commit to zeripath/gitea that referenced this issue Jun 29, 2021
There is a bug with last commit cache recursive cache where the last
commit information that refers to the current tree itself will cause a
panic due to its path ("") not being included in the expected tree entry
paths.

This PR fixes this by skipping the missing entry.

Fix go-gitea#16290

Signed-off-by: Andrew Thornton <[email protected]>
techknowlogick added a commit that referenced this issue Jun 29, 2021
There is a bug with last commit cache recursive cache where the last
commit information that refers to the current tree itself will cause a
panic due to its path ("") not being included in the expected tree entry
paths.

This PR fixes this by skipping the missing entry.

Fix #16290

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
There is a bug with last commit cache recursive cache where the last
commit information that refers to the current tree itself will cause a
panic due to its path ("") not being included in the expected tree entry
paths.

This PR fixes this by skipping the missing entry.

Fix go-gitea#16290

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants