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

[Bug]: aws_sagemaker_app still get persisted in spite of failure state #27265

Closed
hungluong5791 opened this issue Oct 16, 2022 · 7 comments · Fixed by #28154
Closed

[Bug]: aws_sagemaker_app still get persisted in spite of failure state #27265

hungluong5791 opened this issue Oct 16, 2022 · 7 comments · Fixed by #28154
Labels
bug Addresses a defect in current functionality. service/sagemaker Issues and PRs that pertain to the sagemaker service.
Milestone

Comments

@hungluong5791
Copy link

Terraform Core Version

1.2.9

AWS Provider Version

4.34.0

Affected Resource(s)

During the provisioning of aws_sagemaker_app if there is an error that put the App in a Failed state (i.e a Lifecycle Configuration script error), the aws_sagemaker_app is still persisted in the Terraform state. This results in error trying to refresh its status in subsequent runs

Expected Behavior

aws_sagemaker_app in a Failed state should not be persisted in the Terraform state

Actual Behavior

aws_sagemaker_app in a Failed stabe persisted in the Terraform state, requiring manual removal to re-create

Relevant Error/Panic Output Snippet

│ Error: waiting for SageMaker App (redacted) to create: unexpected state 'Failed', wanted target 'InService'. last error: %!s(<nil>)
│ 
│   with aws_sagemaker_app.jupyter,
│   on sagemaker.tf line 60, in resource "aws_sagemaker_app" "jupyter":
│   60: resource "aws_sagemaker_app" "jupyter" {

---

aws_sagemaker_app.jupyter: Refreshing state... [redacted]
╷
│ Error: listing tags for SageMaker App (redacted): ValidationException: 
│       status code: 400, request id: redacted
│ 
│   with aws_sagemaker_app.jupyter,
│   on sagemaker.tf line 60, in resource "aws_sagemaker_app" "jupyter":
│   60: resource "aws_sagemaker_app" "jupyter" {

Terraform Configuration Files

https://gist.github.com/hungluong5791/4836adc3832c8b285dab635d6cf32d91

Steps to Reproduce

  • Plan + apply the configuration with error in the lifecycle configuration script-
  • Observe the error stating failure in waiting for SageMaker App
  • Plan + apply the configuration again
  • Observe the bug:
  • a) the failed SageMaker app is in the state and still get refreshed
  • b) an error listing tags for the failed SageMaker app (as it doesn't exists due to failure in provisioning)

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No response

@hungluong5791 hungluong5791 added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Oct 16, 2022
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/sagemaker Issues and PRs that pertain to the sagemaker service. label Oct 16, 2022
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Oct 17, 2022
@DrFaust92
Copy link
Collaborator

Hi hungluong5791, would you mind sharing an example for a failing config to reproduce?

@hungluong5791
Copy link
Author

Hi @DrFaust92, working config is here: Gist

@JohnPaton
Copy link

I'm hitting the same issue, any workaround? I tried to ignore_changes = [tags], but that was not enough to stop this query which is 400ing.

@hungluong5791
Copy link
Author

Hi @JohnPaton, the only workaround I have is delete the App in question and recreate, using -target option i.e

terraform plan -destroy -target aws_sagemaker_app.jupyter

@github-actions
Copy link

This functionality has been released in v4.47.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/sagemaker Issues and PRs that pertain to the sagemaker service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants