Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata failed to apply in latest hasura v2 version #540

Open
edouardouvrard opened this issue Jul 3, 2024 · 4 comments
Open

Metadata failed to apply in latest hasura v2 version #540

edouardouvrard opened this issue Jul 3, 2024 · 4 comments

Comments

@edouardouvrard
Copy link

Metadata failed to apply without explicit error

@dbarrosop
Copy link
Member

dbarrosop commented Jul 4, 2024

Hi,
thanks for the report. However, I can not reproduce, please, provide instructions on how to reproduce the issue.

Thanks

@Tchoupinax
Copy link
Contributor

Hello,

Here is the exemple to reproduce the issue

services:
  postgres:
    image: postgres:16
    restart: unless-stopped
    ports:
      - "5432:5432"
    volumes:
      - foo-dev-postgres:/var/lib/postgresql/data
    networks:
      - foo2
    environment:
      POSTGRES_PASSWORD: mysecret

  hasura:
    image: hasura/graphql-engine:v2.42.0
    restart: unless-stopped
    ports:
      - "8080:8080"
    networks:
      - foo2
    depends_on:
      - "postgres"
    environment:
      HASURA_GRAPHQL_ADMIN_INTERNAL_ERRORS: true
      HASURA_GRAPHQL_ADMIN_SECRET: secret
      HASURA_GRAPHQL_CORS_DOMAIN: "*"
      HASURA_GRAPHQL_DEV_MODE: true
      HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
      HASURA_GRAPHQL_ENABLE_CONSOLE: true
      HASURA_GRAPHQL_ENABLE_TELEMETRY: false
      HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:mysecret@postgres:5432/postgres
      PG_DATABASE_URL: postgres://postgres:mysecret@postgres:5432/postgres
      HASURA_GRAPHQL_JWT_SECRET: >-
        {"type":"HS256", "key":
        "secret"}

  hasura-auth:
    image: "nhost/hasura-auth:0.33.0-beta3"
    restart: always
    depends_on:
      - hasura
    ports:
      - "4001:4000"
    networks:
      - foo2
    environment:
      HASURA_GRAPHQL_JWT_SECRET: >-
        {"type":"HS256", "key":
        "secret"}
      HASURA_GRAPHQL_DATABASE_URL: "postgres://postgres:mysecret@postgres:5432/postgres"
      HASURA_GRAPHQL_GRAPHQL_URL: "http://hasura:8080/v1/graphql"
      HASURA_GRAPHQL_ADMIN_SECRET: "secret"

  minio:
    image: "minio/minio:RELEASE.2024-08-17T01-24-54Z"
    user: "999:1001"
    restart: always
    environment:
      MINIO_ACCESS_KEY: 5a7bdb5f42c41e0622bf61d6e08d5537
      MINIO_SECRET_KEY: 9e1c40c65a615a5b52f52aeeaf549944ec53acb1dff4a0bf01fb58e969f915c8
    entrypoint: sh
    command: -c 'mkdir -p /data/nhost && /usr/bin/minio server /data'
    ports:
      - "9000:9000"
    volumes:
      - "foo-dev-minio:/data"

networks:
  foo2:
volumes:
  foo-dev-postgres:
  foo-dev-minio:

Logs

{"level":"info","message":"Log level: info"}
{"level":"info","message":"Waiting for Hasura to be ready..."}
{"level":"info","message":"Hasura is ready"}
{"level":"info","message":"Applying SQL migrations..."}
{"level":"info","message":"SQL migrations applied"}
{"level":"info","message":"Applying metadata..."}
{"level":"warn","message":"Impossible to apply metadata"}
/nix/store/9w8fnyck8l3rbmkn53sn4cxahjnqlpvn-node_modules-prod/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-request/dist/index.js:340
                        throw new types_1.ClientError(__assign(__assign({}, errorResult), { status: response.status, headers: response.headers }), { query: query, variables: variables });
                              ^

ClientError: field 'insertAuthRoles' not found in type: 'mutation_root': {"response":{"errors":[{"message":"field 'insertAuthRoles' not found in type: 'mutation_root'","extensions":{"path":"$.selectionSet.insertAuthRoles","code":"validation-failed"}}],"status":200,"headers":{}},"request":{"query":"mutation upsertRoles($roles: [authRoles_insert_input!]!) {\n  insertAuthRoles(\n    objects: $roles\n    on_conflict: {constraint: roles_pkey, update_columns: []}\n  ) {\n    affected_rows\n    returning {\n      role\n    }\n  }\n}","variables":{"roles":[{"role":"me"},{"role":"user"}]}}}

@dbarrosop
Copy link
Member

This looks like a misconfiguration in your environment. My bet is that your metadata has conflicts.

@Tchoupinax
Copy link
Contributor

Tchoupinax commented Aug 26, 2024

Error: Source default not found

Indeed, my source is not called default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants