Skip to content
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

Can't start Gitea if it's not built with the "bindata" flag #11756

Closed
2 of 7 tasks
AlphaJack opened this issue Jun 4, 2020 · 24 comments
Closed
2 of 7 tasks

Can't start Gitea if it's not built with the "bindata" flag #11756

AlphaJack opened this issue Jun 4, 2020 · 24 comments
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@AlphaJack
Copy link

  • Gitea version (or commit ref): Gitea version 1.11.4 built with GNU Make 4.3, go1.13.8 : sqlite, pam

  • Git version: git 2.27.0-1

  • Operating system: Linux 5.4.42-1-ARCH #1 SMP PREEMPT Thu May 26 01:48:56 UTC 2020 armv7l GNU/Linux

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No
    • Not relevant

Description

I install gitea from the community repo of Arch Linux ARM, which is built with the same PKGBUILD used in Arch Linux.
Starting from version 1.11.4-1 they removed bindata from the build flags, and if I start gitea after an update I encounter the following error:

journalctl -u gitea
Jun 04 13:41:56 hostname systemd[1]: gitea.service: Scheduled restart job, restart counter is at 12.
Jun 04 13:41:56 hostname systemd[1]: Stopped Gitea (Git with a cup of tea).
Jun 04 13:41:56 hostname systemd[1]: Started Gitea (Git with a cup of tea).
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 cmd/web.go:107:runWeb() [I] Starting Gitea on PID: 3603
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 ...dules/setting/git.go:91:newGit() [I] Git Version: 2.27.0, Wire Protocol Version 2 Enabled
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 routers/init.go:87:GlobalInit() [T] AppPath: /usr/bin/gitea
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 routers/init.go:88:GlobalInit() [T] AppWorkPath: /var/lib/gitea
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 routers/init.go:89:GlobalInit() [T] Custom path: /var/lib/gitea/custom
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 routers/init.go:90:GlobalInit() [T] Log path: /var/log/gitea/
Jun 04 13:41:58 hostname gitea[3603]: panic: fail to set message file(en-US): open conf/locale/locale_en-US.ini: no such file or directory
Jun 04 13:41:58 hostname gitea[3603]: goroutine 1 [running]:
Jun 04 13:41:58 hostname gitea[3603]: gitea.com/macaron/i18n.initLocales(0x383e954, 0x4, 0x195bd77, 0xb, 0x3d3da60, 0x196ced6, 0x12, 0x3976200, 0x16, 0x20, ...)
Jun 04 13:41:58 hostname gitea[3603]:         gitea.com/macaron/i18n@v0.0.0-20190822004228-474e714e2223/i18n.go:57 +0x524
Jun 04 13:41:58 hostname gitea[3603]: gitea.com/macaron/i18n.I18n(0x4317a4c, 0x1, 0x1, 0x0, 0x0)
Jun 04 13:41:58 hostname gitea[3603]:         gitea.com/macaron/i18n@v0.0.0-20190822004228-474e714e2223/i18n.go:160 +0x4c
Jun 04 13:41:58 hostname gitea[3603]: code.gitea.io/gitea/routers/routes.NewMacaron(0x1f73cc8)
Jun 04 13:41:58 hostname gitea[3603]:         code.gitea.io/gitea/routers/routes/routes.go:187 +0xab0
Jun 04 13:41:58 hostname gitea[3603]: code.gitea.io/gitea/cmd.runWeb(0x3930790, 0x0, 0x0)
Jun 04 13:41:58 hostname gitea[3603]:         code.gitea.io/gitea/cmd/web.go:119 +0x2a4
Jun 04 13:41:58 hostname gitea[3603]: github.com/urfave/cli.HandleAction(0x1d751d8, 0x1f42ce8, 0x3930790, 0x387c900, 0x0)
Jun 04 13:41:58 hostname gitea[3603]:         github.com/urfave/cli@v1.20.0/app.go:490 +0xc0
Jun 04 13:41:58 hostname gitea[3603]: github.com/urfave/cli.Command.Run(0x194a403, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19765fd, 0x16, 0x0, ...)
Jun 04 13:41:58 hostname gitea[3603]:         github.com/urfave/cli@v1.20.0/command.go:210 +0x7e8
Jun 04 13:41:58 hostname gitea[3603]: github.com/urfave/cli.(*App).Run(0x3e4a0e0, 0x380c140, 0x4, 0x4, 0x0, 0x0)
Jun 04 13:41:58 hostname gitea[3603]:         github.com/urfave/cli@v1.20.0/app.go:255 +0x544
Jun 04 13:41:58 hostname gitea[3603]: main.main()
Jun 04 13:41:58 hostname gitea[3603]:         code.gitea.io/gitea/main.go:110 +0x64cJun 04 13:41:56 hostname systemd[1]: gitea.service: Scheduled restart job, restart counter is at 12.
Jun 04 13:41:56 hostname systemd[1]: Stopped Gitea (Git with a cup of tea).
Jun 04 13:41:56 hostname systemd[1]: Started Gitea (Git with a cup of tea).
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 cmd/web.go:107:runWeb() [I] Starting Gitea on PID: 3603
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 ...dules/setting/git.go:91:newGit() [I] Git Version: 2.27.0, Wire Protocol Version 2 Enabled
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 routers/init.go:87:GlobalInit() [T] AppPath: /usr/bin/gitea
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 routers/init.go:88:GlobalInit() [T] AppWorkPath: /var/lib/gitea
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 routers/init.go:89:GlobalInit() [T] Custom path: /var/lib/gitea/custom
Jun 04 13:41:57 hostname gitea[3603]: 2020/06/04 13:41:57 routers/init.go:90:GlobalInit() [T] Log path: /var/log/gitea/
Jun 04 13:41:58 hostname gitea[3603]: panic: fail to set message file(en-US): open conf/locale/locale_en-US.ini: no such file or directory
Jun 04 13:41:58 hostname gitea[3603]: goroutine 1 [running]:
Jun 04 13:41:58 hostname gitea[3603]: gitea.com/macaron/i18n.initLocales(0x383e954, 0x4, 0x195bd77, 0xb, 0x3d3da60, 0x196ced6, 0x12, 0x3976200, 0x16, 0x20, ...)
Jun 04 13:41:58 hostname gitea[3603]:         gitea.com/macaron/i18n@v0.0.0-20190822004228-474e714e2223/i18n.go:57 +0x524
Jun 04 13:41:58 hostname gitea[3603]: gitea.com/macaron/i18n.I18n(0x4317a4c, 0x1, 0x1, 0x0, 0x0)
Jun 04 13:41:58 hostname gitea[3603]:         gitea.com/macaron/i18n@v0.0.0-20190822004228-474e714e2223/i18n.go:160 +0x4c
Jun 04 13:41:58 hostname gitea[3603]: code.gitea.io/gitea/routers/routes.NewMacaron(0x1f73cc8)
Jun 04 13:41:58 hostname gitea[3603]:         code.gitea.io/gitea/routers/routes/routes.go:187 +0xab0
Jun 04 13:41:58 hostname gitea[3603]: code.gitea.io/gitea/cmd.runWeb(0x3930790, 0x0, 0x0)
Jun 04 13:41:58 hostname gitea[3603]:         code.gitea.io/gitea/cmd/web.go:119 +0x2a4
Jun 04 13:41:58 hostname gitea[3603]: github.com/urfave/cli.HandleAction(0x1d751d8, 0x1f42ce8, 0x3930790, 0x387c900, 0x0)
Jun 04 13:41:58 hostname gitea[3603]:         github.com/urfave/cli@v1.20.0/app.go:490 +0xc0
Jun 04 13:41:58 hostname gitea[3603]: github.com/urfave/cli.Command.Run(0x194a403, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19765fd, 0x16, 0x0, ...)
Jun 04 13:41:58 hostname gitea[3603]:         github.com/urfave/cli@v1.20.0/command.go:210 +0x7e8
Jun 04 13:41:58 hostname gitea[3603]: github.com/urfave/cli.(*App).Run(0x3e4a0e0, 0x380c140, 0x4, 0x4, 0x0, 0x0)
Jun 04 13:41:58 hostname gitea[3603]:         github.com/urfave/cli@v1.20.0/app.go:255 +0x544
Jun 04 13:41:58 hostname gitea[3603]: main.main()
Jun 04 13:41:58 hostname gitea[3603]:         code.gitea.io/gitea/main.go:110 +0x64c

