hasura / hasura/graphql-engine
"error":"key \"sources\" not found"
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: hasura/graphql-engine:v2.2.0.cli-migrations-v3
CLI Version (for CLI related issue): v2.2.0
### Environment
MAC 12.0.1
Ubuntu 20.04
### What is the expected behaviour?
Migrate new changes in the server.
I have been following [docs](https://hasura.io/docs/latest/graphql/core/migrations/migrations-setup.html#introduction) to automate the migration. However the container constantly throws an error:
```
{
"error":{
"path":"$.args.metadata",
"error":"key \"sources\" not found",
"code":"parse-failed"
},
}
```
I have followd the issues in #6813, but the solution doesnot work.
### Keywords
### What is the current behaviour?
The container gives constant error when trying to start the server.
### How to reproduce the issue?
I followed the hasura documentation for the migrations.
1. Create a new table from console
2. Commit all the changes to the github
3. Git pull from another computer.
4. Try docker-compose up -d
```
version: '3.6'
services:
postgres:
image: postgres:13
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: test
POSTGRES_PASSWORD: password
POSTGRES_DB: database
graphql-engine:
image: hasura/graphql-engine:v2.2.0.cli-migrations-v3
ports:
- "8080:8080"
# extra_hosts:
# - "host.docker.internal:host-gateway"
depends_on:
- "postgres"
restart: always
volumes:
- ./hasura/migrations:/hasura-migrations
- ./hasura/metadata:/hasura-metadata
environment:
## postgres database to store Hasura metadata
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://test:password@postgres:5432/database
## this env var can be used to add the above postgres database to Hasura as a data source. this can be removed/updated based on your needs
PG_DATABASE_URL: postgres://test:password@postgres:5432/database
## 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: ######
volumes:
db_data:
```
### Screenshots or Screencast

### Please provide any traces or logs that could help here.
{"type":"http-log","timestamp":"2022-02-16T21:59:17.351+0000","level":"error","detail":{"operation":{"user_vars":{"x-hasura-role":"admin"},"error":{"path":"$.args.metadata","error":"key \"sources\" not found","code":"parse-failed"},"request_id":"efd55fd4-ae2e-43a8-a847-003b9934fe8f","response_size":84,"request_mode":"error","raw_query":"{\"type\":\"replace_metadata\",\"version\":2,\"args\":{\"allow_inconsistent_metadata\":true,\"metadata\":{\"version\":3}}}\n"},"request_id":"efd55fd4-ae2e-43a8-a847-003b9934fe8f","http_info":{"status":400,"http_version":"HTTP/1.1","url":"/v1/metadata","ip":"127.0.0.1","method":"POST","content_encoding":null}}}
time="2022-02-16T21:59:18Z" level=fatal msg="error applying metadata \n{\n \"path\": \"$.args.metadata\",\n \"error\": \"key \\\"sources\\\" not found\",\n \"code\": \"parse-failed\"\n}"
Contributor guide
Assessment
This issue has not been assessed yet.