Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean all data on restart #5287

Closed
hirenko-v opened this issue Jan 31, 2025 · 6 comments
Closed

Clean all data on restart #5287

hirenko-v opened this issue Jan 31, 2025 · 6 comments

Comments

@hirenko-v
Copy link

Is that an expected behavior that Atlantis loses all data (plans on web page, projects locks) after restart?
We deploy it to Kubenretes with persistent volume. I see atlantis.db file and repos folder in data dir not are re-created after restart but locks and plan details are gone.

@hirenko-v hirenko-v added the bug Something isn't working label Jan 31, 2025
Copy link

dosubot bot commented Jan 31, 2025

Привіт @hirenko-v! Я тут, щоб допомогти тобі з усіма питаннями та багами щодо Atlantis. Чекай, поки людина візьметься за твою проблему.

Atlantis should not lose all data, such as plans and project locks, after a restart if it is correctly configured with a persistent volume. The atlantis.db file and repos folder are crucial for maintaining state. The atlantis.db file stores locks and pull request statuses, while the repos folder contains checked-out repositories [1].

If these are not being re-created or if data is lost, it might indicate an issue with how the persistent volume is set up or mounted. Ensure that the persistent volume is correctly configured and mounted to the /atlantis path in the container. Using a Kubernetes StatefulSet with a persistent volume is recommended to maintain data across restarts [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@hirenko-v hirenko-v changed the title Clean all date on restart Clean all data on restart Jan 31, 2025
@X-Guardian X-Guardian removed the bug Something isn't working label Feb 1, 2025
@X-Guardian
Copy link
Contributor

Hi @hirenko-v, locks are stored in atlantis.db if you are using the default BoltDB database, so will remain as long as you are persisting the database. Plan detail results are held in memory though, so will be lost after restart.

@hirenko-v
Copy link
Author

Thanks for clarifying that, @X-Guardian. But why can't I see locks details on Atlantis ui after the restart?
Also is it somehow possible to persist plan results as well?

@X-Guardian
Copy link
Contributor

Regarding the locks you obviously aren't persisting the database volume correctly, as it definitely works.
Persisting plan results would require a major code change to implement. Happy to accept community PRs for this.

@hirenko-v
Copy link
Author

@X-Guardian not sure what could go wrong with locks
I have

        volumeMounts:
        - mountPath: /atlantis-data
          name: atlantis-data

and

        env:
        - name: ATLANTIS_DATA_DIR
          value: /atlantis-data

set in atlantis sts manifest.

Also, as I said, database file is not re-created after restart...

@X-Guardian
Copy link
Contributor

I suggest you ask a question in the Atlantis Slack channel regarding how to configure this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants