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

Creating job failed Unknown error (code: 400)

Hi!

Please help me understand why I receive an Unknown error when I create a scheduled trigger to execute the Cloud Run job on schedule.

 

I received the message after selecting the frequency and service account: Creating job ..... failed Unknown error (code: 400)

Solved Solved
0 4 1,472
1 ACCEPTED SOLUTION

If you're creating the trigger on the Cloud Run page, try creating it directly in Cloud Scheduler. 

https://cloud.google.com/run/docs/execute/jobs-on-schedule

View solution in original post

4 REPLIES 4

If you're creating the trigger on the Cloud Run page, try creating it directly in Cloud Scheduler. 

https://cloud.google.com/run/docs/execute/jobs-on-schedule

Hi Knet!
I hope you are doing ok!

Thank you for the reply!
I hope with your help, we will be able to solve the issue.

Cloud Scheduler could be a solution but only for Cloud Run services, where there is Web service listening on the port. But our nighty job runs in a command line, and there is no HTTP service listening for requests. 

And with Cloud Scheduler, there are only several options to run the job:

HTTP invoke
Workflow
Pub/Sub

But we have Cloud Run Jobs, and there is no option to trigger from Cloud Scheduler.

Can you help me to solve that issue? 

P.S. Maybe you have some ideas about what happened with Cloud Run Job trigger? Why do I see the 400 error? (I've checked with two different clients with different accounts and everywhere I got that 400 error)

Hi Knet!

I'm sorry for the fast reply. After rechecking the documentation, I've found that running Cloud Run Job through the Cloud Scheduler is possible.
Now it works.
Thank you very much.

If anyone is interested in a solution:

-) Go to the link above.
-) Note that you should use HTTP invoker
-) Use the link

https://REGION-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/PROJECT-ID/jobs/JOB-NAME:run

as the link to run your job. And don't forget to replace the region, project, and job name with your values

P.S. I hope you will be able to solve the Cloud Run Job trigger issue in the future.

I'm glad it worked for you!

The Scheduler Trigger flow that's inlined in the Cloud Run UI indeed has an issue with it at the moment, but it should be fixed very soon. Then you won't need these complicated instructions 🙂