Problem with go runtime module

Hi everyone, I’m trying to launch the example module in this tutorial https://github.com/heroiclabs/nakama/tree/master/sample_go_module (I’m using Nakama Server v2.11.1 binary version, not Docker, on a linux server), I create the module exactly as explained in the tutorial, but when I launch the command nakama --runtime.path “$HOME/plugin_code” I get this error from server: “plugin was built with a different version of package internal/cpu”.
I tried to search on internet to see if someone had had the same problem but unfortunately I found no satisfactory solution.
Could someone help me?
Thank you.

@antoniocapizzi95 can you share the build command you use for your Go plugin code? The error “different version of package internal/cpu” always occurs when the -trimpath flag is not used to make sure the built code is filesystem independent or when you have your Go toolchain at a different version to the version that Nakama was built for. Right now the v2.11.1 release uses Go 1.14.1 and not the newest Go 1.14.2 release yet.

I use this command “go build -buildmode=plugin -trimpath -o ./plugin_code.so” as suggested in the tutorial.
But my version of Go is 1.14.2, could that be the problem?
Edit: I tried with go v1.14 but it still doesn’t work.

But my version of Go is 1.14.2, could that be the problem?

Yes. You cannot use the Go 1.14.2 release with the latest release of Nakama right now. You MUST use the Go 1.14.1 release.

Thanks, with go 1.14.1 it works correctly.

1 Like