GoogleCloudPlatform / GoogleCloudPlatform/esp-v2

503 error when deploying to App Engine

Open
#170 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
307
Forks
185
Avg merge
14h 45m
Merged PRs (30d)
6

Description

Hi

I'm trying to deploy esp in the following configuration:

ESPv2 - `gcr.io/endpoints-release/endpoints-runtime-serverless:2.10.0` deployed to App Engine flex with env:
```
ESPv2_ARGS = "^++^--cors_preset=cors_with_regex++--cors_allow_origin_regex=...++--enable_debug"
ENDPOINTS_SERVICE_NAME = "-dot-.appspot.com"
```

Endpoints config: Copy of [sample](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/endpoints/getting-started/openapi-appengine.yaml) with these changes:
```
-host: "YOUR-PROJECT-ID.appspot.com"
+host: "-dot-.appspot.com"

- x-google-audiences: "YOUR-CLIENT-ID"
+ x-google-audiences: ""

+ auth0_jwk:
+ authorizationUrl: ""
+ flow: "implicit"
+ type: "oauth2"
+ x-google-issuer: "https://.auth0.com/"
+ x-google-jwks_uri: "https://.auth0.com/.well-known/jwks.json"
+ x-google-audiences: "https://-dot-.appspot.com/"
+
+x-google-backend:
+ address: "https://-dot-.appspot.com"
+ jwt_audience: ""
+ protocol: h2
+
+
+x-google-endpoints:
+ - name: -dot-.appspot.com
```

When I hit the ESP service with appropriate JWT token, it fails with a 503 error:
```
HTTP/2 503
date: Fri, 29 May 2020 23:15:26 GMT
content-type: text/plain
content-length: 91
server: envoy
via: 1.1 google
alt-svc: h3-27=":443"; ma=2592000,h3-25=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

upstream connect error or disconnect/reset before headers. reset reason: connection failure
```

In ESP logs, I see:
```
D0529 22:30:59.101 27 envoy] [27][connection][external/envoy/source/common/network/connection_impl.cc:504] [C21] raising immediate error
...
D0529 22:30:59.101 27 envoy] [27][router][external/envoy/source/common/router/router.cc:1018] [C19][S9973334829757176186] upstream reset: reset reason connection failure
...
D0529 22:30:59.101 27 envoy] [27][http][external/envoy/source/common/http/conn_manager_impl.cc:1475] [C19][S9973334829757176186] Sending local reply with details upstream_reset_before_response_started{connection failure}
```

In Produced API logs, I see:
```
jsonPayload: {
api_method: "1._dot__appspot_com.Echo"
api_name: "1._dot__appspot_com"
api_version: "1.0.0"
client_ip: "172.17.0.5"
http_method: "POST"
http_response_code: 503
location: "us-central1-b"
log_message: "1._dot__appspot_com.Echo is called"
producer_project_id: ""
request_latency_in_ms: 246
request_size_in_bytes: 2072
response_size_in_bytes: 183
service_agent: "ESPv2/2.10.0"
service_config_id: "2020-05-29r2"
timestamp: 1590794126.0151885
url: "/echo"
}
```

I'm not sure what's going on here or if this is an unsupported pattern of deployment, and ESP v2 *cannot* work in App Engine and has to be Cloud Run.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.