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

Incorrectly removing resource state from state file on http error #68

Open
michaeldu93 opened this issue Feb 18, 2025 · 0 comments · May be fixed by #69
Open

Incorrectly removing resource state from state file on http error #68

michaeldu93 opened this issue Feb 18, 2025 · 0 comments · May be fixed by #69

Comments

@michaeldu93
Copy link

Hi, I have raised a PR here to address this issue, can you have a look please?
#67

Description

  • HTTP error other than 404 will cause terraform to remove the resource state from the state file after this change has been merged
  • The status code for 404, connection reset, connection timeout are all 0
    • For Example
2025-02-17T15:15:47.984Z [WARN]  provider.terraform-provider-synthetics: Synthetics API error. Retrying. Attempt 122510 Get "https://api.eu0.signalfx.com/v2/synthetics/tests/browser/22510": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 0 0: timestamp=2025-02-17T15:15:47.984Z
  • This means that when the request times out or the connection reset etc, the state will be removed and it will try and create it with the resource already there, ending up with
    Error: Status Code: 422 Unprocessable Entity
    Response: {"message":"Could not create Browser Test","details":{"name":["has already been taken"]}}
  • The error message of a 404 is also not matching correctly, it's currently using an absolute match with Status Code: 404 Not Found but the error message is actually (on two lines)
    Status Code: 404 Not Found
    Response: {"message":"Record not found"}
  • For Example
2025-02-17T14:42:54.186Z [WARN]  provider.terraform-provider-synthetics: Synthetics API error. Retrying. 22455 Status Code: 404 Not Found
Response: {"message":"Record not found"} 0 0: timestamp=2025-02-17T14:42:54.186Z
@Pajk Pajk linked a pull request Feb 18, 2025 that will close this issue
4 tasks
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

Successfully merging a pull request may close this issue.

1 participant