JerryL
JerryL

Reputation: 153

Scheduled Cloud build trigger throws 404 NOT_FOUND error

I recently created a scheduled trigger by following this google page: . But when I did a test run from Scheduler's interface, the result was a NOT_FOUND error:

{
  @type: "type.googleapis.com/google.cloud.scheduler.logging.AttemptFinished"   
  jobName: "projects/myproject/locations/australia-southeast1/jobs/trigger-schedule"   
  status: "NOT_FOUND"   
  targetType: "HTTP"   
  url: "https://cloudbuild.googleapis.com/v1/projects/myproject/triggers/ca55b01d-f4e6-4b8b-b92b-b2e4f380788c:run"   
}

I was worried about location, which is appEngine related, even there is no instances, the location shows to be in australia-southeast1, which is correct.

What could be the cause of the error? Or even what was not found? the job definition or the target?

Upvotes: 2

Views: 1426

Answers (1)

JerryL
JerryL

Reputation: 153

After running gcloud beta builds triggers run TRIGGER which is the scheduled job runs, I found the cloudbuild.yaml does not exist in the targeted branch.

First, I wish the error in the scheduler could have been more meaningful and had some details.

Second, triggers all have conditions how they are triggered. Maybe the POST HTTP call to the trigger can allow an empty body to use default condition. In my case, the condition defined in the trigger was branch = test and in my scheduled job definition was branch = master. This mismatch caused the problem.

Hope this could help others to debug scheduled triggers.

Upvotes: 3

Related Questions