graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

mysql database: expected a catalog version <=37, but the current version is 47

Open ana-GG opened this issue 4 years ago • 5 comments

I use MySQL as database, so I followed the tutorial and got the image to run at local container:

image: hasura/graphql-engine:pull5655-633f084f

The container started failed, with the log as following:

{"type":"startup","timestamp":"2022-01-13T06:19:33.957+0000","level":"error","detail":{"kind":"catalog_migrate","info":{"path":"$","error":"Cannot use database previously used with a newer version of graphql-engine (expected a catalog version <=37, but the current version is 47).","code":"not-supported"}}}
Connected to MySQL!

I refered previous similar issues and changed graphql-engine image version to v1.3.3. Then failed again, because it didn't known the option "--mysql-host " .

What can I do ?

ana-GG avatar Jan 13 '22 06:01 ana-GG

I Changed the image to hasura/graphql-engine:v2.1.0-beta.2, but still met the error Invalid option --mysql-host'`

ana-GG avatar Jan 13 '22 08:01 ana-GG

MySQL is not supported in hasura/graphql-engine:v2.1.0-beta.2 and hence you are seeing the invalid option error.

Regarding the original error you mentioned, it seems like you are trying to run the MySQL preview build i.e. hasura/graphql-engine:pull5655-633f084f connected to PG DB that was connected to a more recent Hasura version. Thats the reason for a catalog version error. i.e. the preview is aware of metadata catalog version uptill 37 but your db has version 47. Maybe you are using the same docker-compose as you were using with a newer version?

To try out MySQL I would recommend you set up a dedicated Hasura instance by following the steps described here. Do note that the MySQL preview build does not support all the latest features of Hasura and should be used to just try out MySQL.

rikinsk avatar Jan 13 '22 15:01 rikinsk

I followed this MySQL priview tutorial when I tried to deploy it at first time and just again. Both time I deleted old graphql-engine and postgres containers as first, then deleted their images. It didn't worked. Should I change any arguments in docker-compose.yaml?

version: '3.6'
services:
  postgres:
    image: postgres:12
    restart: always
    volumes:
    - db_data:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: postgrespassword
  graphql-engine:
    image: hasura/graphql-engine:pull5655-633f084f
    ports:
    - "8080:8080"
    depends_on:
    - "postgres"
    command:
    - graphql-engine
    - --mysql-host
    - my_host
    - --mysql-user
    - my_user
    - --mysql-port
    - my_port
    - --mysql-dbname
    - my_dbname
    - --mysql-password
    - my_password
    - serve
    restart: always
    environment:
      HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres
      ## enable the console served by server
      HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
      ## enable debugging mode. It is recommended to disable this in production
      HASURA_GRAPHQL_DEV_MODE: "true"
      HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
      ## uncomment next line to set an admin secret
      HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
volumes:
  db_data:

ana-GG avatar Jan 14 '22 01:01 ana-GG

I changed the two lines in docker-compose.yaml and the container started successfully, but can't use HASURA_GRAPHQL_ADMIN_SECRET.

image: postgres:11
- db_data:/var/lib/postgresql11/data

ana-GG avatar Jan 14 '22 02:01 ana-GG

hello. The DB used by the team is mysql, so I'm going to use the hasura mysql version first.

  1. It seems that the hasura mysql version has not been updated in 2 years, is it ok to use it?
  2. For hasura mysql version, is it correct that the contents of hasura v2.x document work well?
  3. What version of hasura mysql should be used in config.yaml? v1? v2? v3?

kincjf avatar Sep 20 '22 20:09 kincjf

We recently launched our new MySQL alpha integration https://hasura.io/docs/latest/databases/mysql/index/

It has support for queries, table relationships and permissions. Support for mutations is coming soon.

Please reach out to me if you would like to be a part of the early-access slack channel where we post the latest builds and updates.

(Note: The previous version has been deprecated)

rsd1122 avatar Mar 14 '23 23:03 rsd1122