We ran into this issue before, and it somehow fixed itself after repeatedly trying, but now doesn’t seem to want to work. We have our dev environment running on a mac mini, we’re using the mac binary of nakama v 2.8.0. Compiling our go source code for linux for our production environment using the docker build tool works as expected and loads into Nakama. On mac though, using the same docker tool - the module compiles fine without any errors, but will not load into nakama. We get the following errors:
{“level”:“error”,“ts”:“2019-12-19T09:40:22.152-0500”,“msg”:“Could not open Go module”,“path”:"/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so",“error”:“plugin.Open(”/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so"): dlopen(/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so, 10): no suitable image found. Did find:\n\t/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00\n\t/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so: stat() failed with errno=60",“stacktrace”:“github.com/heroiclabs/nakama/v2/server.openGoModule\n\tgithub.com/heroiclabs/nakama/v2@/server/runtime_go.go:1944\ngithub.com/heroiclabs/nakama/v2/server.NewRuntimeProviderGo\n\tgithub.com/heroiclabs/nakama/v2@/server/runtime_go.go:1858\ngithub.com/heroiclabs/nakama/v2/server.NewRuntime\n\tgithub.com/heroiclabs/nakama/v2@/server/runtime.go:448\nmain.main\n\tgithub.com/heroiclabs/nakama/v2@/main.go:130\nruntime.main\n\truntime/proc.go:203”}
{“level”:“error”,“ts”:“2019-12-19T09:40:22.153-0500”,“msg”:“Error initialising Go runtime provider”,“error”:“plugin.Open(”/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so"): dlopen(/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so, 10): no suitable image found. Did find:\n\t/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00\n\t/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so: stat() failed with errno=60",“stacktrace”:“github.com/heroiclabs/nakama/v2/server.NewRuntime\n\tgithub.com/heroiclabs/nakama/v2@/server/runtime.go:450\nmain.main\n\tgithub.com/heroiclabs/nakama/v2@/main.go:130\nruntime.main\n\truntime/proc.go:203”}
{“level”:“fatal”,“ts”:“2019-12-19T09:40:22.153-0500”,“msg”:“Failed initializing runtime modules”,“error”:“plugin.Open(”/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so"): dlopen(/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so, 10): no suitable image found. Did find:\n\t/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00\n\t/Users/Shared/Jenkins/nakama_server/data/modules/go_source/module.so: stat() failed with errno=60",“stacktrace”:“main.main\n\tgithub.com/heroiclabs/nakama/v2@/main.go:132\nruntime.main\n\truntime/proc.go:203”}
We are using the same steps as outlined in the documentation. We have go v 1.13.4 installed, and run
go mod init “go_source”
go get -u “github.com/heroiclabs/nakama-common@v1.2.0”
and
docker run --rm -w “/builder” -v “${PWD}:/builder” heroiclabs/nakama-pluginbuilder:2.8.0 build -buildmode=plugin -trimpath -o ./module.so
Any ideas on why the .so won’t load into nakama? Thanks in advance.