go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45k stars 5.48k forks source link

Linux 2.6.26-2-amd64 : FATAL: kernel too old #4131

Closed r10r closed 4 years ago

r10r commented 6 years ago

Description

~# ./gitea-1.4.2-linux-amd64 -h FATAL: kernel too old Segmentation fault

~# file gitea-1.4.2-linux-amd64 gitea-1.4.2-linux-amd64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, from '8@1600(%rax) 8@1608(%rax)', not stripped ...

I expect that gitea has Go's minimum requirements. Otherwise it would be nice to add a note somewhere that kernel must be >= 2.6.32 https://github.com/golang/go/wiki/MinimumRequirements#linux

lunny commented 6 years ago

Gitea it doesn't ask special linux kernel version. I think that's Go's requirement. And maybe the golang's wiki is not updated?

r10r commented 6 years ago

That's not correct. It's because the binary is statically linked, for GNU/Linux 2.6.32 Other go binaries work fine on this machine.

Rubens-MacBook-Pro:~ ruben$ cat hello.go 
package main

func main() {
    println("hello world")
}
Rubens-MacBook-Pro:~ ruben$ GOOS=linux GOARCH=amd64 go build hello.go 

~# uname -a
Linux tcc.intern.drachenfels.de 2.6.26-2-amd64 #1 SMP Sun Mar 4 21:48:06 UTC 2012 x86_64 GNU/Linux
~# ./hello 
hello world
~# file hello 
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
lafriks commented 6 years ago

That depends on your go version, older go versions had lower kernel requirements, check your go version

r10r commented 6 years ago

I used the precompiled version form the download page and didn't compile gitea myself.

daviian commented 6 years ago

@r10r That's what he actually meant. Since in your example you compile code yourself with your installed go version, which may be older than the one we use to build the binary.

r10r commented 6 years ago

Rubens-MacBook-Pro:~ ruben$ go version go version go1.10.1 darwin/amd64

r10r commented 6 years ago

What version did you use?

daviian commented 6 years ago

we use 1.10.2, see https://github.com/go-gitea/gitea/blob/2fcd9b69b73ca7365a28f6de0d4a74d8991fa014/Dockerfile#L4

r10r commented 6 years ago

I've installed 1.10.2, recompiled the example and it still works ...

r10r commented 6 years ago

Apart from that the Makefile build target does not cross-compile on OSX.

Rubens-MacBook-Pro:gitea ruben$ export GOOS=linux
Rubens-MacBook-Pro:gitea ruben$ export GOARCH=amd64
Rubens-MacBook-Pro:gitea ruben$ make build
go build -i -v  -tags '' -ldflags '-s -w -X "main.Version=1.1.0+1343-g2fcd9b69" -X "main.Tags="' -o gitea
go build errors: mkdir /usr/local/go/pkg/linux_amd64/: permission denied
go build internal/race: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build unicode/utf8: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build container/list: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build crypto/subtle: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build runtime/internal/sys: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build math/bits: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build sync/atomic: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build internal/cpu: open /usr/local/go/pkg/linux_amd64/internal/cpu.a: no such file or directory
go build unicode/utf16: open /usr/local/go/pkg/linux_amd64/unicode/utf16.a: no such file or directory
go build vendor/golang_org/x/crypto/cryptobyte/asn1: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build encoding: open /usr/local/go/pkg/linux_amd64/encoding.a: no such file or directory
go build unicode: open /usr/local/go/pkg/linux_amd64/unicode.a: no such file or directory
go build vendor/golang_org/x/crypto/curve25519: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build internal/nettrace: open /usr/local/go/pkg/linux_amd64/internal/nettrace.a: no such file or directory
go build image/color: mkdir /usr/local/go/pkg/linux_amd64: permission denied
go build runtime/internal/atomic: open /usr/local/go/pkg/linux_amd64/runtime/internal/atomic.a: no such file or directory
go build crypto/internal/cipherhw: mkdir /usr/local/go/pkg/linux_amd64: permission denied
make: *** [gitea] Error 1

When I build it without the Makefile it builds:

Rubens-MacBook-Pro:gitea ruben$ GOOS=linux GOARCH=amd64 go build -o gitea 
Rubens-MacBook-Pro:gitea ruben$ file gitea 
gitea: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped

but raises another error on the server:

~# chmod +x gitea
~# ./gitea web
2018/06/05 13:34:36 [W] Custom config '/root/custom/conf/app.ini' not found, ignore this if you're running first time
2018/06/05 13:34:36 [T] AppPath: /root/gitea
2018/06/05 13:34:36 [T] AppWorkPath: /root
2018/06/05 13:34:36 [T] Custom path: /root/custom
2018/06/05 13:34:36 [T] Log path: /root/log
2018/06/05 13:34:36 [I] Log Mode: Console(Info)
2018/06/05 13:34:36 [I] XORM Log Mode: Console(Info)
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(0xc420177055, 0x0, 0x114d9d2, 0xb, 0xc4200a7740, 0x1159644, 0x12, 0xc42002f080, 0x16, 0x16, ...)
    /Users/ruben/go/src/code.gitea.io/gitea/vendor/github.com/go-macaron/i18n/i18n.go:57 +0x764
