Skip to content

Plan data not cleaned up when PR is closed before Atlantis finishes processing #6304

@albertofp

Description

@albertofp

Atlantis version:

v0.35.0

Deployment method:

EKS / Helm (using custom helm chart which wraps the official runatlantis helm chart)

If not running the latest Atlantis version have you tried to reproduce this issue on the latest version:

No - we are running version v0.35.0. We have not yet tested with the latest version.

We run a cleanup post_workflow_hook to clean up the temporary plan data left behind in /atlantis-data/repos/ after the plan is completed:

      post_workflow_hooks:
        - run: rm -rf /tmp/$BASE_REPO_OWNER-$BASE_REPO_NAME-$PULL_NUM

Any other information you can provide about the environment/deployment:

  • Cloud provider: AWS (EKS)
  • Storage: StatefulSet with PersistentVolumeClaim (750Gi)
  • Data directory: /atlantis-data (mounted via PVC)
  • Node type: m5.8xlarge
  • Workflows used: terragrunt and helmfile

The Issue:

When a pull request is closed before Atlantis finishes processing it (either before plan completes, or after plan but before apply), the temporary plan data left behind is not cleaned up automatically. Over time, these leftover plans accumulate and fill up the disk, requiring manual intervention to clean up.

Expected Behavior:

When a PR is closed, Atlantis should clean up all associated plan data (including locks, working directories, and any cached data) regardless of whether the plan/apply cycle completed.

Current Workaround:

We manually clean up the data directory, but this is not sustainable as the volume continues to fill up.

Additional Context:

Questions:

  1. Is there a suggested workaround for this scenario while waiting for a fix?
  2. Is this something that can be tackled by the Atlantis team to ensure proper cleanup on PR closure regardless of processing state?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions