Nakama migrate up error --insecure

Hi all, I’m having an issue when executing “sudo nakama migrate up”

{“level”:“info”,“ts”:“2022-05-23T10:17:18.283Z”,“caller”:“migrate/migrate.go:147”,“msg”:“Database connection”,“dsn”:“postgres://root@localhost:26257/nakama?sslmode=prefer”}
{“level”:“info”,“ts”:“2022-05-23T10:17:18.289Z”,“caller”:“migrate/migrate.go:195”,“msg”:“Database information”,“version”:“CockroachDB CCL v1.1.6 (linux amd64, built 2018/03/12 17:58:05, go1.8.3)”}
{“level”:“fatal”,“ts”:“2022-05-23T10:17:18.300Z”,“caller”:“migrate/migrate.go:215”,“msg”:“Failed to apply migrations”,“count”:0,“error”:“ERROR: syntax error at or near “jsonb” (SQLSTATE 42601) handling 20180103142001_initial_schema.sql”}

the cockroach db is running with the insecure mode

this is the output of the cockroach node status --insecure

±—±-----------------±-------±--------------------±--------------------+
| id | address | build | updated_at | started_at |
±—±-----------------±-------±--------------------±--------------------+
| 1 | instance-1:26257 | v1.1.6 | 2022-05-23 09:51:49 | 2022-05-23 09:51:49 |
±—±-----------------±-------±--------------------±--------------------+

CockroachDB 1.1.6 is over 4 years old at this point, please update to a more recent version and try again.

thanks for the fast answer, I updated cockroach to the latest version, started a node but now another error appeared:

{“level”:“info”,“ts”:“2022-05-23T13:52:07.899Z”,“caller”:“migrate/migrate.go:147”,“msg”:“Database connection”,“dsn”:“postgres://root@localhost:26257/nakama?sslmode=prefer”}
{“level”:“fatal”,“ts”:“2022-05-23T13:52:07.913Z”,“caller”:“migrate/migrate.go:161”,“msg”:“Failed to check if db exists”,“db”:“nakama”,“error”:“failed to connect to host=localhost user=root database=nakama: dial error (dial tcp [::1]:26257: connect: connection refused)”}

Hello @AndreaCarosi-7

Are you able to connect to CockroachDB using a CLI tool? e.g cockroach sql --url postgres://root@localhost:26257/nakama --insecure

How are you running CockroachDB?

Well I don’t know why there were tons of others errors but then I randomly restarted the systemctl service and now it is all working as it should do. Migrate up seems fine:

{"level":"info","ts":"2022-05-23T18:01:18.953Z","caller":"migrate/migrate.go:147","msg":"Database connection","dsn":"postgres://root@localhost:26257/nakama?sslmode=prefer"}
{"level":"info","ts":"2022-05-23T18:01:18.963Z","caller":"migrate/migrate.go:167","msg":"Creating new database","name":"nakama"}
{"level":"info","ts":"2022-05-23T18:01:18.983Z","caller":"migrate/migrate.go:195","msg":"Database information","version":"CockroachDB CCL v21.1.19 (x86_64-unknown-linux-gnu, built 2022/05/09 15:01:31, go1.15.14)"}
{"level":"info","ts":"2022-05-23T18:01:20.761Z","caller":"migrate/migrate.go:218","msg":"Successfully applied migration","count":6}

I only think it might have been the stored cockroach-data. Probably it worked cause i deleted the data folder then restarted the service, but actually not sure!

Big thanks for the support!