code.gitea.io/gitea/vendor/github.com/go-macaron/i18n.I18n(0xc42017c240, 0x1, 0x1, 0x0, 0x0)
    /Users/ruben/go/src/code.gitea.io/gitea/vendor/github.com/go-macaron/i18n/i18n.go:158 +0xcb
code.gitea.io/gitea/routers/routes.NewMacaron(0xc420322640)
    /Users/ruben/go/src/code.gitea.io/gitea/routers/routes/routes.go:101 +0x6a2
code.gitea.io/gitea/cmd.runWeb(0xc420322640, 0x0, 0x0)
    /Users/ruben/go/src/code.gitea.io/gitea/cmd/web.go:87 +0xb2
code.gitea.io/gitea/vendor/github.com/urfave/cli.HandleAction(0xfb2aa0, 0x1199118, 0xc420322640, 0xc42027d300, 0x0)
    /Users/ruben/go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:471 +0xad
code.gitea.io/gitea/vendor/github.com/urfave/cli.Command.Run(0x1141561, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x115fda6, 0x16, 0x0, ...)
    /Users/ruben/go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/command.go:191 +0xa0e
code.gitea.io/gitea/vendor/github.com/urfave/cli.(*App).Run(0xc4200a1380, 0xc42000a080, 0x2, 0x2, 0x0, 0x0)
    /Users/ruben/go/src/code.gitea.io/gitea/vendor/github.com/urfave/cli/app.go:241 +0x5b8
main.main()
    /Users/ruben/go/src/code.gitea.io/gitea/main.go:52 +0x40e
lafriks commented 6 years ago

you need to build using GOOS=linux GOARCH=amd64 go build -tags='bindata' -o gitea

lunny commented 6 years ago

Your gopath haven't set up correctly. go build will not package the resources, you have to copy the resources to the deployment machine.

lunny commented 6 years ago

You can find how to build from source, see https://docs.gitea.io/en-us/install-from-source/

gerricom commented 5 years ago

Just want to let you know, that I get this message when updating our gitea 1.7.4 to 1.7.5 on one of our CentOS6 machines.

> file gitea-1.7.4
gitea-1.7.4: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, not stripped

> file gitea-1.7.5
gitea-1.7.5: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, not stripped

To us this is not very dramatic as we intend to migrate to a more recent OS, but maybe some other users are affected too...

RiverVanRain commented 5 years ago

@gerricom Confirmed. We were forced to downgrade to gitea 1.7.4.

techknowlogick commented 5 years ago

Yes, the change is that the docker image we use to cross-compile our binaries has been updated from Ubuntu 14.04 to 18.04 as 14.04 is End of life in a few days.

However now that we have updated to use go modules, compiling from source yourself is much easier.

You can git clone this repo and run GO111MODULE=on GOOS=linux GOARCH=amd64 go build -tags='bindata' -o gitea (assuming you have go 1.11.x or 1.12.x)

ghost commented 5 years ago

I have this issue with Gitea 1.7.5; had to go to 1.7.4. Kernel version is 2.6.32 (because OpenVZ sucks)

vintprox commented 5 years ago

I have this issue with Gitea 1.7.5; had to go to 1.7.4. Kernel version is 2.6.32 (because OpenVZ sucks)

thank goodness. that one was tough

zeripath commented 5 years ago

Peeps, compiling from source isn't too difficult. Staying on 1.7.4 is not a good idea - our development is pretty rapid and although we've patched a lot of security bugs since the split with gogs, there was one in 1.7.4 that we've fixed in 1.7.5.

@techknowlogick is there no way we can reduce the kernel requirements on the build?

vintprox commented 5 years ago

@zeripath Just this process wasn't fluent enough, I personally got some weird errors without solution in World Wide Web, which were not related to the lack of build-essential tools. IMO if existing core is not accepted and build is barely successful on OpenVZ with Ubuntu 16.04, I have to stick to 1.7.4 binary... or switch VPS provider maybe.

CMiksche commented 5 years ago

I have this issue with Gitea 1.7.5; had to go to 1.7.4. Kernel version is 2.6.32 (because OpenVZ sucks)

Same problem with the binary here - i think quite many users want to run gitea on an OpenVZ vServer ...

I've getting the following erros by compiling from source with both GO111MODULE=on GOOS=linux GOARCH=amd64 go build -tags='bindata' -o gitea and TAGS="bindata" make generate build:

