Hasura 浏览器控制台给出错误“502 Bad Gateway”

Hasura browser console giving error "502 Bad Gateway"

我在指向 DigitalOcean 上的托管 Postgres 实例的 DigitalOcean 液滴上安装了 Hasura 运行 - 它运行良好。

但现在我正在尝试使另一个 Hasura 液滴指向该 Postgres 实例中的测试数据库。

我创建数据库没问题,按照说明设置权限 here,然后尝试将新的 Hasura 指向它,但无法进入 http://[ipaddr]/console 的 Hasura 浏览器控制台 -它说 “502 Bad Gateway”

错误日志包括这个 -

/etc/hasura# docker logs a5cff6c32cdf {"internal":"could not connect to server: Connection timed out\n\tIs the server running on host \"[dohost]\" ([ipaddr]) and accepting\n\tTCP/IP connections on port 25060?\n","path":"$","error":"connection error","code":"postgres-error"}

我可以通过 DBeaver 连接到新的测试数据库。

/etc/hasura/docker-compose.yaml 文件如下所示,按照说明 here -

version: '3.6'
services:
  #postgres:
  #  image: postgres:10.5
  #  restart: always
  #  volumes:
  #  - db_data:/var/lib/postgresql/data
  graphql-engine:
    image: hasura/graphql-engine:v1.1.0
    #depends_on:
    #- "postgres"
    restart: always
    environment:
      # database url to connect
      HASURA_GRAPHQL_DATABASE_URL: postgresql://doadmin:<password>@<dourl>:25060/testdb?sslmode=require
      # enable the console served by server
      HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set "false" to disable console
      ## uncomment next line to set an admin secret key
      # HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
    command:
    - graphql-engine 
    - serve
  caddy:
    image: abiosoft/caddy:0.11.0
    depends_on:
    - "graphql-engine"
    restart: always
    ports:
    - "80:80"
    - "443:443"
    volumes:
    - ./Caddyfile:/etc/Caddyfile
    - caddy_certs:/root/.caddy
volumes:
  # db_data:
  caddy_certs:

知道我为什么得到 502 吗?

发现问题 - 我需要将新的 Hasura 实例作为可信来源添加到 Postgres 实例。

点击数据库集群,点击编辑来源,点击可信来源编辑,然后添加 Hasura 实例名称,例如"hasura-graphql-ubuntu-s-1vcpu-1gb-nyc1-01"。