hasura / hasura/graphql-engine

key "tables" not found

Open
#10,089 0 comments 1 reaction 0 assignees View on GitHub
c/cli k/bug v2
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version:
CLI Version (for CLI related issue): 2.16.1

### Environment

OSS

### What is the current behaviour?

I'm currently using hasura/graphql-engine:v2.16.1.cli-migrations-v2 in production with one database and wanted to have multiple databases.
From the docs I understood that I needed to upgrade to config v3 and I did.
I ran hasura scripts update-project-v3 and it finished successfully and created the databases directory structure.
I then went and added another database to the databases.yaml and its relevant files according to the structure.
I replaced the docker image to hasura/graphql-engine:v2.16.1.cli-migrations-v3 and started.

I ran into this error level=fatal msg="error applying metadata \n{\n "code": "parse-failed",\n "error": "key \"tables\" not found",\n "path": "$.args.metadata"\n}"

I can't seem to understand what I did wrong.
How can I see more logs?
How can I know what I did wrong?

databases.yaml

```
- name: accounts
kind: postgres
configuration:
connection_info:
use_prepared_statements: true
database_url:
from_env: ACCOUNTS_DATABASE_URL
isolation_level: read-committed
pool_settings:
connection_lifetime: 60
idle_timeout: 180
max_connections: 50
retries: 1
tables: '!include accounts/tables/tables.yaml'
functions: '!include accounts/functions/functions.yaml'
- name: default
kind: postgres
configuration:
connection_info:
use_prepared_statements: true
database_url:
from_env: MAIN_DATABASE_URL
isolation_level: read-committed
pool_settings:
connection_lifetime: 60
idle_timeout: 180
max_connections: 50
retries: 1
tables: '!include default/tables/tables.yaml'
functions: '!include default/functions/functions.yaml'

```

### What is the expected behaviour?

The expected behavior is for the server to start successfully and to see 2 databases in the data manager view.

### How to reproduce the issue?

1. Start project with config v2 using hasura/graphql-engine:v2.16.1.cli-migrations-v2
2. run `hasura scripts update-project-v3`
3. replace image to hasura/graphql-engine:v2.16.1.cli-migrations-v3
4. update databases.yaml and add another database
5. add relevant files to databases dir

### Screenshots or Screencast

![image](https://github.com/hasura/graphql-engine/assets/2952388/4b22a01e-c8c1-4529-8c88-64491ce3c664)

### Please provide any traces or logs that could help here.

### Any possible solutions/workarounds you're aware of?

no

### Keywords

config v3, tables not found, upgrade

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.