# code.gitea.io/gitea/vendor/github.com/go-xorm/builder
vendor/github.com/go-xorm/builder/builder.go:352: undefined: sql.NamedArg
vendor/github.com/go-xorm/builder/builder.go:364: undefined: sql.Named
vendor/github.com/go-xorm/builder/sql.go:110: undefined: sql.NamedArg
# code.gitea.io/gitea/vendor/gopkg.in/src-d/go-git.v4/plumbing/transport
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/common.go:131: undefined: url.PathEscape
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/common.go:134: undefined: url.PathEscape
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/common.go:194: u.Hostname undefined (type *url.URL has no field or method Hostname)
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/common.go:201: u.Port undefined (type *url.URL has no field or method Port) 

I am usually not compiling things - maybe someone can give me a hint what i can do to solve this?

sh4nks commented 5 years ago

I have just compiled gitea myself. There are instructions on the website on how to do this.

zeripath commented 5 years ago

@Cmiksche your errors appear very odd and suggest to me that you have a very old version of go.

What is your version of go? Just get the latest you can but at least go 1.9

Make sure you set the GOPATH and add its /bin to your PATH

I presume you obtained your Gitea source code using the go command:

go get -d code.gitea.io/gitea
cd "$GOPATH/src/code.gitea.io/gitea"

For building the simplest and recommended thing to do:

TAGS="bindata sqlite sqlite_unlock_notify" make generate build

If you really don't need sqlite you can drop those tags. If you don't drop em you'll need a GCC to build the sqlite library.

zeripath commented 5 years ago

@vintprox if you would like to suggest changes to https://docs.gitea.io/en-us/install-from-source/ we're happy to improve it, but it does say about tags and releases.

