Gitea: Error in Tree Listing

Created on 26 Jun 2017  路  9Comments  路  Source: go-gitea/gitea

Description

After switching 5 level on webinterface it responds with a 500 exception. I can share a account private on discord to access the gitea server.

kinbug

Most helpful comment

Just tested and issue is resolved in master branch :+1:

All 9 comments

I pushed it as private repository on https://try.gitea.io/shyimtest/gs/src/master/src/GSS/Component/Hosting/Gameserver/Games it crashes also :)
I guess admins can access also private repositories

I guess admins can access also private repositories

Indeed we can 馃槈 (But we can also check logs which is usually more useful :trollface: )

[Macaron] PANIC: runtime error: slice bounds out of range
/usr/lib/go/src/runtime/panic.go:489 (0x557d0971a0d3)
/usr/lib/go/src/runtime/panic.go:35 (0x557d09718d80)
/srv/app/src/code.gitea.io/gitea/vendor/code.gitea.io/git/tree_entry.go:222 (0x557d09ae2450)
/srv/app/src/code.gitea.io/gitea/vendor/code.gitea.io/git/tree_entry.go:267 (0x557d09ae269c)
/srv/app/src/code.gitea.io/gitea/vendor/code.gitea.io/git/tree_entry.go:239 (0x557d09ae24bd)
/srv/app/src/code.gitea.io/gitea/vendor/code.gitea.io/git/tree_entry.go:179 (0x557d09ae1a96)
/srv/app/src/code.gitea.io/gitea/routers/repo/view.go:51 (0x557d0a1646e0)
/srv/app/src/code.gitea.io/gitea/routers/repo/view.go:308 (0x557d0a168a30)
/srv/app/src/code.gitea.io/gitea/routers/repo/view.go:262 (0x557d0a1685ba)
/usr/lib/go/src/runtime/asm_amd64.s:514 (0x557d0974758a)
/usr/lib/go/src/reflect/value.go:434 (0x557d097aa391)
/usr/lib/go/src/reflect/value.go:302 (0x557d097a9936)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x557d09b48ed1)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x557d09b4888c)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x557d09b75d24)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x557d09b75c48)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/session/session.go:186 (0x557d09bcdde2)
/usr/lib/go/src/runtime/asm_amd64.s:514 (0x557d0974758a)
/usr/lib/go/src/reflect/value.go:434 (0x557d097aa391)
/usr/lib/go/src/reflect/value.go:302 (0x557d097a9936)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x557d09b48ed1)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x557d09b4888c)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x557d09b75d24)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x557d09b75c48)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/recovery.go:161 (0x557d09b88fad)
/usr/lib/go/src/runtime/asm_amd64.s:514 (0x557d0974758a)
/usr/lib/go/src/reflect/value.go:434 (0x557d097aa391)
/usr/lib/go/src/reflect/value.go:302 (0x557d097a9936)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x557d09b48ed1)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x557d09b4888c)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x557d09b75d24)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x557d09b75c48)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/logger.go:43 (0x557d09b88266)
/usr/lib/go/src/runtime/asm_amd64.s:514 (0x557d0974758a)
/usr/lib/go/src/reflect/value.go:434 (0x557d097aa391)
/usr/lib/go/src/reflect/value.go:302 (0x557d097a9936)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x557d09b48ed1)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x557d09b4888c)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x557d09b75d24)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/router.go:184 (0x557d09b8a28b)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/router.go:288 (0x557d09b822ef)
/srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/macaron.go:177 (0x557d09b7a1fe)
/srv/app/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0x557d09dd4ded)
/usr/lib/go/src/net/http/server.go:1942 (0x557d099c4936)
/usr/lib/go/src/net/http/server.go:2568 (0x557d099c7214)
/usr/lib/go/src/net/http/server.go:1825 (0x557d099c3484)
/usr/lib/go/src/runtime/asm_amd64.s:2197 (0x557d09749d51)
[Macaron] 2017-06-26 20:25:00: Completed /shyimtest/gs/src/master/src/GSS/Component/Hosting/Gameserver/Games 500 Internal Server Error in 381.292503ms

Another fun thing I notices is that I don't actually get _any_ output in the browser from that link 馃
While I should be presented with a 500-page it doesn't return any payload at all:

Content-Type        "text/plain; charset=utf-8"
Date            "Mon, 26 Jun 2017 20:27:45 GMT"
x-frame-options     "SAMEORIGIN"
Content-Length      "0" <-- HERE
X-Firefox-Spdy      "h2"

It's exploading here because we're not checking that entryPath[entryNameStartIndex:] is a valid index 馃檮

it's actually exploding because instead of path we are getting commit hash that of course does not have any slash in it. I'm debugging this issue right now

Problem is in log command that is returning merges that by them self does not have any files so we are getting two hashes in the row, so git log command for dir listing must be called with --no-merges

/cc @ethantkoenig

resolved by #2074

Just tested and issue is resolved in master branch :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thehowl picture thehowl  路  3Comments

kifirkin picture kifirkin  路  3Comments

adpande picture adpande  路  3Comments

BNolet picture BNolet  路  3Comments

Fastidious picture Fastidious  路  3Comments