Cant run server

Hi,

Following the getting started on the website combined with GitHub - heroiclabs/nakama-project-template: An example project on how to set up and write custom server code in Nakama server. files i cannot get the nakama server ro run properly through docker-compose.

I get the following error: plugin was built with a different version of package github.com/heroiclabs/nakama-common/api

My dockerfile:
FROM heroiclabs/nakama-pluginbuilder:3.9.0 AS builder

ENV GO111MODULE on

ENV CGO_ENABLED 1

ENV GOPRIVATE “github.com/heroiclabs/nakama-project-template

WORKDIR /backend

COPY . .

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

FROM heroiclabs/nakama:3.9.0

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

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

COPY --from=builder /backend/local.yml /nakama/data/

My go.mod file:

go 1.17
require github.com/heroiclabs/nakama-common v1.21.0
require protobuf module - google.golang.org/protobuf - pkg.go.dev v1.27.1 // indirect

if any other information is needed, ill provide it! :slight_smile:

thanks in advance!

You are using the wrong version of the nakama-common library for Nakama 3.9.0:

NOTE: For developers who use the Go server runtime support. The nakama-common package at v1.20.0 must be used with this release.

In addition, this documentation will help with your issues:
https://heroiclabs.com/docs/nakama/server-framework/go-dependency-pinning/#go-dependency-version-mismatch

It is unbelievable how helpful you guys are on this forum! I once again, thank you! :slight_smile:

1 Like