What were your strange errors? Master is on the whole relatively stable - apart from around database schema changes necessitating migration script changes. (These unfortunately tend to break a few users because real life data is so much more complex so it's almost impossible to completely get the script right first time and a few users always have a bumpy ride till we get it right.)

CMiksche commented 5 years ago

@Cmikshe your errors appear very odd and suggest to me that you have a very old version of go.

What is your version of go? Just get the latest you can but at least go 1.9

Thank you. Exactly that was my problem (used Go Version 1.7.4)

zeripath commented 5 years ago

@Cmiksche glad that fixed it for you.

I guess we could try to put something in to throw an understandable error if you try to compile with a go that's too old. I think this is relatively easy to add if you compile with make but it's probably preferable to get go build to barf itself.

maikgreubel commented 5 years ago

Tried to build from source using instructions from https://github.com/go-gitea/gitea/issues/4131#issuecomment-477847499 resulted in

$ GO111MODULE=on GOOS=linux GOARCH=amd64 go build -tags='bindata' -o gitea

go: creating new go.mod: module code.gitea.io/gitea
go: copying requirements from Gopkg.lock
go: converting Gopkg.lock: stat github.com/boltdb/bolt@ccd680d8c1a0179ac3d68f692b01e1a1589cbfc7: unknown revision ccd680d8c1a0179ac3d68f692b01e1a1589cbfc7
go: finding github.com/gorilla/mux v1.6.2
go: finding github.com/gorilla/sessions v1.1.1
go: finding github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c
go: finding github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1
go: finding github.com/markbates/going v1.0.0
go: github.com/mvdan/xurls@v0.0.0-20181021210231-e52e821cbfe8: go.mod has post-v0 module path "mvdan.cc/xurls/v2" at revision e52e821cbfe8
go: finding github.com/kr/text v0.1.0
go: finding golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519
go: finding golang.org/x/net v0.0.0-20180706051357-32a936f46389
go: finding golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
go: finding golang.org/x/crypto v0.0.0-20180426225413-12dd70caea02
go: finding golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd
go: finding cloud.google.com/go v0.30.0
go: golang.org/x/net@v0.0.0-20180706051357-32a936f46389: git -c protocol.version=0 fetch --unshallow -f https://go.googlesource.com/net refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/4a22365141bc4eea5d5ac4a1395e653f2669485db75ef119e7bbec8e19b12a21: exit status 1:
        fatal: bad object 0ed95abb35c445290478a5348a7b38bb154135fd
        error: https://go.googlesource.com/net did not send all necessary objects
go: golang.org/x/net@v0.0.0-20180906233101-161cd47e91fd: unknown revision 161cd47e91fd
go: error loading module requirements

Go version 1.11.5 Git version 2.3.6

zeripath commented 5 years ago

Why couldn't you use make ? I really did spend quite a bit of time rewriting the instructions in https://docs.gitea.io/en-us/install-from-source/ to make them as foolproof as possible.

You wouldn't have to download any of these if you'd just used the make file.

If you really don't want to use the make file then you should add a -mod=vendor to that build line.

If you don't want to do that then you'll just have to try again. The failure you're getting is not our fault, it's with googlesource.com . If trying again doesn't work you may have to fund where the partially broken partially downloaded repo golang.org/x/net has been put and just delete it, then try again. Possibly it's in the GOPATH but I don't know.

maikgreubel commented 5 years ago

Hello @zeripath,

I downloaded nothing manually, just the source file of release 1.7.6, unpacked it, cd'ed into gitea-1.7.6 and executed the go build command. Nothing more, but I tried it multiple times because my first intention was that there was an incomplete git pull or something like that.

I tried it now using make but result is still the same:

fatal: Not a git repository (or any of the parent directories): .git
go: github.com/mvdan/xurls@v0.0.0-20181021210231-e52e821cbfe8: go.mod has post-v0 module path "mvdan.cc/xurls/v2" at revision e52e821cbfe8
go: finding github.com/kr/pty v1.1.1
go: finding golang.org/x/net v0.0.0-20180706051357-32a936f46389
go: finding golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
go: golang.org/x/net@v0.0.0-20180706051357-32a936f46389: git fetch -f https://go.googlesource.com/net refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/4a22365141bc4eea5d5ac4a1395e653f2669485db75ef119e7bbec8e19b12a21: exit status 128:
        error: Could not read 04a2e542c03f1d053ab3e4d6e5abcd4b66e2be8e
        fatal: pack has 118 unresolved deltas
        fatal: index-pack failed
go: golang.org/x/net@v0.0.0-20180906233101-161cd47e91fd: unknown revision 161cd47e91fd
go: error loading module requirements
go: github.com/mvdan/xurls@v0.0.0-20181021210231-e52e821cbfe8: go.mod has post-v0 module path "mvdan.cc/xurls/v2" at revision e52e821cbfe8
go: finding golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
go: finding golang.org/x/net v0.0.0-20180706051357-32a936f46389
go: golang.org/x/net@v0.0.0-20180906233101-161cd47e91fd: git fetch -f https://go.googlesource.com/net refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /root/go/pkg/mod/cache/vcs/4a22365141bc4eea5d5ac4a1395e653f2669485db75ef119e7bbec8e19b12a21: exit status 128:
        error: Could not read 04a2e542c03f1d053ab3e4d6e5abcd4b66e2be8e
        fatal: pack has 118 unresolved deltas
        fatal: index-pack failed
go: golang.org/x/net@v0.0.0-20180706051357-32a936f46389: unknown revision 32a936f46389
go: error loading module requirements
make: *** [generate] Error 1

Removing the directory ~/go recursively seems also not solving the problem. :(

Everything I try results in the same problematic package.

I will now give the git repository a try, but I think a build against a release tarball should be repeatable (in case of all requirements still exists) all of the time.

BTW: I never told that there is a problem in your source or configs. I just want to ask for help :)

zeripath commented 5 years ago

Sorry if I sounded annoyed.

Delete /root/go/pkg/mod/cache/

(Which implies you're building as root? Please don't do so much as root it's a really bad idea!)

maikgreubel commented 5 years ago

Hello again and sorry for late feedback.

It took some sparetime to update git to a newer version because the previous was a little bit too old and I thought it could be a reason of build errors. Now I have installed 2.21.0 \o/

Then I switched from zip file to git repo with branch release/v1.7 and gave it a try. And I don't know whether or not it had some influence on it, but the error concerning golang.org/x/net has been gone.

But there is still an issue which prevents from finishing build successful:

go: finding github.com/src-d/gcfg v1.4.0
go: finding github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6
go: finding github.com/Unknwon/i18n v0.0.0-20171114194641-b64d33658966
go: finding github.com/gorilla/mux v0.0.0-20160920230813-757bef944d0f
go: finding github.com/Smerity/govarint v0.0.0-20150407073650-7265e41f48f1
go: finding github.com/Unknwon/com v0.0.0-20170819223952-7677a1d7c113
go: finding gopkg.in/redis.v2 v2.3.2
go: finding github.com/mrjones/oauth v0.0.0-20170225175752-3f67d9c27435
go: finding github.com/gorilla/securecookie v1.1.1
go: finding github.com/mvdan/xurls v0.0.0-20181021210231-e52e821cbfe8
go: finding github.com/dgrijalva/jwt-go v0.0.0-20161101193935-9ed569b5d1ac
go: finding github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
go: github.com/mvdan/xurls@v0.0.0-20181021210231-e52e821cbfe8: go.mod has post-v0 module path "mvdan.cc/xurls/v2" at revision e52e821cbfe8
go: finding github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5
go: finding github.com/klauspost/cpuid v0.0.0-20160302075316-09cded8978dc
go: finding github.com/willf/bitset v0.0.0-20180426185212-8ce1146b8621
go: finding github.com/mattn/go-sqlite3 v1.10.0
go: finding github.com/sergi/go-diff v0.0.0-20161102184045-552b4e9bbdca
go: finding github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53
go: finding code.gitea.io/git v0.0.0-20190311071110-74d7c14dd4a3
go: finding github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd
go: finding github.com/russross/blackfriday v0.0.0-20180428102519-11635eb403ff
go: finding github.com/prometheus/client_golang v0.9.0
go: finding golang.org/x/crypto v0.0.0-20180426225413-12dd70caea02
go: finding golang.org/x/sync v0.0.0-20170317231601-5a06fca2c336
go: finding github.com/msteinert/pam v0.0.0-20151204160544-02ccfbfaf0cc
go: finding github.com/go-xorm/xorm v0.0.0-20190109081850-1cd2662be938
go: finding github.com/mcuadros/go-version v0.0.0-20171003094716-88e56e02bea1
go: finding github.com/go-macaron/toolbox v0.0.0-20180818072302-a77f45a7ce90
go: finding gopkg.in/bufio.v1 v1.0.0-20140618132640-567b2bfa514e
go: finding code.gitea.io/sdk v0.0.0-20181126083707-d95a6e039221
go: finding github.com/issue9/identicon v0.0.0-20160320065130-d36b54562f4c
go: finding github.com/andybalholm/cascadia v0.0.0-20161224141413-349dd0209470
go: finding github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae
go: finding github.com/blevesearch/segment v0.0.0-20160105220820-db70c57796cc
go: finding github.com/denisenkom/go-mssqldb v0.0.0-20161128230840-e32ca5036449
go: finding gopkg.in/src-d/go-git.v4 v4.8.0
go: finding golang.org/x/sys v0.0.0-20181026144532-2772b66316d2
go: finding github.com/go-macaron/captcha v0.0.0-20151123225153-8aa5919789ab
go: finding github.com/go-macaron/inject v0.0.0-20160627170012-d8a0b8677191
go: finding gopkg.in/ldap.v3 v3.0.1
go: finding github.com/blevesearch/bleve v0.0.0-20180227193343-c74e08f039e5
go: finding github.com/facebookgo/httpdown v0.0.0-20160323221027-a3b1354551a2
go: finding github.com/RoaringBitmap/roaring v0.4.7
go: finding github.com/lafriks/xormstore v1.0.0
go: finding github.com/mitchellh/go-homedir v1.0.0
go: finding github.com/gogits/cron v0.0.0-20160810035002-7f3990acf183
go: finding github.com/tstranex/u2f v1.0.0
go: finding gopkg.in/ini.v1 v1.31.1
go: finding github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973
go: finding github.com/go-macaron/cache v0.0.0-20151013081102-561735312776
go: finding github.com/tinylib/msgp v0.0.0-20180516164116-c8cf64dff200
go: finding github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657
go: finding strk.kbt.io/projects/go/libravatar v0.0.0-20160628055650-5eed7bff870a
go: finding gopkg.in/src-d/go-billy.v4 v4.3.0
go: finding github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2
go: finding github.com/gorilla/context v1.1.1
go: finding gopkg.in/testfixtures.v2 v2.5.0
go: finding github.com/go-xorm/builder v0.3.3
go: finding github.com/go-xorm/core v0.6.0
go: finding github.com/couchbase/vellum v0.0.0-20180427141700-eb6ae3743b3f
go: finding github.com/gogits/chardet v0.0.0-20150115103509-2404f7772561
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/golang/protobuf v1.2.0
go: finding github.com/Unknwon/paginater v0.0.0-20151104151617-7748a72e0141
go: finding github.com/markbates/goth v1.47.2
go: finding golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519
go: finding gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc
go: finding github.com/pelletier/go-buffruneio v0.2.0
go: finding github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4
go: finding github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
go: finding github.com/klauspost/compress v0.0.0-20161025140425-8df558b6cb6f
go: finding github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712
go: finding github.com/davecgh/go-spew v1.1.0
go: finding github.com/urfave/cli v0.0.0-20161102131801-d86a009f5e13
go: finding gopkg.in/editorconfig/editorconfig-core-go.v1 v1.2.0
go: finding github.com/Unknwon/cae v0.0.0-20160715032808-c6aac99ea2ca
go: finding github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e
go: finding golang.org/x/text v0.0.0-20170630100924-2bf8f2a19ec0
go: finding github.com/keybase/go-crypto v0.0.0-20170605145657-00ac4db533f6
go: finding gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175
go: finding github.com/microcosm-cc/bluemonday v0.0.0-20161012083705-f77f16ffc87a
go: finding github.com/PuerkitoBio/goquery v0.0.0-20170324135448-ed7d758e9a34
go: finding github.com/go-macaron/binding v0.0.0-20160711225916-9440f336b443
go: finding github.com/go-macaron/gzip v0.0.0-20160222043647-cad1c6580a07
go: finding github.com/go-macaron/i18n v0.0.0-20160612092837-ef57533c3b0f
go: finding github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39
go: finding github.com/stretchr/testify v1.2.1
go: finding github.com/blevesearch/go-porterstemmer v1.0.2
go: finding github.com/boombuler/barcode v0.0.0-20161226211916-fe0f26ff6d26
go: finding gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
go: finding github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
go: finding github.com/xanzy/ssh-agent v0.2.0
go: finding gopkg.in/yaml.v2 v2.0.0-20160928153709-a5b47d31c556
go: finding github.com/lib/pq v0.0.0-20171019223007-456514e2defe
go: finding github.com/go-macaron/session v0.0.0-20181024135422-330e4e4d8beb
go: finding github.com/golang/snappy v0.0.0-20160304054822-5f1c01d9f64b
go: finding github.com/gorilla/sessions v0.0.0-20160922145804-ca9ada445741
go: finding github.com/matttproud/golang_protobuf_extensions v1.0.1
go: finding github.com/shurcooL/sanitized_anchor_name v0.0.0-20160918041101-1dba4b3954bc
go: finding gopkg.in/warnings.v0 v0.1.2
go: finding github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d
go: finding gopkg.in/macaron.v1 v1.2.4
go: finding github.com/go-sql-driver/mysql v1.4.0
go: finding github.com/elazarl/go-bindata-assetfs v0.0.0-20151224045452-57eb5e1fc594
go: finding github.com/go-macaron/csrf v0.0.0-20180426211211-503617c6b372
go: finding golang.org/x/oauth2 v0.0.0-20181101160152-c453e0c75759
go: finding github.com/satori/go.uuid v0.0.0-20160927100844-b061729afc07
go: finding github.com/ethantkoenig/rupture v0.0.0-20180203182544-0a76f03a811a
go: finding github.com/facebookgo/grace v0.0.0-20160926231715-5729e484473f
go: finding github.com/emirpasic/gods v1.12.0
go: finding github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910
go: finding github.com/philhofer/fwd v1.0.0
go: finding github.com/bradfitz/gomemcache v0.0.0-20160117192205-fb1f79c6b65a
go: finding github.com/pquerna/otp v0.0.0-20160912161815-54653902c20e
go: finding github.com/go-macaron/bindata v0.0.0-20161222093048-85786f57eee3
go: finding github.com/jaytaylor/html2text v0.0.0-20160923191438-8fb95d837f7d
go: finding github.com/chaseadamsio/goorgeous v0.0.0-20170901132237-098da33fde5f
go: error loading module requirements

Is it correct, that the following line causes the problem?

go: github.com/mvdan/xurls@v0.0.0-20181021210231-e52e821cbfe8: go.mod has post-v0 module path "mvdan.cc/xurls/v2" at revision e52e821cbfe8

I tried it two and three times with and without removing ~/go directory but error is still the same. If I add the argument -mod=vendor I'm getting always reproducable

build github.com/boltdb/bolt: cannot find module for path github.com/boltdb/bolt

Do you have a hint, what I'm doing wrong?

BR

zeripath commented 5 years ago

OK,

Let's do this completely by the book. Stop downloading zips and tar.gz. Read: https://docs.gitea.io/en-us/install-from-source/ . Ensure that $GOPATH is set - probably $HOME/go. Ensure that $GOPATH/bin is on the $PATH.

go get -d -u code.gitea.io/gitea
cd "$GOPATH/src/code.gitea.io/gitea"
git checkout v1.7.6
TAGS="bindata sqlite sqlite_unlock_notify" make generate build

Go is very opinionated on where it expects things to be. Yes with modules you should be able to download outside of the $GOPATH but let's stick with what we know works for the moment.

maikgreubel commented 5 years ago

Thank you for support :)

First try resulted in error, that go-bindata was not found:

[~/go/src/code.gitea.io/gitea]
(12:02:03)-(maik)-(337)-> TAGS="bindata sqlite sqlite_unlock_notify" make generate build
go generate code.gitea.io/gitea code.gitea.io/gitea/cmd code.gitea.io/gitea/models code.gitea.io/gitea/models/migrations code.gitea.io/gitea/modules/auth code.gitea.io/gitea/modules/auth/ldap code.gitea.io/gitea/modules/auth/oauth2 code.gitea.io/gitea/modules/auth/openid code.gitea.io/gitea/modules/auth/pam code.gitea.io/gitea/modules/avatar code.gitea.io/gitea/modules/base code.gitea.io/gitea/modules/cache code.gitea.io/gitea/modules/context code.gitea.io/gitea/modules/cron code.gitea.io/gitea/modules/generate code.gitea.io/gitea/modules/highlight code.gitea.io/gitea/modules/httplib code.gitea.io/gitea/modules/indexer code.gitea.io/gitea/modules/lfs code.gitea.io/gitea/modules/log code.gitea.io/gitea/modules/mailer code.gitea.io/gitea/modules/markup code.gitea.io/gitea/modules/markup/csv code.gitea.io/gitea/modules/markup/external code.gitea.io/gitea/modules/markup/markdown code.gitea.io/gitea/modules/markup/orgmode code.gitea.io/gitea/modules/metrics code.gitea.io/gitea/modules/minwinsvc code.gitea.io/gitea/modules/notification code.gitea.io/gitea/modules/notification/base code.gitea.io/gitea/modules/notification/ui code.gitea.io/gitea/modules/options code.gitea.io/gitea/modules/pprof code.gitea.io/gitea/modules/private code.gitea.io/gitea/modules/process code.gitea.io/gitea/modules/public code.gitea.io/gitea/modules/recaptcha code.gitea.io/gitea/modules/search code.gitea.io/gitea/modules/setting code.gitea.io/gitea/modules/ssh code.gitea.io/gitea/modules/sync code.gitea.io/gitea/modules/templates code.gitea.io/gitea/modules/test code.gitea.io/gitea/modules/user code.gitea.io/gitea/modules/util code.gitea.io/gitea/modules/validation code.gitea.io/gitea/routers code.gitea.io/gitea/routers/admin code.gitea.io/gitea/routers/api/v1 code.gitea.io/gitea/routers/api/v1/admin code.gitea.io/gitea/routers/api/v1/convert code.gitea.io/gitea/routers/api/v1/misc code.gitea.io/gitea/routers/api/v1/org code.gitea.io/gitea/routers/api/v1/repo code.gitea.io/gitea/routers/api/v1/swagger code.gitea.io/gitea/routers/api/v1/user code.gitea.io/gitea/routers/api/v1/utils code.gitea.io/gitea/routers/dev code.gitea.io/gitea/routers/org code.gitea.io/gitea/routers/private code.gitea.io/gitea/routers/repo code.gitea.io/gitea/routers/routes code.gitea.io/gitea/routers/user code.gitea.io/gitea/routers/user/setting code.gitea.io/gitea/routers/utils
modules/options/options.go:7: running "go-bindata": exec: "go-bindata": executable file not found in $PATH
modules/public/public.go:20: running "go-bindata": exec: "go-bindata": executable file not found in $PATH
modules/templates/templates.go:7: running "go-bindata": exec: "go-bindata": executable file not found in $PATH
make: *** [generate] Error 1

I have an RPM package of go installed which was available in repository. That package does not provide the binary. So I installed go-bindata.x86_64 and executed make again. This resulted in obviously too old go-bindata binary:

[~/go/src/code.gitea.io/gitea]
(12:08:53)-(maik)-(340)-> TAGS="bindata sqlite sqlite_unlock_notify" make generate build
go generate code.gitea.io/gitea code.gitea.io/gitea/cmd code.gitea.io/gitea/models code.gitea.io/gitea/models/migrations code.gitea.io/gitea/modules/auth code.gitea.io/gitea/modules/auth/ldap code.gitea.io/gitea/modules/auth/oauth2 code.gitea.io/gitea/modules/auth/openid code.gitea.io/gitea/modules/auth/pam code.gitea.io/gitea/modules/avatar code.gitea.io/gitea/modules/base code.gitea.io/gitea/modules/cache code.gitea.io/gitea/modules/context code.gitea.io/gitea/modules/cron code.gitea.io/gitea/modules/generate code.gitea.io/gitea/modules/highlight code.gitea.io/gitea/modules/httplib code.gitea.io/gitea/modules/indexer code.gitea.io/gitea/modules/lfs code.gitea.io/gitea/modules/log code.gitea.io/gitea/modules/mailer code.gitea.io/gitea/modules/markup code.gitea.io/gitea/modules/markup/csv code.gitea.io/gitea/modules/markup/external code.gitea.io/gitea/modules/markup/markdown code.gitea.io/gitea/modules/markup/orgmode code.gitea.io/gitea/modules/metrics code.gitea.io/gitea/modules/minwinsvc code.gitea.io/gitea/modules/notification code.gitea.io/gitea/modules/notification/base code.gitea.io/gitea/modules/notification/ui code.gitea.io/gitea/modules/options code.gitea.io/gitea/modules/pprof code.gitea.io/gitea/modules/private code.gitea.io/gitea/modules/process code.gitea.io/gitea/modules/public code.gitea.io/gitea/modules/recaptcha code.gitea.io/gitea/modules/search code.gitea.io/gitea/modules/setting code.gitea.io/gitea/modules/ssh code.gitea.io/gitea/modules/sync code.gitea.io/gitea/modules/templates code.gitea.io/gitea/modules/test code.gitea.io/gitea/modules/user code.gitea.io/gitea/modules/util code.gitea.io/gitea/modules/validation code.gitea.io/gitea/routers code.gitea.io/gitea/routers/admin code.gitea.io/gitea/routers/api/v1 code.gitea.io/gitea/routers/api/v1/admin code.gitea.io/gitea/routers/api/v1/convert code.gitea.io/gitea/routers/api/v1/misc code.gitea.io/gitea/routers/api/v1/org code.gitea.io/gitea/routers/api/v1/repo code.gitea.io/gitea/routers/api/v1/swagger code.gitea.io/gitea/routers/api/v1/user code.gitea.io/gitea/routers/api/v1/utils code.gitea.io/gitea/routers/dev code.gitea.io/gitea/routers/org code.gitea.io/gitea/routers/private code.gitea.io/gitea/routers/repo code.gitea.io/gitea/routers/routes code.gitea.io/gitea/routers/user code.gitea.io/gitea/routers/user/setting code.gitea.io/gitea/routers/utils
flag provided but not defined: -ignore
Usage: go-bindata [options] <filename>

  -func="": Optional name of the function to generate.
  -nomemcopy=false: Use a .rodata hack to get rid of unnecessary memcopies. Refer to the documentation to see what implications this carries.
  -out="": Optional path and name of the output file.
  -pkg="main": Name of the package to generate.
  -prefix="": Optional path prefix to strip off map keys and function names.
  -tags="": Optional build tags
  -toc=false: Generate a table of contents for this and other files. The input filepath becomes the map key. This option is only useable in non-pipe mode.
  -uncompressed=false: The specified resource will /not/ be GZIP compressed when this flag is specified. This alters the generated output code.
  -version=false: Display version information.
modules/options/options.go:7: running "go-bindata": exit status 2

Same error for modules/public/public.go:20 and modules/templates/templates.go:7

I have version

[~/go/src/code.gitea.io/gitea]
(12:11:36)-(maik)-(343)-> go-bindata -version
bindata 2.1.0 (Go runtime go1.1.2).
Copyright (c) 2010-2013, Jim Teeuwen.

I will try to update the go-bindata and give feedback asap.

bwenrich commented 5 years ago

I had the same problem (too old kernel 2.6.32.x on Ubuntu 16.04 LTS on OpenVZ). While my disappointment is with my OpenVZ host (not Gitea) I was able to build from source based on the documentation steps.

If I understand, the requirements are golang >=1.9.x, go-bindata (not sure what version), and make.

## prepare the system dependencies
# apt-get install make
$ wget https://dl.google.com/go/go1.12.4.linux-amd64.tar.gz
# tar -C /usr/local -xzf go1.12.4.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin # (actually set this in global /etc/profile.d/10-go.sh)
$ export GOPATH=/home/$USER/go
## prepare the go-bindata dependency
$ go get github.com/jteeuwen/go-bindata
$ cd $GOPATH/src/github.com/jteeuwen/go-bindata/go-bindata
$ go build
# cp /home/$USER/go/src/github.com/jteeuwen/go-bindata/go-bindata/go-bindata /usr/local/go/bin/go-bindata
## build gitea from source
$ cd; go get -v -d -u code.gitea.io/gitea
$ git checkout v1.8.0
$ TAGS="bindata" make generate build

I am very new to Gitea, so welcome corrections if I have overlooked something in these steps

maikgreubel commented 5 years ago

I updated go-bindata to 3.1.0 and now it builds successfully.

Thank you.

PlanetRenox-zz commented 5 years ago

So I installed Gitea 1.7.4 some time ago using this guide.

Now when trying to upgrade to 1.8.1 I get the "FATAL: kernel too old" error.

Does this mean I need to reset the server and build from source all over again? Or can this be fixed without having to go through all that again?

maikgreubel commented 5 years ago

@PlanetRenox, to give you a valid answer, you need to provide more information about your system. Which distribution, which kernel do you use?

Which output you get by executing

$> uname -a

Long story short: The build executable by the gitea team does not support linux kernel with version 2.6. In case you use such a kernel with 64bit I could provide you a pre-built executable.

PlanetRenox-zz commented 5 years ago

@maikgreubel Using the guide I linked I basically built Gitea 1.7.4 from binary on CentOS 7

Here is my output for uname -a

Linux git 2.6.32-042stab134.7 #1 SMP Tue Nov 27 18:35:26 MSK 2018 x86_64 x86_64 x86_64 GNU/Linux

What should I do? If you provide me a pre-built executable please also let me know how to not lose user/repo data that is already on the server. (db type: sqlite3)

maikgreubel commented 5 years ago

@PlanetRenox, you can try https://packages.nkey.de/gitea/gitea-1.8.2-amd64-linux26.xz

HTH

zeripath commented 5 years ago

@techknowlogick could we do additional builds on a centos docker?

PlanetRenox-zz commented 5 years ago

@maikgreubel it worked. gj

How did you figure that out? What do I do for future updates?

maikgreubel commented 5 years ago

@PlanetRenox, you are welcome :)

I can only direct you to the question I asked and the answers I got in this thread here, to answer your question how I figured it out ;)

@zeripath asked the question to support the old kernel 2.6 using docker builds. This would be a great solution. In any other case each user of us will need to compile the stuff by itself. Or someone in the community is willing to do it in future and provide a built binary. So it depends on what the result of discussion to use docker build will be. A community member provided binary will be fine but it is a not so optimal solution from security and trust point of view.

lunny commented 5 years ago

I removed the go-bindata dependent on https://github.com/go-gitea/gitea/pull/7080

I have created a repository to compile go repository with gcc. It's based on a recent centos image, see https://gitea.com/lunny/centos-go and https://cloud.docker.com/u/lunny/repository/docker/lunny/centos-go

lunny commented 4 years ago

I will close this issue and please feel free to reopen it.