Graphql-engine: [v1.3.0-beta.2] Cannot upgrade from v1.2.x.cli-migrations-v2

Created on 22 Jun 2020  路  6Comments  路  Source: hasura/graphql-engine

1.3.0-beta.2 now expects metadata/cron_triggers.yaml, but this file didn't exist in 1.2.x

I recommend treating it as empty if it doesn't exist otherwise you'll have a bunch of folks who can't upgrade until they manually create the missing file with [] inside.

time="2020-06-22T02:08:06Z" level=fatal msg="failed to apply metadata: cannot apply metadata on the database: cannot build cron_triggers from metadata: open /tmp/hasura-project/metadata/cron_triggers.yaml: no such file or directory"

cli bug

All 6 comments

Hey @jflambert , that's concerning. Just wanted to gather a bit more info.

  1. You upgraded your server to v1.3.0-beta.2
  2. You tried applying metadata (v1.2.2) and it failed

right?

If yes, can you after step 1, do a metadata export and then move to step 2 and see if you encounter the same error?

  1. create a docker-compose.yaml file with v1.2.2.cli-migrations-v2 (see below)
  2. force hasura-cli to 1.2.2 hasura update-cli --version v1.2.2
  3. hasura init, docker-compose-up -d, cd hasura, hasura md export, cd .., docker-compose down
  4. (optional) docker-compose up, confirm metadata gets applied in docker logs, ctrl+c
  5. Change hasura image to v1.3.0-beta.2.cli-migrations-v2
  6. docker-compose up, it'll crash because cron_triggers.yaml does not exist

sample docker-compose file

version: '3.6'
services:
  postgres:
    image: timescale/timescaledb:latest-pg12
    ports:
    - "5432:5432"
    restart: always
    volumes:
    - db_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: testdb
      POSTGRES_PASSWORD: postgrespassword
      TIMESCALEDB_TELEMETRY: "off"
  graphql-engine:
    image: hasura/graphql-engine:v1.2.2.cli-migrations-v2
    ports:
    - "8080:8080"
    depends_on:
    - "postgres"
    restart: always
    volumes:
      - ./hasura/migrations:/hasura-migrations
      - ./hasura/metadata:/hasura-metadata
    environment:
      HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/testdb
      HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
      HASURA_GRAPHQL_ENABLE_TELEMETRY: "false"
      HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
volumes:
  db_data:

Thanks @jflambert, got it. Will address this ASAP

A quick fix that worked for me is creating an empty cron_triggers.yaml file with [] as content!

Confirmed this works for me in 1.3.0-beta.3, thanks @scriptonist

Only issue is I don't see your message "metadata file for %s was not found, assuming an empty file" appearing, that must be due to my log level being inadequate?

@jflambert cool, the --log-level should be debug for that to appear.

Was this page helpful?
0 / 5 - 0 ratings