ghosttie
ghosttie

Reputation: 668

service bridge HTTP failed error when using dev_appserver.py

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

Upvotes: 1

Views: 436

Answers (1)

Strom
Strom

Reputation: 382

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',
]

Upvotes: 4

Related Questions