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

Run terraform state push errored.tfstate? #2203

Closed
tekumara opened this issue Apr 17, 2022 · 4 comments
Closed

Run terraform state push errored.tfstate? #2203

tekumara opened this issue Apr 17, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@tekumara
Copy link

Error: Failed to save state

Error saving state: failed to upload state: AccessDenied: Access Denied
	status code: 403, request id: A8A5HHQMAGC44Z8W, host id:
jnGpHDmJhQI2GQ8emETx6vSbf1Uh5p88Z0Plbn+hWFT/nM26n519HhA4x0V3WMol6XuLfpyaxVk=

Error: Failed to persist state to backend

The error shown above has prevented Terraform from writing the updated state
to the configured backend. To allow for recovery, the state has been written
to the file "errored.tfstate" in the current working directory.

Running "terraform apply" again at this point will create a forked state,
making it harder to recover.

To retry writing this state, use the following command:
    terraform state push errored.tfstate

Is it possible to recover from this via atlantis PR commands?

@tekumara tekumara added the bug Something isn't working label Apr 17, 2022
@jamengual
Copy link
Contributor

this is a terrafrom issue not atlantis, closing.

@bilbof
Copy link

bilbof commented Oct 2, 2022

FWIW this is the related feature request #273. Currently Atlantis doesn't support recovering from this error. If your Atlantis runner has persistent storage you could grab the errored.tfstate file and run tf state push locally

@tekumara
Copy link
Author

tekumara commented Oct 3, 2022

Thank @bilbof for highlighting this! Exposing the state command via atlantis would solve this for us, as we don't have direct access to the atlantis runner (it's owned by another team).

@tekumara
Copy link
Author

Ran into this again, it looks like atlantis state rm is supported by #273 but not yet atlantis state push 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants