Tortoise: Interactive System Configuration Repair

Aaron Weiss, Arjun Guha, Yuriy Brun · DOI

Abstract

Modern infrastructure management relies on declarative configuration languages like Puppet to maintain system state. However, when systems fail, administrators often resort to manual shell commands for quick fixes, leading to "configuration drift" where the manifest no longer reflects the actual system state. Tortoise addresses this by treating imperative shell commands as a partial specification for repairing the declarative manifest. Using program synthesis and SMT solvers, Tortoise generates maintainable patches that align the manifest with the manual fixes.

Introduction

Declarative configuration tools are powerful but can become "leaky abstractions." When a configuration error occurs, debugging the manifest can be slower than applying a direct fix via the command line. This creates a dilemma: the speed of the shell versus the long-term stability of the manifest. If the manifest is not updated, subsequent configuration runs may overwrite the manual fix, reverting the system to a broken state. Tortoise resolves this by automating the process of "imperative configuration repair," ensuring that manual interventions are correctly reflected in the source of truth.

System Architecture

The Tortoise workflow begins by observing an administrator's actions in the shell. Using ptrace, the tool records system calls and file system changes. These observations, along with the original buggy manifest, are translated into an intermediate imperative language called $\Delta P$.

Tortoise system architecture overview

The core of Tortoise is a constraint-based synthesis engine. It treats shell updates as hard constraints—the final state must match these changes—and the original manifest as soft constraints, aiming to minimize the syntactic distance of the repair. This model is converted into logical formulae for the Z3-str SMT solver. Through Counterexample-Guided Inductive Synthesis (CEGIS), Tortoise finds potential patches and ranks them based on simplicity and their ability to generalize across Puppet's abstractions (e.g., updating a "defined type" rather than a single instance).

Evaluation

The authors evaluated Tortoise using 13 real-world Puppet manifests (e.g., nginx, ntp, logstash) and 42 distinct repair scenarios involving permissions, file renaming, and package updates.

Performance and accuracy metrics across benchmarks

The results demonstrate that Tortoise is both accurate and efficient. In 76% of cases, the top-ranked repair was the correct one, and the correct repair appeared in the top five suggestions 100% of the time. On average, the human-equivalent repair was ranked at 1.31. Performance-wise, Tortoise is highly interactive, with an average runtime of just 205 ms. Even for large manifests with 250 resources, synthesis completes in under 1.5 seconds.

Key Insights

  • The Shell as Specification: Manual shell commands are not just "hacks"; they represent expert knowledge that can be leveraged as a formal specification for repair.
  • Abstraction-Awareness: By understanding Puppet's internal structures, Tortoise can suggest patches to templates or custom types, ensuring fixes are applied consistently across the infrastructure.
  • Performance via Optimization: By narrowing the search space to only affected variables, Tortoise achieves the millisecond-level latency required for an interactive tool.

Conclusion and Future Work

Tortoise effectively bridges the gap between imperative actions and declarative state. While currently focused on files, packages, and users, future iterations could expand to support service management and more complex language features like inheritance. Despite these limitations, Tortoise provides a robust solution to configuration drift, allowing administrators to use the tools they know best without sacrificing manifest integrity.

Summary updated

BibTeX
@inproceedings{weiss2017tortoise,
  author = {Aaron Weiss and Arjun Guha and Yuriy Brun},
  title = {{Tortoise: Interactive System Configuration Repair}},
  booktitle = {ASE},
  year = {2017},
  doi = {10.1109/ase.2017.8115673},
}
Figure