hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.08k stars 2.77k forks source link

Auto-apply migrations/metadata version breaks the app for cli-migrations-v3 #10050

Open tbtrung-1768 opened 9 months ago

tbtrung-1768 commented 9 months ago

Version Information

Server Version: CLI Version (for CLI related issue): hasura/graphql-engine:v2.33.2.cli-migrations-v3

Environment

What is the current behaviour?

I am trying to auto-apply migrations/metadata , so when a new PR is open it will set a new postgresql db for the app and then the migration should run before start the server

here is the code I'm trying for the Dockerfile

COPY hasura/metadata /hasura-metadata
COPY hasura/migrations /hasura-migrations

CMD graphql-engine \
  --metadata-database-url $HASURA_GRAPHQL_METADATA_DATABASE_URL \
    serve

But when i start function not migration. If i remove COPY hasura/metadata /hasura-metadata migrations migrate function into database success. I don't know why. When i research it same issue https://github.com/hasura/graphql-engine/issues/5172 but when i add HASURA_GRAPHQL_CLI_ENVIRONMENT=default It not resolve for me. Please help?

soorajshankar commented 9 months ago

Hey @tbtrung-1768, Thats sad to know! could you share some detailed error message (after removing any sensitive information) here so that our team can look further?

Also is this reproducible manually when you apply migrations & metadata manually with CLI command locally on a fresh postgres instance?