Skip to content

fix: add retry to curl downloads for transient network failures#210

Merged
bobcallaway merged 1 commit intosigstore:mainfrom
jfernandez:curl-retries
Mar 9, 2026
Merged

fix: add retry to curl downloads for transient network failures#210
bobcallaway merged 1 commit intosigstore:mainfrom
jfernandez:curl-retries

Conversation

@jfernandez
Copy link
Copy Markdown
Contributor

@jfernandez jfernandez commented Dec 13, 2025

Summary

Transient network errors during the cosign download can cause the action to fail. This is particularly problematic when the action runs after images have been pushed to a registry, resulting in unsigned images.

Add --retry 3 to all curl calls. By default, curl uses exponential backoff: it waits 1 second before the first retry, then doubles the wait time for each subsequent retry up to a maximum of 10 minutes. It also respects Retry-After headers in the response.

Closes: #209

Release Note

Added retry logic to curl downloads to handle transient network failures. Downloads now retry up to 3 times with exponential backoff.

@bobcallaway
Copy link
Copy Markdown
Member

can you rebase this please? i'll also add a couple comments (nits) in a review

Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread action.yml Outdated
@jfernandez jfernandez force-pushed the curl-retries branch 2 times, most recently from 20e661d to 7299153 Compare December 16, 2025 02:24
bobcallaway
bobcallaway previously approved these changes Dec 16, 2025
Copy link
Copy Markdown
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks looks cool

I would also add the following.

--retry-delay <seconds> - Wait time before each retry attempt
--retry-max-time <seconds> - Maximum time to spend on retries total

@jfernandez
Copy link
Copy Markdown
Contributor Author

Thanks for the review!

I dug into these. Turns out --retry-delay actually disables curl's exponential backoff (1s, 2s, 4s...) and replaces it with a fixed delay. The default backoff is better for our use case since quick retries catch brief blips while backing off helps with overloaded servers.

For --retry-max-time, with 3 retries the total wait is already ~7s, so a cap doesn't add much.

Happy to add them if you feel strongly, but I think --retry 3 on its own is the right call here.

Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread action.yml Outdated
@wanis-fahmy
Copy link
Copy Markdown

we've been also facing this issue recently, would be great to merge this PR.
Happy to contribute if needed.

@HastD
Copy link
Copy Markdown
Contributor

HastD commented Mar 7, 2026

I've also been running into some build failures due to this issue; it would be great if this PR could be merged.

Transient network errors during the cosign download can cause the
action to fail. This is particularly problematic when the action runs
after images have been pushed to a registry, resulting in unsigned
images.

Add --retry 3 to all curl calls. By default, curl uses exponential
backoff: it waits 1 second before the first retry, then doubles the
wait time for each subsequent retry up to a maximum of 10 minutes. It
also respects Retry-After headers in the response.

Closes: sigstore#209
Signed-off-by: Jose Fernandez <me@jrfernandez.com>
@jfernandez
Copy link
Copy Markdown
Contributor Author

@bobcallaway I applied your suggestions, PTAL.

@bobcallaway
Copy link
Copy Markdown
Member

@cpanato can you clear your requested change so this can merge pls?

@bobcallaway bobcallaway enabled auto-merge (squash) March 8, 2026 12:51
@Hayden-IO
Copy link
Copy Markdown
Contributor

Going to resolve @cpanato's comment so we can unblock this and cut a new release

@Hayden-IO Hayden-IO dismissed cpanato’s stale review March 9, 2026 17:22

unblocking review

@bobcallaway bobcallaway merged commit ba7bc0a into sigstore:main Mar 9, 2026
112 checks passed
renovate Bot added a commit to sdwilsh/sOS that referenced this pull request Mar 9, 2026
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/sOS that referenced this pull request Mar 13, 2026
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/sOS that referenced this pull request Mar 20, 2026
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 21, 2026
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 21, 2026
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/sOS that referenced this pull request Mar 26, 2026
##### [\`v4.1.1\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.1)

#### What's Changed

- chore: update default cosign-release to v3.0.5 in [#223](sigstore/cosign-installer#223)

**Full Changelog**: <sigstore/cosign-installer@v4.1.0...v4.1.1>

---
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 26, 2026
##### [\`v4.1.1\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.1)

#### What's Changed

- chore: update default cosign-release to v3.0.5 in [#223](sigstore/cosign-installer#223)

**Full Changelog**: <sigstore/cosign-installer@v4.1.0...v4.1.1>

---
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 26, 2026
##### [\`v4.1.1\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.1)

#### What's Changed

- chore: update default cosign-release to v3.0.5 in [#223](sigstore/cosign-installer#223)

**Full Changelog**: <sigstore/cosign-installer@v4.1.0...v4.1.1>

---
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
sdwilsh pushed a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 27, 2026
##### [\`v4.1.1\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.1)

#### What's Changed

- chore: update default cosign-release to v3.0.5 in [#223](sigstore/cosign-installer#223)

**Full Changelog**: <sigstore/cosign-installer@v4.1.0...v4.1.1>

---
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/sOS that referenced this pull request Apr 3, 2026
##### [\`v4.1.1\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.1)

#### What's Changed

- chore: update default cosign-release to v3.0.5 in [#223](sigstore/cosign-installer#223)

**Full Changelog**: <sigstore/cosign-installer@v4.1.0...v4.1.1>

---
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/sOS that referenced this pull request Apr 10, 2026
##### [\`v4.1.1\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.1)

#### What's Changed

- chore: update default cosign-release to v3.0.5 in [#223](sigstore/cosign-installer#223)

**Full Changelog**: <sigstore/cosign-installer@v4.1.0...v4.1.1>

---
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/sOS that referenced this pull request Apr 17, 2026
##### [\`v4.1.1\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.1)

#### What's Changed

- chore: update default cosign-release to v3.0.5 in [#223](sigstore/cosign-installer#223)

**Full Changelog**: <sigstore/cosign-installer@v4.1.0...v4.1.1>

---
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
renovate Bot added a commit to sdwilsh/sOS that referenced this pull request Apr 24, 2026
##### [\`v4.1.1\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.1)

#### What's Changed

- chore: update default cosign-release to v3.0.5 in [#223](sigstore/cosign-installer#223)

**Full Changelog**: <sigstore/cosign-installer@v4.1.0...v4.1.1>

---
##### [\`v4.1.0\`](https://github.com/sigstore/cosign-installer/releases/tag/v4.1.0)

#### What's Changed

We recommend updating as soon as possible as this includes bug fixes for Cosign. We also recommend removing `with: cosign-release` and strongly discourage using `cosign-release` unless you have a specific reason to use an older version of Cosign.

- Bump cosign to 3.0.5 in [#220](sigstore/cosign-installer#220)
- fix: add retry to curl downloads for transient network failures in [#210](sigstore/cosign-installer#210)

**Full Changelog**: <sigstore/cosign-installer@v4.0.0...v4.1.0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action fails on transient network errors during download

6 participants