service bridge HTTP failed error when using dev_appserver.py

huangapple go评论62阅读模式
英文:

service bridge HTTP failed error when using dev_appserver.py

问题

2023/04/16 17:27:52 错误: database.GetLocation - 服务桥接 HTTP 失败: Post "http://appengine.googleapis.internal:10001/rpc_http": dial tcp: lookup appengine.googleapis.internal: getaddrinfow: 这通常是主机名解析期间的临时错误,意味着本地服务器未从权威服务器收到响应。
2023/04/16 17:27:52 错误: 服务桥接 HTTP 失败: Post "http://appengine.googleapis.internal:10001/rpc_http": dial tcp: lookup appengine.googleapis.internal: getaddrinfow: 这通常是主机名解析期间的临时错误,意味着本地服务器未从权威服务器收到响应。
英文:

I have an appengine app that I've upgraded to Go 1.20 and the latest Google Cloud API.

It still works if I deploy it, but when I run it locally using dev_appserver.py I get this error whenever it makes an API call:

2023/04/16 17:27:52 ERROR: database.GetLocation - service bridge HTTP failed: Post "http://appengine.googleapis.internal:10001/rpc_http": dial tcp: lookup appengine.googleapis.internal: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.
2023/04/16 17:27:52 ERROR: service bridge HTTP failed: Post "http://appengine.googleapis.internal:10001/rpc_http": dial tcp: lookup appengine.googleapis.internal: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.

The static files load properly and the code runs fine up to this point. dev_appserver.py seems to be initializing OK:

INFO     2023-04-16 13:27:28,888 devappserver2.py:321] Skipping SDK update check.
INFO     2023-04-16 13:27:29,746 datastore_emulator.py:156] Starting Cloud Datastore emulator at: http://localhost:49226
INFO     2023-04-16 13:27:32,604 datastore_emulator.py:162] Cloud Datastore emulator responded after 2.858000 seconds
INFO     2023-04-16 13:27:32,605 <string>:398] Starting API server at: http://localhost:49258
INFO     2023-04-16 13:27:32,634 <string>:388] Starting gRPC API server at: http://localhost:49259
INFO     2023-04-16 13:27:32,651 instance_factory.py:184] Building with dependencies from go.mod.
INFO     2023-04-16 13:27:32,733 dispatcher.py:276] Starting module "default" running at: http://localhost:8080
INFO     2023-04-16 13:27:32,740 admin_server.py:70] Starting admin server at: http://localhost:8000
INFO     2023-04-16 13:27:39,770 instance.py:294] Instance PID: 29280

答案1

得分: 2

这是App Engine SDK的devappserver2软件中的一个错误。我已向Google提交了报告。希望这个问题能在将来的SDK版本中得到修复。

与此同时,我已经创建了一个手动补丁,似乎解决了这个问题。

编辑google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/http_runtime.py文件。大约在第90行附近,将缺少的Go运行时添加到数组中,使其看起来像这样:

# 需要虚拟机环境变量的运行时
_RUNTIMES_NEED_VM_ENV_VARS = [
    'go111',
    'go114',
    'go115',
    'go116',
    'go118',
    'go119',
    'go120',
]
英文:

This is a bug in the App Engine SDK's devappserver2 software. I have filed a report to Google. Hopefully this gets fixed in a future SDK release.

Meanwhile I have created a manual patch that seems to solve the issue for me.

Edit the google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/http_runtime.py file. At around line 90. Add the missing go runtimes to the array so that it looks like this:

# Runtimes which need
_RUNTIMES_NEED_VM_ENV_VARS = [
    'go111',
    'go114',
    'go115',
    'go116',
    'go118',
    'go119',
    'go120',
]

huangapple
  • 本文由 发表于 2023年4月17日 01:40:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76029371.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定