Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud Run finishes but Cloud Scheduler thinks that job has failed

I have a Cloud Run service setup and I have a Cloud Scheduler task that calls an endpoint on that service. When the task completes (http handler returns), I'm seeing the following error:

The request failed because the HTTP connection to the instance had an error.

However, the actual handler returns HTTP 200 and successfully exists. Does anyone know what this error means and under what circumstances it shows up?

I'm also attaching a screenshot of the logs.

Imgur

like image 266
Tadas Vilkeliskis Avatar asked Oct 03 '19 17:10

Tadas Vilkeliskis


People also ask

How does cloud scheduler work?

Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention.

Does Cloud Scheduler need App Engine?

This app serves as both the location of the Cloud Scheduler service and of the handler itself. If you wish to have an App Engine handler that is not in your project, you should select an HTTP target instead. In this case you do not need an App Engine app in your project.


1 Answers

Does your job take longer than 120 seconds? I was having the same issue and figured out node versions prior to 13 has 120 seconds server.timeout limit. I installed node 13 on docker and problem is gone.

like image 91
Arrrrny Avatar answered Sep 26 '22 13:09

Arrrrny