hasura/learn-graphql

FATA[0001] cannot read config: invalid config version when running hasura migrate apply

Shoryu-N opened this issue · 3 comments

Now I’m doing https://hasura.io/learn/graphql/nextjs-fullstack-serverless/hasura-backend/.
In the last chapter, hasura migrate apply --database-name default --admin-secret xxxx doesn’t work depending on the ver of the HasuraCLI and the downloadable hasura project’s config.yml , so it might be more clear if that is also written as note.

At the time I did this tutorial when I ran the CLI binary download command, it downloaded v1.3.3. So when I ran hasura migrate apply --database-name default --admin-secret xxxx , I got the error FATA[0001] cannot read config: invalid config version. So I used npm download to get v2.0.1 and it finally worked.

Thanks for your attention

I have the same problem.

yep same issue. @Shoryu-N can you elaborate on what you did to fix it? I see you said "So I used npm download to get v2.0.1" but I'm not sure I understand what you mean/did.

I'm a little confused b/c the config.yaml that's part of the download from the tutorial has just one property endpoint, which is a valid config property on v2 and v3.

I am very very lost lol.

Thanks! I am stuck and could really use the help.

Hey folks!
I see what went wrong here. From Hasura v2.0, the metadata config changed. This requires the usage of latest CLI.

You can download the latest CLI

In case the above doesn't install the latest version for whatever reason, you can manually upgrade to the latest version using the following command

hasura update-cli --version v2.0.7

At the time of writing this, the version was v2.0.7. Feel free to change this.

I have also updated the migrations and metadata directory that was part of the zip file that was getting downloaded. Unfortunately it didn't have the contents of the GitHub repo's latest files. Please re-download the migrations

Now to apply metadata and migrations, we need to execute these 3 steps.

  • hasura metadata apply
  • hasura migrate apply
  • hasura metadata reload

Hope this clarifies the issue. I have updated the instructions in this PR - #498