Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How can I figure out why a task failed on Google batch?

 

I have 4 tasks failed. Using the command:

gcloud beta batch tasks list --job [JOB_NAME] --project [PROJECT_NAME] --location [LOCATION] --page-size 500

I can get a list of the tasks. Then, to filter for the logs of a specific task:

Name="projects/[PROJECT_NAME]/logs/batch_task_logs" labels.task_id="[TASK_ID]" timestamp>="[TIMESTAMP]" severity>=DEFAULT

However, while this gives me the stdout/stderr of a specific task, I don't see why the task failed. I'm guessing the task failed for a reason--like--out of memory, or maybe (since the tasks are running on spot instances), the host instance got killed. Not sure, but just looking at the process's stderr/stdout won't be sufficient. How can I view the complete logs for the task, so I can figure out why it failed?

2 5 672