If I downgrade using the latest version built with bindata everything works as expected.
Is there a way to solve this issue without that flag? Or I need to ask the package maintainer to re-add it?

@techknowlogick
Copy link
Member

There is a downstream issue with the arch package where the built files are not put in a location that Gitea expects. You'll need to open a ticket with the package maintainer to have package updated so that the expected paths are used.

As this is out of our control I will close this issue now, however if the arch package maintainers have questions we are available to answer any questions in our chat discord.gg/gitea

@techknowlogick techknowlogick added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Jun 6, 2020
@AlphaJack
Copy link
Author

If anyone is facing the same problem, this is the maintainer answer:

Hi Jack,

I feel like I've answered this question a hundred times already, please
pacdiff your configuration when you see pacnew files being created [0].
The bindata was removed because it was broken, we placed the files in a
separate directory and shipped a configuration change that you should
have merged.

[0] https://wiki.archlinux.org/index.php/Pacman/Pacnew_and_Pacsave

Cheers,

--
Maxime

@lafriks
Copy link
Member

lafriks commented Jun 11, 2020

Interesting how bindata is broken?

@AlphaJack
Copy link
Author

@lafriks I don't know, but you can reach him out at alucryd [at] archlinux [dot] org

@lafriks
Copy link
Member

lafriks commented Jun 15, 2020

