Retryable provisioners re-run non-idempotent steps without deduplication
0 reputation · 04 Oct 2026, 14:46 UTC
Background
Vagrant's retryable option for provisioners (since 2.2) re-executes a provisioner on failure, but the framework does not wrap the run in a transaction or provide an on_retry hook. This means any provisioner that writes files, modifies databases, or calls external APIs can perform the same mutations twice when a transient error triggers a retry.
Constraints
The documentation advises making scripts idempotent or using configuration-management agents, yet there is no built-in mechanism to snapshot state or suppress duplicate side-effects. Similarly, rsync-auto retries interrupted transfers via its file-system watcher, which can leave partially written files that are then rewritten, producing duplicated content. The codebase has an open design question about adding a generic retry hook, but no implementation exists.
Questions
- Is there a recommended pattern for making arbitrary shell or script provisioners safe under retry without external configuration-management tools?
- Can
rsync-autobe configured to verify file integrity before retrying a write, or does the watcher always re-send the entire file? - Has the proposed
on_retryhook been scheduled for a future release, or is the current guidance to avoidretryablefor non-idempotent workloads?