GoogleCloudPlatform / GoogleCloudPlatform/esp-v2
POST requests with large payloads returns 500
- Dominant language
- Go
- Stars
- 307
- Forks
- 185
- Avg merge
- 14h 45m
- Merged PRs (30d)
- 6
Description
Hello! Not sure if my issue is related to ESP v2 or Cloud Run - but I think it is related to ESP - and therefore I post it here :)
We are using approach "Endpoints for Cloud Run with ESPv2" - meaning we are running ESP v2 as container in Cloud Run as API proxy in front of code that we run in Cloud Functions and other Cloud Run instances.
We experienced problems with API proxy responding with 504 gateway timeout on lots of requests.
We pinpointed the problem to a partner that sends large JSON documents - that had started to send a lot more requests than previous days. It seemed that for the large files (>15 Mb JSON) - ESP sent back 500 HTTP status code as response. And then other requests started to time out.
We tried solving the problem by removing the endpoint from Google Endpoints service configuration - so it would return 404 - but the problem was still present.
I have tested around in a separate Cloud Run instance - and have posted large JSON requests to different endpoints - and I can replicate 500 errors. And when I look at the Cloud logs - it seems that directly after 500 error is logged - ESP is starting up a new instance - leading me to believe it has crashed.
I have tried changing different option (like memory and request timeouts and disabling metrics) but nothing has helped.
I also tried enabling debug info - but I cannot see that it logged anything more about the 500 error.
I have same behaviour for both unauthenticated valid routes, authenticated valid routes (should return 401) and non existing routes (should return 404).
I have been using Visual Studio Code with plugin "humao.rest-client" to make the requests.
We use _gcr.io/endpoints-release/endpoints-runtime-serverless:2_ as base Docker image, and we run it without any arguments (ESPv2_ARGS).
Any ideas on what might be wrong (or how to continue debugging our issues) would be greatly appreciated!
Contributor guide
Research direction
Reproduce the failure with JSON payloads larger than 15 MB against the ESP v2 container image gcr.io/endpoints-release/endpoints-runtime-serverless:2, including valid, authenticated, and nonexistent routes. Start with the Cloud Run logs and the enabled debug information; no repository file or test is named. Done would require identifying why the proxy returns 500 or crashes and documenting a confirmed fix or debugging path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, google-cloud
- Domain
- api, cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100