CI/CD Pipelines: Debugging and Troubleshooting/Retry flaky network operations

Wrap downloads or package installs with bounded retries.

Section: Frequent CI/CD problems and fixes

Retry flaky network operations

bash
bash
for i in 1 2 3; do
  npm ci && break
  sleep 5
done
Explanation

Transient network failures are common in CI. Retry carefully, but do not hide deterministic failures.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Frequent CI/CD problems and fixes
Missing secrets or permissions
Fail early when credentials or roles are unavailable.
OpenIn sheetbashsame section
Use strict shell mode in scripts
Stop on errors and unset variables.
OpenIn sheetbashsame section
Cancel outdated duplicate runs
Keep only the latest run active for a branch or PR.
OpenIn sheetyamlsame section
Enable GitHub Actions step debug logging
Turn on runner debug logs for detailed troubleshooting.
Inspect GitLab job traces
Review the full job log and artifacts from failed jobs.
Replay Jenkins pipeline with edits
Retry a failed Jenkins pipeline with small script adjustments.