这是indexloc提供的服务,不要输入任何密码
Skip to content

Error applying metadata in CI, key "sources" not found #8280

@greg-prospyr

Description

@greg-prospyr

Version Information

Server Version:
CLI Version (for CLI related issue): v2.3.0

Environment

Cloud (Github Actions) on ubuntu-latest

What is the expected behaviour?

I would like to be able to be able to apply metadata to a graphql-engine instance running CI

Keywords

hasura apply metadata, key "sources" not found, "cannot get config information from server, this might be because config API is not enabled: error unmarshalling fetching server config"

What is the current behaviour?

When I run hasura metadata apply --skip-update-check --endpoint http://localhost:5001 --admin-secret secret as a step in my Github actions CI process, I receive this error: {"fields.time":"640.255729ms","isError":true,"level":"debug","msg":"telemetry: beamed","time":"2022-03-04T20:36:01Z"} time="2022-03-04T20:36:01Z" level=fatal msg="error applying metadata \n{\n \"path\": \"$.args.metadata\",\n \"error\": \"key \\\"sources\\\" not found\",\n \"code\": \"parse-failed\"\n}"

Whats bizarre is that the migrations apply successfully, so I know the engine is up and running & configured

Screenshots or Screencast

Screen Shot 2022-03-04 at 2 45 40 PM

Screen Shot 2022-03-04 at 2 50 04 PM

Please provide any traces or logs that could help here.

This is my github action (minus envs):

on: [pull_request]

jobs:
  end-to-end:
    runs-on: ubuntu-latest

    services:
      postgres:
        image: postgres:12.1
        env:
          POSTGRES_USER: postgres
          POSTGRES_DB: postgres
        ports:
          # will assign a random free host port
          - 5432:5432
        # needed because the postgres container does not provide a healthcheck
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
      hasura:
        image: hasura/graphql-engine:v2.3.0
        env:
          HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres
          HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres
          PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres
          HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
          HASURA_GRAPHQL_DEV_MODE: "true"
          HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
          HASURA_GRAPHQL_AUTH_HOOK: "http://localhost:3003/auth/webhook"
          ACTION_BASE_URL: "http://localhost:3003"
          ACTION_REMOTE_SCHEMA_URL: "http://localhost:3004"
          EVENT_TRIGGER_URL: "http://localhost:3003/events"
          HASURA_GRAPHQL_ADMIN_SECRET: secret
        ports:
          - 5001:8080

    environment: staging
    env:
      NODE_ENV: test
    steps:
      - uses: actions/checkout@v2
      - name: Install hasura cli
        run: curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | VERSION=v2.3.0 bash
      - name: Make envfile (action-service)
        uses: SpicyPizza/create-envfile@v1.3
        with:
          envkey_NODE_ENV: test
          directory: services/action-service
          file_name: .env
          fail_on_empty: false
      - name: Make envfile (gql-action-service)
        uses: SpicyPizza/create-envfile@v1.3
        with:
          envkey_NODE_ENV: test
          envkey_PORT: 3004
          directory: services/gql-action-service
          file_name: .env
          fail_on_empty: false
      - name: Make envfile (webapp)
        uses: SpicyPizza/create-envfile@v1.3
        with:
          directory: ./webapp/apps/webapp
          file_name: .env
          fail_on_empty: false
      - name: Install Tilt
        run: curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash

      - name: Run Tilt
        run: |
          tilt ci -f Tiltfile.ci.test

      - name: migrate to the latest version of the database
        run: |
          cd hasura
          hasura migrate apply --skip-update-check --all-databases --endpoint http://localhost:5001 --admin-secret secret

      - name: apply metadata
        run: |
          cd hasura
          hasura metadata apply --skip-update-check --endpoint http://localhost:5001 --admin-secret secret --log-level DEBUG

      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: 16.x

      - uses: c-hive/gha-yarn-cache@v1

      - name: Install dependencies
        working-directory: ./webapp
        run: yarn install

      - name: Build
        working-directory: ./webapp
        run: yarn build

      - name: test
        working-directory: ./webapp
        run: nx e2e webapp-e2e

Thank you in advance for any help, I am really at my wit's end here!

Metadata

Metadata

Assignees

No one assigned

    Labels

    c/cliRelated to CLIk/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions