[Bug 247381] Gitea fails to start due to missing locale files

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jun 18 14:03:20 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247381

            Bug ID: 247381
           Summary: Gitea fails to start due to missing locale files
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs at FreeBSD.org
          Reporter: vince at vincentbentley.co.uk

Installed gitea from package using the minimal documentation for the FreeBSD
installation at:
https://docs.gitea.io/en-us/install-from-package/

The gitea service does not start for root user using
# service gitea start

To find out what went wrong, starting gitea from command line with:
# su git
# gitea web

Produces the following messages:

2020/06/18 14:04:27 cmd/web.go:107:runWeb() [I] Starting Gitea on PID: 36206
2020/06/18 14:04:28 ...dules/setting/git.go:91:newGit() [I] Git Version:
2.26.2, Wire Protocol Version 2 Enabled
2020/06/18 14:04:29 routers/init.go:87:GlobalInit() [T] AppPath:
/usr/local/sbin/gitea
2020/06/18 14:04:29 routers/init.go:88:GlobalInit() [T] AppWorkPath:
/usr/local/sbin
2020/06/18 14:04:29 routers/init.go:89:GlobalInit() [T] Custom path:
/usr/local/sbin/custom
2020/06/18 14:04:29 routers/init.go:90:GlobalInit() [T] Log path:
/usr/local/sbin/log
2020/06/18 14:04:29 ...dules/setting/log.go:233:newLogService() [I] Gitea
v1.11.6 built with GNU Make 4.2.1, go1.14.1 : pam, sqlite, sqlite_unlock_notify
2020/06/18 14:04:29 ...dules/setting/log.go:276:newLogService() [I] Gitea Log
Mode: Console(Console:info)
2020/06/18 14:04:29 ...les/setting/cache.go:45:newCacheService() [I] Cache
Service Enabled
2020/06/18 14:04:29 ...s/setting/session.go:44:newSessionService() [I] Session
Service Enabled
2020/06/18 14:04:29 routers/init.go:122:GlobalInit() [I] SQLite3 Supported
panic: fail to set message file(en-US): open conf/locale/locale_en-US.ini: no
such file or directory

goroutine 1 [running]:
gitea.com/macaron/i18n.initLocales(0x334454b5, 0x0, 0x71eb15, 0xb, 0x330dc140,
0x72fbec, 0x12, 0x330b22c0, 0x16, 0x16, ...)
       
/wrkdirs/usr/ports/www/gitea/work/gitea-1.11.6/vendor/gitea.com/macaron/i18n/i18n.go:57
+0x587
gitea.com/macaron/i18n.I18n(0x335b7a60, 0x1, 0x1, 0x0, 0x0)
       
/wrkdirs/usr/ports/www/gitea/work/gitea-1.11.6/vendor/gitea.com/macaron/i18n/i18n.go:160
+0x62
code.gitea.io/gitea/routers/routes.NewMacaron(0x9d2b60)
       
/wrkdirs/usr/ports/www/gitea/work/gitea-1.11.6/routers/routes/routes.go:187
+0x898
code.gitea.io/gitea/cmd.runWeb(0x330b2dc0, 0x0, 0x0)
        /wrkdirs/usr/ports/www/gitea/work/gitea-1.11.6/cmd/web.go:119 +0x273
github.com/urfave/cli.HandleAction(0x50e2e0, 0x798158, 0x330b2dc0, 0x33075400,
0x0)
       
/wrkdirs/usr/ports/www/gitea/work/gitea-1.11.6/vendor/github.com/urfave/cli/app.go:490
+0x9c
github.com/urfave/cli.Command.Run(0x70d71b, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0,
0x7392e0, 0x16, 0x0, ...)
       
/wrkdirs/usr/ports/www/gitea/work/gitea-1.11.6/vendor/github.com/urfave/cli/command.go:210
+0x956
github.com/urfave/cli.(*App).Run(0x330f7340, 0x3300e040, 0x2, 0x2, 0x0, 0x0)
       
/wrkdirs/usr/ports/www/gitea/work/gitea-1.11.6/vendor/github.com/urfave/cli/app.go:255
+0x617
main.main()
        /wrkdirs/usr/ports/www/gitea/work/gitea-1.11.6/main.go:110 +0x608

The error message in this lot is:
panic: fail to set message file(en-US): open conf/locale/locale_en-US.ini: no
such file or directory. The missing files appear to be in
/usr/local/share/gitea/options/locale

This package suprised me by polluting /usr/local/sbin with config files in
/usr/local/sbin/custom/conf . I assume it is expecting the missing locale files
to be in /usr/local/sbin/custom/conf/locale .

Possible fix during building is to build with TAGS=bindata
See https://docs.gitea.io/en-us/install-from-source/
I successfully managed to build the backend from source to get the service to
start, but I had problems with the current FreeBSD npm package when building
the frontend.

The Custom Path is currently /usr/local/sbin/custom which puts the config files
under this heirarchy. In my opinion this should be /usr/local/gitea to fit in
with FreeBSD standards or /usr/local/go/src/gitea (in GOROOT) or in a dedicated
go Project Heirarchy /usr/local/go-apps/src/gitea , setting GOPATH accordingly.
https://medium.com/golang-learn/go-project-layout-e5213cdcfaa2

I am not a go developer and I have no intention of becoming one, the little
that I have learned about go while debugging this problem is that go appears to
need some 'house' standards regarding go apps. It is my opinion that FreeBSD
could benefit from some more detailed standards document for building and
packaging go applications. The following was all I could find:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/go-libs.html
https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/uses-go.html
https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/building.html#using-go

>From what I understand, when go projects are properly installed in a consistent
manner, modules can be reused between projects under a single GOPATH.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list