Skip to content

fix(docker): retry devcontainer builds on transient failures - #781

Draft
skevetter wants to merge 2 commits into
mainfrom
gigantic-hound
Draft

fix(docker): retry devcontainer builds on transient failures#781
skevetter wants to merge 2 commits into
mainfrom
gigantic-hound

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

Devcontainer builds intermittently fail when a feature install downloads a release binary inside the build (via nanolayer) and the transfer is truncated mid-stream (http.client.IncompleteRead). This surfaces as a bare failed to solve ... exit code: 1 and fails the whole build.

Because the build is BuildKit-cached, a retry only replays the failed step. executeBuild now retries with exponential backoff (one initial attempt + two retries), tee-ing the build output into a bounded buffer so the transient signal can be read from the log stream — the returned error alone is opaque.

The text matching is confined to classifyBuildError, which wraps a matched failure in a named errTransientBuild sentinel so callers decide via errors.Is instead of re-scanning strings. Context cancellation is never treated as transient. The pattern list starts narrow (incompleteread) and is a one-line change to extend.

Notes

The root cause of the truncation is a network-layer issue between the build environment and GitHub's release CDN, not Devsy code — Devsy is not in the byte path of these downloads. This change is app-level resilience for that flaky path; pinning/pre-baking these tools would remove the dependency entirely and could be a follow-up.

Feature installs that download release binaries inside the build (via
nanolayer) can fail with a truncated download (http.client.IncompleteRead),
failing the whole devcontainer build. Since the build is BuildKit-cached,
retrying only replays the failed step.

executeBuild now retries with exponential backoff, tee-ing the build output
into a bounded buffer so the transient signal can be detected from the log
stream. The text match is confined to classifyBuildError, which wraps matches
in a named errTransientBuild sentinel so callers decide via errors.Is.
@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 257d73d
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a67793797a3490008f1a85c

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@skevetter, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 15 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b67fec4b-04e1-4af2-89fc-ab52ed006c7c

📥 Commits

Reviewing files that changed from the base of the PR and between 835efa8 and 257d73d.

📒 Files selected for processing (3)
  • pkg/driver/docker/build.go
  • pkg/driver/docker/build_retry.go
  • pkg/driver/docker/build_retry_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 257d73d
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a677937c8a97a000851b392

@skevetter
skevetter marked this pull request as ready for review July 27, 2026 16:26
@skevetter
skevetter marked this pull request as draft July 27, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant