heroiclabs / nakama

Distributed server for social and realtime games and apps.

Home Page:https://heroiclabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misleading error message when running `./nakama migrate up`

tsafs opened this issue · comments

Description

Misleading error message when running ./nakama migrate up.

See these two attempts at running the command:

> ./nakama migrate up
{"level":"info","ts":"2023-10-07T12:06:22.031+0200","caller":"migrate/migrate.go:155","msg":"Database connection","dsn":"postgres://root@localhost:26257/nakama?sslmode=prefer"}
{"level":"fatal","ts":"2023-10-07T12:06:23.328+0200","caller":"migrate/migrate.go:169","msg":"Failed to check if db exists","db":"nakama","error":"failed to connect to `host=localhost user=root database=nakama`: server error (ERROR: node is running secure mode, SSL connection required (SQLSTATE 08P01))"}
> ./nakama migrate up --database.address root:password@127.0.0.1:26257
{"level":"info","ts":"2023-10-07T12:11:19.990+0200","caller":"migrate/migrate.go:155","msg":"Database connection","dsn":"postgres://root:xxxxx@127.0.0.1:26257/nakama?sslmode=prefer"}
{"level":"info","ts":"2023-10-07T12:11:20.788+0200","caller":"migrate/migrate.go:203","msg":"Database information","version":"CockroachDB CCL v23.1.4 (x86_64-pc-linux-gnu, built 2023/06/16 20:36:15, go1.19.4)"}
{"level":"info","ts":"2023-10-07T12:11:31.680+0200","caller":"migrate/migrate.go:226","msg":"Successfully applied migration","count":11}

You can see that the first attempt failed, because the username and password were incorrect. However, the error message implies that I have to enable SSL, which was in fact already enabled.

Steps to Reproduce

  1. Set up Cockroach DB via minikube
  2. Port forward 26257 and enable SSL doing so
  3. Run ./nakama migrate up

Expected Result

I expect the correct error message to be returned.

Actual Result

See the description

Context

The client I use does not matter in this case. I'm using a linux machine.

Your Environment

  • Nakama: 3.17.1+258a7f35
  • Database: cockroachdb/cockroach:v23.1.4
  • Environment name and version: What is this?
  • Operating System and version: Pop!_OS 22.04 LTS