Unable to set limit to retry step in pipeline

Hello,

Im trying to implement a automatic retry on failed steps in our pipeline but have been getting errors on the way the limit is set. My syntax is below:

retry:
  automatic: true
    limit: 3

result:
mapping values are not allowed in this context on line ( limit: 3)

I have since removed the limit line and my pipelines now only contain the below:

retry:
  automatic: true

I was expecting this to continue to retry until manually stopped but it seems to only try 3 times which is what i originally wanted. Is there a default limit set somewhere? And how can i set my limit as part of the pipeline if id like some steps to attempt more then 3 times?

Thanks

Hi @Kelklrkl ,

Welcome to the Buildkite Community! :wave:

The default retry limit is 3, so you were lucky on that! :grin:

But when you specify the limit on a retry, you would need to specify the exit status:

- label: "Tests"
    command: "tests.sh"
    retry:
      automatic:
        - exit_status: 5
          limit: 2

You can read more about that here.

Cheers!

1 Like

Hi @lizette

Thanks for your reply, I tried to add the exit_status but each run may produce a different exit status, so I cant use just one exit_status.

Ive tried leaving it blank such as the below:

    retry:
      automatic:
        - exit_status: 
          limit: 2

But this didnt trigger a retry on pipeline failures.

On which exit code is being checked when the below is run?

    retry:
      automatic: true

With the exception of not being able to specify a limit, the above behaves exactly how id like.

Many thanks

Hey @Kelklrkl!

This:

   retry:
      automatic: true

Is equivalent to:

    retry:
      automatic:
        - exit_status: "*"
          limit: 3

Best!