After updating my nakama server from 3.23 to 3.25 I obviously had to rebuild my go runtime. I changed the version of that and rebuilt with runtime 1.35 and deployed it to my server. When I restarted my docker container it picked up the new backend.so file but reported “plugin was built with a different version of package runtime”.
I created a clean new project for the runtime as described here: Go Runtime - Heroic Labs Documentation
Built and deployed that, but still received the same errors. This is the log of the server from startup:
+ exec /nakama/nakama --name nakama1 --database.address root@cockroachdb:26257 --metrics.prometheus_port 9100 --config /nakama/data/my-config.yml
INF server/config.go:93 > ts=2025-01-09T12:42:22.568Z msg=Successfully loaded config file path=/nakama/data/my-config.yml
WRN server/config.go:333 > ts=2025-01-09T12:42:22.568Z msg=WARNING: insecure default parameter value, change this for production! param=console.signing_key
WRN server/config.go:341 > ts=2025-01-09T12:42:22.568Z msg=WARNING: insecure default parameter value, change this for production! param=session.encryption_key
WRN server/config.go:345 > ts=2025-01-09T12:42:22.568Z msg=WARNING: insecure default parameter value, change this for production! param=session.refresh_encryption_key
WRN server/config.go:349 > ts=2025-01-09T12:42:22.568Z msg=WARNING: insecure default parameter value, change this for production! param=runtime.http_key
INF main.go:140 > ts=2025-01-09T12:42:22.568Z msg=Nakama starting
INF main.go:141 > ts=2025-01-09T12:42:22.568Z msg=Node name=nakama1 version=3.25.0+592b52c6 runtime=go1.23.3 cpu=12 proc=12
INF main.go:142 > ts=2025-01-09T12:42:22.568Z msg=Data directory path=./data/
INF main.go:153 > ts=2025-01-09T12:42:22.568Z msg=Database connections dsns=["root@cockroachdb:26257"]
DBG server/db.go:116 > ts=2025-01-09T12:42:22.569Z msg=Complete database connection URL raw_url=postgres://root@cockroachdb:26257/nakama?sslmode=prefer
INF server/db.go:140 > ts=2025-01-09T12:42:22.572Z msg=Database information version=CockroachDB CCL v23.1.25 (x86_64-pc-linux-gnu, built 2024/08/13 17:55:29, go1.19.13)
INF server/metrics.go:178 > ts=2025-01-09T12:42:22.574Z msg=Starting Prometheus server for metrics requests port=9100
INF server/leaderboard_rank_cache.go:140 > ts=2025-01-09T12:42:22.577Z msg=Initializing leaderboard rank cache
INF server/runtime.go:655 > ts=2025-01-09T12:42:22.577Z msg=Initialising runtime path=data/modules
INF server/leaderboard_rank_cache.go:201 > ts=2025-01-09T12:42:22.577Z msg=Leaderboard rank cache initialization completed successfully cached=[] skipped=[] duration=68.441µs
INF server/runtime.go:662 > ts=2025-01-09T12:42:22.577Z msg=Initialising runtime event queue processor
INF server/runtime.go:664 > ts=2025-01-09T12:42:22.577Z msg=Runtime event queue processor started size=65536 workers=8
INF server/runtime_go.go:2900 > ts=2025-01-09T12:42:22.577Z msg=Initialising Go runtime provider path=data/modules
ERR server/runtime_go.go:2996 > ts=2025-01-09T12:42:22.582Z msg=Could not open Go module path=data/modules/backend.so error=plugin.Open("data/modules/backend"): plugin was built with a different version of package runtime
ERR server/runtime.go:670 > ts=2025-01-09T12:42:22.582Z msg=Error initialising Go runtime provider error=plugin.Open("data/modules/backend"): plugin was built with a different version of package runtime
fatal main.go:201 > ts=2025-01-09T12:42:22.582Z msg=Failed initializing runtime modules error=plugin.Open("data/modules/backend"): plugin was built with a different version of package runtime
The go.sum shows that the correct version of the runtime was used:
github.com/heroiclabs/nakama-common v1.35.0 h1:gO3J2v2E12sZ2uL258lt5YF6yNO1tiPtvL7ZwV8t/n0=
github.com/heroiclabs/nakama-common v1.35.0/go.mod h1:E4kw2QpsINoXXJS7aOjen1dycPkoo9bD9pYPAjmA8rc=
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
I did rename the backend.so file to something else to see in the logs if the server actually read the new file or loads an old one but this confirmed the newly built file is used by the server.