postgresql - Hassura 容器未连接到在 localhost 上运行的 postgres
问题描述
我尝试使用以下命令在 mac 上运行 Hasura docker 容器:-
docker run -d -p 8080:8080 \
-e HASURA_GRAPHQL_DATABASE_URL=postgres://username:password@host.docker.internal:5432/dbname \
-e HASURA_GRAPHQL_ENABLE_CONSOLE=true \
hasura/graphql-engine:latest
容器退出并出现以下错误
{"type":"pg-client","timestamp":"2020-06-17T06:09:42.825+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(0)."}}
{"type":"pg-client","timestamp":"2020-06-17T06:09:42.825+0000","level":"warn","detail":{"message":"postgres connection failed, retrying(1)."}}
{"type":"startup","timestamp":"2020-06-17T06:09:42.825+0000","level":"error","detail":{"kind":"db_migrate","info":{"internal":"no connection to the server\n","path":"$","error":"connection error","code":"postgres-error"}}}
但最初我得到了与权限相关的错误用户没有权限创建 pgcrypto 扩展,那时它会连接到 Postgres 权限。
启用 pgcrypto 扩展后,它无法连接到 Postgres。
解决方案
推荐阅读
- javascript - React JS获取数组中数字的总和
- html - Google Apps 脚本 HTML 服务功能未运行 onclick
- flutter - 缺少 InheritedWidget.updateShouldNotify 的具体实现
- postgis - Postgis 得到一个最小面积的多边形,它将覆盖所有定义的多边形
- php - 为什么 htaccess 重定向到 https://example.com/index.php 而不是特定的子 URL?
- ios - 在 ios 上使用 XMLHttpRequest 获取本地路径 uri 时出现随机网络请求失败错误
- apache-spark - 从 spark 工作节点写入 databricks 表
- python - 过滤 int、float in list、Python
- python-3.x - PackagesNotFoundError:当前频道不提供以下软件包:- ipython-notebook
- python - 如何检查一个值是否存在于列表中,并将包含它的元素存储在变量中