Repository navigation
Retry CapRover operations while the server is busy - #18
Open
robertherber wants to merge 1 commit into
Open
robertherber wants to merge 1 commit into
robertherber wants to merge 1 commit into
Conversation
CapRover handles one operation at a time and rejects others ('Another
operation is in process for Certbot', 'system not ready yet', 'currently
in a building process'). The setup action's SSL step failed on this for
~1 in 4 PR deploys in lifeline, and deploys failed when they overlapped.
Add scripts/caprover-retry.sh (backoff with jitter, only on busy errors)
and use it for every CapRover call in caprover-setup and caprover-deploy.
Registering an app that already exists now counts as success instead of
ignoring every error with '|| true'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CapRover handles one operation at a time and rejects concurrent ones. In
kingstinct/lifeline, 23 of the last 100 Healthcloud - Deploy PR runs failed, most incaprover-setup's Enable SSL step:Deploys that overlap fail with
healthcloud app is currently in a building process.The register step used
|| true, so its "App Name already exists" errors (expected when setup re-runs after a failed SSL step) were ignored, along with every other error.Change
scripts/caprover-retry.sh <command…>:Another operation is in process,not ready yet,currently in a building process,Too many requests), up to 8 attempts with backoff plus jitter.CAPROVER_RETRY_OKis an extended regex of errors that count as success.::error::.caprover-setup: register, update and enable-SSL go through it. Register setsCAPROVER_RETRY_OK: App Name already exists, replacing the blanket|| true.caprover-deploy:caprover deploygoes through it.${{ github.action_path }}/../../scripts/. Remote actions get the whole repository checked out, so the path resolves for callers too.Verified
actionlintandshellcheckpass. The YAML parses, with the step lists unchanged.CAPROVER_RETRY_OK: okAfter merging
Callers pin these actions by SHA (lifeline uses
2f1c0a4…), so they need a bump to pick this up. I'll open that PR in lifeline.🤖 Generated with Claude Code