hasura / hasura/graphql-engine

Can't set HASURA_GRAPHQL_METADATA_DATABASE_URL to the same URL as HASURA_GRAPHQL_DATABASE_URL when Updating to v2.0.9 from v1.3.2 using Docker

Open
#7,612 0 comments 1 reaction 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: updating from v1.3.2 to v.2.0.9
CLI Version (for CLI related issue): Not Related to CLI, i think

### Environment
OS: CentOS 7
running on Docker

### What is the expected behaviour?
updating to v2.0.9 by just changing the image used in docker-compose.yml and the image will take care of everything

### Keywords
Updating
Migrating
v2

### What is the current behaviour?
I am trying to update my development hasura server before trying to do it on my production server. It's running on docker using v1.3.2 image and I want to update it to v2.0.9 image

Here is the docker-compose.yml I'm using

```yaml
version: '3.6'
services:
hasura-engine:
image: hasura-graphql-engine:v2.0.9
container_name: hasura-engine
ports:
- "5001:8080"
expose:
- "8080"
environment:
HASURA_GRAPHQL_DATABASE_URL:
HASURA_GRAPHQL_METADATA_DATABASE_URL:
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_ADMIN_SECRET:
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_JWT_SECRET:
networks:
default:
ipv4_address:
networks:
default:
external:
name: docker-bridge
```

My understanding from reading the documentation is that i can just change the docker image used in docker-compose.yml and just restart the container and the image will take care of everything.

Previously, I was using a database named postgres as the database connected to the hasura server. The HASURA_GRAPHQL_DATABASE_URL is set to this database URL. After reading [this article](https://hasura.io/docs/latest/graphql/core/deployment/graphql-engine-flags/config-examples.html), I've tried
1. not setting the HASURA_GRAPHQL_METADATA_DATABASE_URL env variable
2. setting the HASURA_GRAPHQL_METADATA_DATABASE_URL to the same URL as HASURA_GRAPHQL_DATABASE_URL
3. setting the HASURA_GRAPHQL_METADATA_DATABASE_URL to different database URL than HASURA_GRAPHQL_DATABASE_URL

and only by setting it to a different database URL than HASURA_GRAPHQL_DATABASE_URL it can work and migrate my hdb_catalog schema and its tables to the newest version. the other two methods resulting in error
```
{"internal":"no connection to the server\n","path":"$","error":"connection error","code":"postgres-error"}
```

This makes me have to duplicate my current hdb_catalog from the database i was using to another database. Shouldn't I be able to just use the same database as both connected database and metadata database?

### How to reproduce the issue?

1. running hasura as a container using hasura v1.3.2 image
2. try updating by changing the image used to v2.0.9 in the docker-compose.yml
3. either not set the HASURA_GRAPHQL_METADATA_DATABASE_URL env variable or set it to the same value as HASURA_GRAPHQL_DATABASE_URL env variable
4. restart the container

### Screenshots or Screencast

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

### Any possible solutions?

### Can you identify the location in the source code where the problem exists?
No

### If the bug is confirmed, would you be willing to submit a PR?
No

Thanks for help

Contributor guide

Open the contributing guide

Research direction

Start with the docker-compose.yml configuration and reproduce the upgrade from the v1.3.2 image to v2.0.9 using the three HASURA_GRAPHQL_METADATA_DATABASE_URL configurations described. Inspect the container startup and migration output around the reported postgres-error. Done means determining whether the same database URL is supported and fixing the migration path or documenting the required upgrade configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, postgres
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.