It's really recommended to use Gitea in release mode with bindata. Without is meant for development purposes

@ArchangeGabriel
Copy link

@lafriks So I’m trying to upgrade Arch package to 1.12.2, but bindata is still an issue indeed.

In previous versions (starting from 1.11.3 IIRC) bindata was just silently failing. Now, it does this:

make: *** No rule to make target 'modules/public/bindata.go', needed by 'gitea'.  Stop.
make: *** Waiting for unfinished jobs....

What we do (from a clone of git tag 1.12.2):

make vendor
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export EXTRA_GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
  make TAGS="bindata sqlite sqlite_unlock_notify pam" LDFLAGS="-X 'code.gitea.io/gitea/modules/setting.AppWorkPath=/var/lib/gitea/'"

The failure is in the last step.

@ArchangeGabriel
Copy link

P.S.: Tell me if you prefer that I open a new issue. ;)

@lafriks
Copy link
Member

lafriks commented Jul 20, 2020

What error exactly? please specify action for make. (Ex. make ... build)

@ArchangeGabriel
Copy link

make is equivalent to make all, which in turn is defined as make build in your Makefile. Adding build to this line does not change anything to the issue.

@ArchangeGabriel
Copy link

What’s up here then? Should I open a new issue for better visibility?

@zeripath
Copy link
Contributor

@ArchangeGabriel this is very odd. What happens if you change your script to use make build instead?

@ArchangeGabriel
Copy link

Exactly the same thing, sorry if I wasn’t clear that by “Adding build to this line does not change anything to the issue.” I meant I actually tried that.

@zeripath
Copy link
Contributor

OK sorry about that.

How about switching the order of the TAGS ... etc around to after the make?

@ArchangeGabriel
Copy link

I’ve tried this:

  export EXTRA_GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
  export TAGS="bindata sqlite sqlite_unlock_notify pam"
  export LDFLAGS="-X 'code.gitea.io/gitea/modules/setting.AppWorkPath=/var/lib/gitea/'"
  make build

But same issue.

I’m currently having a look at the Makefile, seems the handling of bindata changed at least once recently (11f7fc5).

@zeripath
Copy link
Contributor

It's really weird and I don't quite understand what the problem is. Is it possible the EXTRA_GOFLAGS are conflicting with the bindata - in particular I wonder if there is an issue with modcacherw or mod=readonly?

@ArchangeGabriel
Copy link

OK, found it. It’s a concurrency issue: bindata needs the frontend to be already built, but make is building the frontend and backend on parallel. Using -j1 solves this, but IIRC there is a way to solve this in the Makefile.

@zeripath
Copy link
Contributor

I suspect it's not that the frontend needs to be built but that generate has been run first.

@ArchangeGabriel
Copy link

Indeed, running make generate first made it work even without -j1. I’ll stick to that then for now. ;)

@zeripath
Copy link
Contributor

If we add .NOTPARALLEL: backend that works but it is a GNU extension.

I think adding:

$(BINDATA_DEST): generate 

makes this work.

@ArchangeGabriel
Copy link

OK, so we fixed the first issue, but there is another one remaining, which was the initial reason this ticket was opened.

Here is a gitea 1.12.3 deployed with the Arch package, built with bindata: https://code.astrophysics.eu/

This is why bindata was disabled in the first place… I will revert to that for now, so that the update can be published while we sort that out.

@zeripath
Copy link
Contributor

Oh damn I think you're right we do need the frontend built before bindata can run!

@ArchangeGabriel
Copy link

Indeed, so this:

make frontend
make generate
make build

got it working finally!

archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Jul 29, 2020
See go-gitea/gitea#11756 for changes


git-svn-id: file:///srv/repos/svn-community/svn@665847 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Jul 29, 2020
See go-gitea/gitea#11756 for changes

git-svn-id: file:///srv/repos/svn-community/svn@665847 9fca08f4-af9d-4005-b8df-a31f2cc04f65
@xpader
Copy link

xpader commented Sep 19, 2020

Still have that problem on latest v1.12 branch (1.12.4), with FreeBSD 12.1/amd64, Go 1.14.7, Node 14.4.0, npm 6.12.1。

No rule to make target 'modules/public/bindata.go', needed by 'gitea'.  Stop.

No problem on master branch(1.13.0)

@zeripath
Copy link
Contributor

don't use make -jx - our build is not parallelisable.

have you tried:

make frontend
make generate
make build

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

6 participants