I’m new to using Google Cloud Run (GCR) and facing an issue where my application hosted on GCR (app1) is unable to receive a response from a service hosted on Google Kubernetes Engine (GKE, app2), despite logs on GKE showing a successful handling of requests with a 200 status code.
Issue Description
- App1 (GCR): Sends a GET request to App2 (GKE), using its external ip.
- App2 responds with a 200 status code, as confirmed by GKE logs. But it seems that the response never delivered back.
- App1 waits for 30 seconds and then times out with a 503 error, indicating a “malformed HTTP response or connection error”
Steps Taken
- Deployed App1 on GKE where it successfully sends requests and receives responses. It works locally as well. We will use this version if we can’t deal with GCR. But i really want to understand what is the problem with GCR.
- Changed the Gunicorn timeout setting from the default 30 seconds to 1 and 3 minutes. And app is getting silent fot the 1m,3m and then gets 503 error again.
- Added logging to App1:
logger.info(f'App is ready to send GET request to {app_url}') response = requests.get(app_url, headers=headers) logger.info(f'GET request sent to {app_url}')
App1 on GCR logs only “App is ready to send GET request” and nothing thereafter.
App1 on GKE logs the receipt and response to the request.
Honestly, i don’t have any ideas whats going wrong with GCR app and how to debug it. Will be grateful for your ideas and help.
Anastasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.