Starting Nakama using docker on Mac

I’m following the instructions on this page to start Nakama via docker on Mac:

This fails with this error:


niclasaberg@niclasmpersonal Nakama % docker compose up         
WARN[0000] /Users/niclasaberg/Niclas/Niclas Repos/Word, pls!/Nakama/docker-compose.yml: `version` is obsolete 
[+] Running 2/0
 ✔ Container nakama-cockroachdb-1  Running                                                                                                                      0.0s 
 ✔ Container nakama-prometheus-1   Running                                                                                                                      0.0s 
Attaching to cockroachdb-1, nakama-1, prometheus-1
Gracefully stopping... (press Ctrl+C again to force)
dependency failed to start: container nakama-cockroachdb-1 is unhealthy

Are there additional steps I need to take for this to work?

Hello,

Odd, is there no error output from the cockroachdb container?

Yup, this is from Docker logs:

2024-05-01 10:48:22 ls: cannot access 'cockroach-data': No such file or directory
2024-05-01 10:48:38 *
2024-05-01 10:48:38 * WARNING: ALL SECURITY CONTROLS HAVE BEEN DISABLED!
2024-05-01 10:48:38 * 
2024-05-01 10:48:38 * This mode is intended for non-production testing only.
2024-05-01 10:48:38 * 
2024-05-01 10:48:38 * In this mode:
2024-05-01 10:48:38 * - Your cluster is open to any client that can access any of your IP addresses.
2024-05-01 10:48:38 * - Intruders with access to your machine or network can observe client-server traffic.
2024-05-01 10:48:38 * - Intruders can log in without password and read or write any data in the cluster.
2024-05-01 10:48:38 * - Intruders can consume all your server's resources and cause unavailability.
2024-05-01 10:48:38 *
2024-05-01 10:48:38 *
2024-05-01 10:48:38 * INFO: To start a secure server without mandating TLS for clients,
2024-05-01 10:48:36 certificate dir "certs" is successfully set up
2024-05-01 10:48:36 starting node for the initialization process. This could take a couple seconds...
2024-05-01 10:48:38 initiating graceful shutdown of server
2024-05-01 10:48:38 too early to drain; used hard shutdown instead
2024-05-01 10:48:38 * consider --accept-sql-without-tls instead. For other options, see:
2024-05-01 10:48:38 * 
2024-05-01 10:48:38 * - https://go.crdb.dev/issue-v/53404/v23.1
2024-05-01 10:48:38 * - https://www.cockroachlabs.com/docs/v23.1/secure-a-cluster.html
2024-05-01 10:48:38 *
2024-05-01 10:48:38 *
2024-05-01 10:48:38 * ERROR: ERROR: server startup failed: failed to start server: failed to create engines: store has no min-version file; this can happen if the store was created by an old CockroachDB version that is no longer supported: dirname="/var/lib/cockroach": pebble: database already exists and is not pristine
2024-05-01 10:48:38 *
2024-05-01 10:48:38 ERROR: server startup failed: failed to start server: failed to create engines: store has no min-version file; this can happen if the store was created by an old CockroachDB version that is no longer supported: dirname="/var/lib/cockroach": pebble: database already exists and is not pristine
2024-05-01 10:48:38 Failed running "start-single-node"

I’ve tried to delete all containers and running it again, but no luck.

Can you try to run docker compose down -v and then docker compose up --build?
This will delete the database volume and hence all the data in it.

I saw this too late!

It’s likely to have worked, because I followed this post:

And manually “upgraded” Cockroachdb step by step, which fixed the issue.

Thanks for the suggestion, good to know how to wipe the db (which was something I looked for but couldn’t find).