Using minimal example
Using DockerBuild in Windowsx64
Builded using these commands:
*PS C:\Users\Administrator\plugin_code> go get -u “github.com/heroiclabs/nakama-common” *
@irajsb The Nakama v2.11.1 release requires the protobuf v1.3.5 release. You can setup your dependencies to match like so:
env GO111MODULE=on go get "github.com/heroiclabs/nakama-common@v1.4.0"
env GO111MODULE=on go get "github.com/golang/protobuf@v1.3.5"
env GO111MODULE=on go mod edit -replace "github.com/golang/protobuf=github.com/golang/protobuf@v1.3.5"
Please try that and let me know if it resolves your issue. Your mod file should look somewhat like:
Didnt want to create another thread for this : is it possible to get client ip addres from a request with signature like this :
func RegisterServer(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, payload string) (string, error)
Sorry to bring back an old thread, but this still seems to be an issue.
Running through the quickstart guide, with no prior usage of Go on our systems, we get to a point where protobuf-1.3.4 is listed rather than protobuf-1.3.5. We were able to build our module using the docker image you provide, however, this won’t run within Nakama server due to the incompatibility.
We were only able to solve this by finding this thread and fetching the new protobuf version. We note that some Nakama repos are still using protobuf-1.3.4, is that where the incorrect version is coming from?
Should the quickstart guide be updated to ensure the correct dependencies are installed?
@kburgin As you’ll see from the Nakama 2.11.1 module definitions the issue you’re describing is already resolved. I’d recommend updating to 2.12.0 if at all possible, it’s best to stay up to date with server releases.
Can you point me to the quickstart section that still mentions protobuf-1.3.4, or submit a Pull Request to the documentation repository to fix it?
This obviously doesn’t fit with the rest of the environment, which all reference proto:1.3.5 as you say.
I’m not sure how you want to approach the plugin docs, whether to point at nakama-common:1.7.2 or maybe there’s a reason it’s pointing to an older version?
@kburgin Each release of the game server uses a specific release of the nakama-common Go package because the common package provides the interface for custom server logic implemented in plugin code. They must be binary compatible. You can see which release of Nakama uses which release of the nakama-common package in the release notes on GitHub.
The protobuf dependency is a direct dependency of the nakama-common Go package so it must match. We ensure that the server release uses the same version of protobuf as the nakama-common dependency defines. This prevents “minimal version selection” in Go modules from attempting to use a different version of the Protobuf runtime.
Ah I see. There just seems to be a bit of a mismatch around 2.11.1 if you look at the releases. 2.11.0 and 2.11.1 both seem to need nakama-common:1.4.0 yet 2.11.0 and 2.11.1 use different proto versions which makes that not possible.
If we run 2.12.0 and 1.5.1, then it’s all fine.
There are just quite a few sporadic references to the old versions which don’t match up. For example, the sample plugin references heroiclabs/nakama-pluginbuilder:2.11.1 and then heroiclabs/nakama-common@v1.4.0 which seems like it’s going to cause issues (and did for us) when we tried to run this with the sample docker-compose file in the quick start that lists heroiclabs/nakama:2.11.1.
Just needs a few version numbers matching up by the looks of it.
Probably the best way to find all dependencies you need to match with is the vendor/modules.txt for your chosen server release. For Nakama 2.11.1 that’s here. It effectively contains the dependency versions selected by the Go toolchain for the server build at the time of the release. Note that this is just a useful tool, as @novabyte pointed out there’s more to Go dependency version selection than that.
We can’t necessarily document the latest version every time. There will be new versions of nakama-common for example that are not yet used in a Nakama server release, and should not be documented as dependencies at those version numbers.
@ameza Have a look at the release notes we cover which version of the common library is used with each server release there. But to answer your immediate question on Nakama 2.7.0 release you’ll want to use the v1.0.0 release of Nakama common:
go get "github.com/heroiclabs/nakama-common/runtime@v1.0.0"
@mautoan11 Firstly, at the time of writing this, the latest protnbuf release is v1.27.1, not sure where you are getting v1.3.5. Secondly, you need to align your protobuf deps with Nakama’s go.mod files: