Azure DevOps pipeline jobs failing to start

The Issue

Whilst migrating some Azure DevOps classic pipelines to templated multi-stage YAML, I hit a problem that a job running on a self-hosted agent would not start.

The YAML stage, which required approval, would be queued and approved, but the agent would just sit there with the message Starting job but would never start. The strange thing was even though the job was not started, the pipeline instantly showed as failed with no error message.

The Solution

After much fiddling, as there was no diagnostic information in the logs, I found the issue was a YAML syntax error, I had made an error that not want picked up at queue time or run time.

I had written in a template file

- download: self

When it should have been

- download: current

Once I fixed this the jobs started as expected. I am not sure why this issue did not give a clearer error message, but hope this post save someone else a bit of time.