gitea: panic on self built gitea version v1.0.2
- Gitea version (or commit ref): v1.0.2
- Operating system: linux amd64
Description
Hello Giteas,
I built the latest gitea version (v1.0.2) and got a panic from the locale library:
panic: fail to set message file(en-US): open conf/locale/locale_en-US.ini: no such file or directory
goroutine 1 [running]:
code.gitea.io/gitea/vendor/github.com/go-macaron/i18n.initLocales(0xc4202a8278, 0x0, 0xdd2713, 0xb, 0xc420453f20, 0xddc70b, 0x12, 0xc420126160, 0x15, 0x15, ...)
/home/marius/go/src/code.gitea.io/gitea/vendor/github.com/go-macaron/i18n/i18n.go:57 +0x5ff
code.gitea.io/gitea/vendor/github.com/go-macaron/i18n.I18n(0xc420084b40, 0x1, 0x1, 0x0, 0xc420453f20)
/home/marius/go/src/code.gitea.io/gitea/vendor/github.com/go-macaron/i18n/i18n.go:158 +0xee
code.gitea.io/gitea/cmd.newMacaron(0xc42000f040)
/home/marius/go/src/code.gitea.io/gitea/cmd/web.go:125 +0x715
code.gitea.io/gitea/cmd.runWeb(0xc42000f040, 0x0, 0xc42000f000)
/home/marius/go/src/code.gitea.io/gitea/cmd/web.go:160 +0x6f
code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0xcbdae0, 0xe07d78, 0xc42000f040, 0xc420016900, 0x0)
/home/marius/go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xb9
code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0xdc69b6, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0xde1ae2, 0x16, 0x0, ...)
/home/marius/go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xb4b
code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc42010a9c0, 0xc42000a160, 0x2, 0x2, 0x0, 0x0)
/home/marius/go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x65f
main.main()
/home/marius/go/src/code.gitea.io/gitea/main.go:42 +0x377
I think the library (go-macaron/i18n) should handle or return such an error instead of panicking.
Anyway, if I’m using the prebuilt binary (github release page) everything works fine, though.
Thanks, ston1th
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 38 (16 by maintainers)
We probably just need to detect the available translations and drop this stupid config or just use it to restrict what translations are available. Similarly we should allow people to override individual translation files with custom translations but back fill into the inbuilt translations and we should use the hierarchy of languages properly so that if you want to localise you only have to change the values that you need to.
@lafriks Your right. I had omitted the
bindatatag because i suspected that this maybe prevented some settings. In the meantime I already compiled it with that tag again which is supposedly one of the preconditions that made it finally work.Nope. It actually is not related to FreeBSD, though (what an odd coincidence looking at the comments here, though).
It turns out that gogs supports a translation that gitea does not. There is no such thing as gl-ES for gitea, but if you are importing from gogs, your app.ini will include that translation, causing the panic.
I was able to solve the issue in the meantime, the problem was on my side. Instead of using the
giteabinary in$GOPATH/src/code.gitea.io/giteathe one from$GOPATH/binis used that did not include thebindatastuff. Maybe the Makefile’s build target should copy the binary into$GOPATH/bin, too?