Can I get help with my Nakama and Nakama common setup?

Hi everyone! I have been having some issues with the project on the sample tutorial not working as intended. After several tries (tried both the typescript and GO samples, having similar errors in both), I’m faced with this error:

  1. Versions: Nakama 3.3.0, Windows, and Docker
  2. Server Framework Runtime language (If relevant) Go, TS/JS
{backend           | {"level":"info","ts":"2021-10-06T14:35:41.032Z","caller":"migrate/migrate.go:181","msg":"Database connection","dsn":"postgres://postgres:xxxxx@postgres:5432/nakama?sslmode=disable"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.040Z","caller":"migrate/migrate.go:221","msg":"Database information","version":"PostgreSQL 12.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.2.0) 9.2.0, 64-bit"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.042Z","caller":"migrate/migrate.go:245","msg":"Successfully applied migration","count":0}
backend           | + exec /nakama/nakama --config /nakama/data/local.yml --database.address postgres:localdb@postgres:5432/nakama?sslmode=disable
backend           | {"level":"info","ts":"2021-10-06T14:35:41.057Z","caller":"server/config.go:86","msg":"Successfully loaded config file","path":"/nakama/data/local.yml"}
backend           | {"level":"warn","ts":"2021-10-06T14:35:41.057Z","caller":"server/config.go:294","msg":"WARNING: insecure default parameter value, change this for production!","param":"console.username"}
backend           | {"level":"warn","ts":"2021-10-06T14:35:41.057Z","caller":"server/config.go:298","msg":"WARNING: insecure default parameter value, change this for production!","param":"console.password"}
backend           | {"level":"warn","ts":"2021-10-06T14:35:41.057Z","caller":"server/config.go:302","msg":"WARNING: insecure default parameter value, change this for production!","param":"console.signing_key"}
backend           | {"level":"warn","ts":"2021-10-06T14:35:41.057Z","caller":"server/config.go:306","msg":"WARNING: insecure default parameter value, change this for production!","param":"socket.server_key"}
backend           | {"level":"warn","ts":"2021-10-06T14:35:41.057Z","caller":"server/config.go:310","msg":"WARNING: insecure default parameter value, change this for production!","param":"session.encryption_key"}
backend           | {"level":"warn","ts":"2021-10-06T14:35:41.057Z","caller":"server/config.go:314","msg":"WARNING: insecure default parameter value, change this for production!","param":"session.refresh_encryption_key"}
backend           | {"level":"warn","ts":"2021-10-06T14:35:41.057Z","caller":"server/config.go:318","msg":"WARNING: insecure default parameter value, change this for production!","param":"runtime.http_key"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.057Z","caller":"main.go:105","msg":"Nakama starting"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.057Z","caller":"main.go:106","msg":"Node","name":"nakama","version":"3.3.0+83fc6fbc","runtime":"go1.16.3","cpu":12,"proc":12}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.057Z","caller":"main.go:107","msg":"Data directory","path":"/nakama/data"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.057Z","caller":"main.go:118","msg":"Database connections","dsns":["postgres:xxxxx@postgres:5432/nakama?sslmode=disable"]}
backend           | {"level":"debug","ts":"2021-10-06T14:35:41.057Z","caller":"main.go:254","msg":"Complete database connection URL","raw_url":"postgres://postgres:localdb@postgres:5432/nakama?sslmode=disable"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.064Z","caller":"main.go:121","msg":"Database information","version":"PostgreSQL 12.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.2.0) 9.2.0, 64-bit"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.067Z","caller":"server/leaderboard_rank_cache.go:118","msg":"Initializing leaderboard rank cache"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.068Z","caller":"server/leaderboard_rank_cache.go:216","msg":"Leaderboard rank cache initialization completed successfully","cached":[],"skipped":[]}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.068Z","caller":"server/runtime.go:571","msg":"Initialising runtime","path":"/nakama/data/modules"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.068Z","caller":"server/runtime.go:578","msg":"Initialising runtime event queue processor"}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.068Z","caller":"server/runtime.go:580","msg":"Runtime event queue processor started","size":65536,"workers":8}
backend           | {"level":"info","ts":"2021-10-06T14:35:41.068Z","caller":"server/runtime_go.go:2398","msg":"Initialising Go runtime provider","path":"/nakama/data/modules"}
backend           | {"level":"error","ts":"2021-10-06T14:35:41.072Z","caller":"server/runtime_go.go:2494","msg":"Could not open Go module","path":"/nakama/data/modules/backend.so","error":"plugin.Open(\"/nakama/data/modules/backend\"): plugin was built with a different version of package github.com/heroiclabs/nakama-common/api"}
backend           | {"level":"error","ts":"2021-10-06T14:35:41.072Z","caller":"server/runtime.go:586","msg":"Error initialising Go runtime provider","error":"plugin.Open(\"/nakama/data/modules/backend\"): plugin was built with a different version of package github.com/heroiclabs/nakama-common/api"}
backend           | {"level":"fatal","ts":"2021-10-06T14:35:41.072Z","caller":"main.go:146","msg":"Failed initializing runtime modules","error":"plugin.Open(\"/nakama/data/modules/backend\"): plugin was built with a different version of package github.com/heroiclabs/nakama-common/api"}
backend exited with code 1}

Here is the docker file:

FROM heroiclabs/nakama-pluginbuilder:3.3.0 AS builder

ENV GO111MODULE on

ENV CGO_ENABLED 1

WORKDIR /backend

COPY go.mod .

COPY *.go .

COPY vendor/ vendor/

RUN go build --trimpath --mod=vendor --buildmode=plugin -o ./backend.so

FROM heroiclabs/nakama:3.3.0

COPY --from=builder ./backend/backend.so /nakama/data/modules

COPY local.yml /nakama/data

Anyone has faced this and solved it?

On the typescript project, I have a “InitModule not found” error. That I can append here as well if needed

Hi @DoenitZ, it looks like you’re using a version of the nakama-common package that is incompatible with Nakama 3.3.0. Please can you check your go.mod file and ensure you’re using nakama-common v1.14.0.

To ensure you’re using the correct version of nakama and nakama-common please check the release dates for both: