Invalid server key

It’s been a while I’m stuck on this

ApiResponseException(StatusCode=401, Message=‘Server key invalid’, GrpcStatusCode=16)

The error is clear, the problem is that both my keys on client & server are the same.

{“level”:“info”,“ts”:“2021-02-15T13:52:28.166Z”,“caller”:“server/config.go:87”,“msg”:“Successfully loaded config file”,“path”:"/nk-config/nakama-config.yml"}


# /nk-config/nakama-config.yml
  server_key: fooBar
  port: 7350
  max_message_size_bytes: 4096 # bytes


_client = new Client("http", RemoteConfig.Host, RemoteConfig.Port, "fooBar", UnityWebRequestAdapter.Instance)

I don’t understand … It was working fine and suddenly happening. I tried to change both, rebuild my Docker image, rebuild the client (or simply run from the editor …).
Is it possibly related to some versions?

My Nakama Dockerfile

FROM heroiclabs/nakama-pluginbuilder:3.0.0 AS builder


WORKDIR /backend

COPY . .

RUN go build -mod=mod --trimpath --buildmode=plugin -o ./ ./cmd/main

FROM heroiclabs/nakama:3.0.0

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

I deploy Nakama + the DB on Kubernetes using helm-charts/charts/nakama at main · louis030195/helm-charts · GitHub but that doesn’t matter, the node clearly loads the config, and doing a cat while ssh’ing into the container is what I expect.

Any idea in which direction I should look ?

Start by checking the server console. Do you see the server key you expect on the config page?

My bad, the client was connecting to the wrong port.
And the error was misleading me because I had another Nakama running in another namespace (with the wrong port and a different server key)