gogs / gogs

Gogs is a painless self-hosted Git service
https://gogs.io
MIT License
44.83k stars 4.85k forks source link

Panic when drone.io doing refresh repository list #6524

Open kpmy opened 3 years ago

kpmy commented 3 years ago

Describe the bug Drone.io CI engine requests repository list from Gogs instance after pressing Refresh-button. It ends with nothing, in docker logs gogs we see a stacktrace.

Gogs version and commit version 0.13.0+dev version Git 2.24.3 version Go go1.14.7 build time 2021-02-27 10:51:39 UTC commit hash 509a392272a2ba2bde9d64bf5a55a58d0eadccc4

Operating system docker image gogs/gogs:latest (7c5d4742d5c0)

Database MariaDB

Can you reproduce the bug at https://try.gogs.io? No. Because it happens in our own environment.

Expected behavior Repository list refresh

Actual behavior Panic at process logs.

Additional context

{"error":"Internal Server Error","level":"warning","login":"pk","msg":"syncer: cannot get remote repository list","time":"2021-03-18T15:35:56Z"}
2021/03/18 15:35:34 [TRACE] Log mode: File (Trace)
[Macaron] PANIC: runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:212 (0x453f89)
runtime/signal_unix.go:695 (0x453dd8)
gogs.io/gogs/internal/db/repo.go:707 (0xf41a7a)
gogs.io/gogs/internal/db/repo.go:725 (0xf3e8c4)
gogs.io/gogs/internal/db/repo.go:357 (0xf3e8af)
gogs.io/gogs/internal/db/repo.go:390 (0xf3edcc)
gogs.io/gogs/internal/db/repo.go:390 (0xf3edcc)
gogs.io/gogs/internal/route/api/v1/repo/repo.go:128 (0x12b7594)
gogs.io/gogs/internal/route/api/v1/repo/repo.go:145 (0x12b7985)
reflect/value.go:460 (0x4d58ca)
reflect/value.go:321 (0x4d4dd3)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:177 (0x8121eb)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:137 (0x811bc9)
gopkg.in/macaron.v1@v1.4.0/context.go:125 (0x8451f8)
gopkg.in/macaron.v1@v1.4.0/context.go:115 (0x8ba715)
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:192 (0x8ba700)
gopkg.in/macaron.v1@v1.4.0/context.go:81 (0x8450a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x811f17)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x811cb8)
gopkg.in/macaron.v1@v1.4.0/context.go:125 (0x8451f8)
gopkg.in/macaron.v1@v1.4.0/context.go:115 (0x858145)
gopkg.in/macaron.v1@v1.4.0/recovery.go:161 (0x858138)
gopkg.in/macaron.v1@v1.4.0/logger.go:40 (0x848fc3)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x811f17)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x811cb8)
gopkg.in/macaron.v1@v1.4.0/context.go:125 (0x8451f8)
gopkg.in/macaron.v1@v1.4.0/router.go:187 (0x859356)
gopkg.in/macaron.v1@v1.4.0/router.go:294 (0x8517dd)
gopkg.in/macaron.v1@v1.4.0/macaron.go:220 (0x84a31a)
net/http/server.go:2836 (0x7aedc2)
net/http/server.go:1924 (0x7aa82b)
runtime/asm_amd64.s:1373 (0x46fb30)
kpmy commented 10 months ago

well, it's because of fork repositories.