我在 Docker 容器中运行了 Hasura 实例,并且直接在机器上运行了使用 NodeJS/Express 编写的操作处理程序 API。
当我在本地测试一切正常(macOS M1),但是当我在服务器上复制相同的设置(Ubuntu 20.04)时,它会返回一个操作处理程序不存在的错误。
所有其他查询和变异都能正常工作,只有操作会返回此错误。
您可以看到 Hasura 和 NodeJS 应用程序都在运行。 Hasura Docker 容器 本地主机 API 调用 在本地开发中,我的操作处理程序基础 URL 是:
当我在本地测试一切正常(macOS M1),但是当我在服务器上复制相同的设置(Ubuntu 20.04)时,它会返回一个操作处理程序不存在的错误。
所有其他查询和变异都能正常工作,只有操作会返回此错误。
您可以看到 Hasura 和 NodeJS 应用程序都在运行。 Hasura Docker 容器 本地主机 API 调用 在本地开发中,我的操作处理程序基础 URL 是:
"并且它运行得很好。我也尝试了 http://localhost:5000/api"
这是 Hasura 动作调用返回的确切错误。
{
"errors": [
{
"extensions": {
"internal": {
"error": {
"type": "http_exception",
"message": "ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just \"host.docker.internal\", service name: Just \"5000\"): does not exist (Name or service not known)"
},
"response": null,
"request": {
"body": {
"session_variables": {
"x-hasura-role": "public"
},
"input": {
"email": "",
"password": ""
},
"action": {
"name": "login"
}
},
"url": "http://host.docker.internal:5000/api/auth/login",
"headers": []
}
},
"path": "$",
"code": "unexpected"
},
"message": "http exception when calling webhook"
}
]
}