Problem compiling go for nakama 2.13 go 1.15 plugin was built with a different version of package

Hey guys, having trouble again compiling go for the latest server build 2.13 on linux and mac. Have updated go to 1.15. I have run the mod cache clean and tidy commands as recommended before. Here are the steps we’ve taken:

Delete existing .mod, .sum and .so files.
env GO111MODULE=on go clean -modcache
env GO111MODULE=on go mod tidy
go mod init “go_source”
go get -u “
go build -buildmode=plugin -trimpath -o ./

These are the packages that get pulled:
go: finding module for package
go: downloading v1.3.5
go: finding module for package
go: downloading v3.6.2+incompatible
go: downloading v4.9.0
go: downloading v1.6.2
go: found in v1.6.2
go: found in v4.9.0
go: downloading v0.0.0-20191009234506-e7c1f5e7dbb8
go: downloading v1.1.0
go: downloading v0.0.0-20191204190536-9bdfabe68543
go: downloading v1.5.0
go: downloading v1.7.0
go: downloading v1.0.0
go: downloading v2.0.5
go: downloading v0.0.0-20200714003250-2b9c44734f2b
go: downloading v0.0.0-20200622213623-75b288015ac9
go: downloading v1.0.0
go: downloading v0.3.3
go: downloading v1.0.0
go: downloading v2.0.1

here’s our go env:
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build960187612=/tmp/go-build -gno-record-gcc-switches"

Any help or recommendations would be greatly appreciated. Thanks.

oh, here is the contents of our mod file:
module go_source

go 1.15

require ( v1.6.2 v1.7.3 v4.9.0

From the 2.13.0 release vendor/modules.txt file the version of the crypto package should be: v0.0.0-20200323165209-0ec3e9974c59

Make sure the version matches correctly and it should build fine.

@oscargoldman Also note that it’s important the exact version of the build toolchain you use. Go 1.15.0 is different to Go 1.15.2 (which is the latest). The 2.13.0 release of Nakama was built with the Go 1.15.0 release of the toolchain. These will need to match for the shared object to be loaded without a mismatch in the Go runtime.

Yeah, we definitely have 1.15.0 installed:
go version go1.15 linux/amd64
I noticed that in the nakama source code on master
that the crypto package version is the same that we’re getting v0.0.0-20200622213623-75b288015ac9, and not the version that Andrei specified, maybe that’s an update for the next release?
Can I just add that specific version to our mod file after cleaning the cache? Or how do I specify to grab that version? Thanks for the help guys.

I have 3 modules.txt files, one in the nakama-common 1.7.3 package that doesn’t specify the crypto package, and 2 others in go installation.
The both have the crypto package with the mismatched version, but commented out:
GNU nano 4.8 /usr/local/go/src/vendor/modules.txt v0.0.0-20200622213623-75b288015ac9


what’s the best way to correct the version? Thanks again.

I also noticed that the go.mod file in nakama-commomn@v1.7.3 specifies go 1.13, not sure if that’s related or not.

@oscargoldman The master branch of the server is always ahead of the official releases. You should look at the specific release tag as @zyro showed to determine the dependencies within that release:

what’s the best way to correct the version? Thanks again.

There’s some other posts on the forum on how to pin transitive dependencies which are different due to minimal version selection. The shortest answer I can give is to create a blank import in your main.go file which specifies the dependency you want to pin:

import (
    _ ""

This way you can control the dependency version in your modfile.

I also noticed that the go.mod file in nakama-commomn@v1.7.3 specifies go 1.13, not sure if that’s related or not.

No that’s not relevant. The version information in the modfile simply indicates what version of the Go toolchain was used to create the file it does not indicate the minimum required version of the Go toolchain to perform builds. It’s a source of confusion with Go developers but that version info in the modfile is mostly useless.

Hope this helps.

Thanks Chris for the help. When you say main.go file, you’re referring to the go source code we’re trying to compile into a shared object? I’ve added the import as you suggested, and now when I build I see that the crypto package is added to the imports in the mod file, only it’s still the wrong version. If I change the version to the required version Andrei specified, it is just reverted each time.

I tried adding the -mod=readonly argument to the build command, but get back
go: updates to go.mod needed, disabled by -mod=readonly
and the build fails. Nothing I do seems to stop the crypto package from being the wrong version v0.0.0-20200622213623-75b288015ac9

OH, I got somewhere. I ran go get
and that seems to have resolved the issue with the pbkdf2 version. now I’m seeing a similar error related to the x/text/transfrom package.

I checked the text package for the 2.13 release and it needs v0.3.2 and for reasons I don’t understand I was getting version v.0.3.3. I ran go get for that version, changed the mod file, and it’s working!

1 Like