-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
fix segv in sagemaker app resource #30786
Conversation
This PR fixes a segv occuring with sagemaker when: - sagemakers apps are created by terraform - all apps are deleted with AWS console or CLI At this stage, terraform plan fails with the following message: ``` 2023-04-17T09:49:04.048+0200 [DEBUG] provider.terraform-provider-aws_v4.63.0_x5: HTTP Response Received: aws.operation=ListApps http.duration=113 @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.26/logger.go:138 http.response.header.content_type=application/x-amz-json-1.1 http.status_code=200 tf_provider_addr=registry.terraform.io/hashicorp/aws tf_resource_type=aws_sagemaker_app @module=aws aws.sdk=aws-sdk-go aws.service=SageMaker http.response.header.date="Mon, 17 Apr 2023 07:49:03 GMT" tf_rpc=ReadResource http.response_content_length=11 tf_mux_provider=*schema.GRPCProviderServer tf_req_id=e79234a1-0bf3-d710-c3b0-b9891faacd4c aws.region=eu-west-1 http.response.body={"Apps":[]} http.response.header.x_amzn_requestid=6b73448b-5aa7-4d13-a2f3-13d74458a4b8 timestamp=2023-04-17T09:49:04.047+0200 2023-04-17T09:49:04.052+0200 [DEBUG] provider.terraform-provider-aws_v4.63.0_x5: panic: runtime error: invalid memory address or nil pointer dereference 2023-04-17T09:49:04.052+0200 [DEBUG] provider.terraform-provider-aws_v4.63.0_x5: [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xa0718ba] 2023-04-17T09:49:04.052+0200 [DEBUG] provider.terraform-provider-aws_v4.63.0_x5: 2023-04-17T09:49:04.052+0200 [DEBUG] provider.terraform-provider-aws_v4.63.0_x5: goroutine 1803 [running]: 2023-04-17T09:49:04.052+0200 [DEBUG] provider.terraform-provider-aws_v4.63.0_x5: github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker.FindAppByName({0xeabbd40, 0xc0046db380}, 0x203001?, {0xc005bd752d, 0xe}, {0xc005bd753c?, 0xc0046db350?}, {0xd69ad04, 0xd}, {0xc005bd7554, ...}) 2023-04-17T09:49:04.052+0200 [DEBUG] provider.terraform-provider-aws_v4.63.0_x5: github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker/find.go:336 +0x1da 2023-04-17T09:49:04.052+0200 [DEBUG] provider.terraform-provider-aws_v4.63.0_x5: github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker.resourceAppRead({0xeabbd40, 0xc0046db380}, 0xc004a8b780, {0xd635200?, 0xc0004aa800?}) ``` With this patch, terraform plan works as expected.
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccSageMaker_serial/^App$$' PKG=sagemaker
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sagemaker/... -v -count 1 -parallel 20 -run=TestAccSageMaker_serial/^App$ -timeout 180m
=== RUN TestAccSageMaker_serial
=== PAUSE TestAccSageMaker_serial
=== CONT TestAccSageMaker_serial
=== RUN TestAccSageMaker_serial/App
=== RUN TestAccSageMaker_serial/App/tags
=== RUN TestAccSageMaker_serial/App/resourceSpec
=== RUN TestAccSageMaker_serial/App/resourceSpecLifecycle
=== RUN TestAccSageMaker_serial/App/space
=== RUN TestAccSageMaker_serial/App/basic
=== RUN TestAccSageMaker_serial/App/disappears
--- PASS: TestAccSageMaker_serial (3091.82s)
--- PASS: TestAccSageMaker_serial/App (3091.82s)
--- PASS: TestAccSageMaker_serial/App/tags (593.80s)
--- PASS: TestAccSageMaker_serial/App/resourceSpec (535.62s)
--- PASS: TestAccSageMaker_serial/App/resourceSpecLifecycle (543.39s)
--- PASS: TestAccSageMaker_serial/App/space (478.35s)
--- PASS: TestAccSageMaker_serial/App/basic (417.97s)
--- PASS: TestAccSageMaker_serial/App/disappears (522.68s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker 3101.374s
@dod38fr Thanks for the contribution 🎉 👏. |
That was fast ! Thanks :-) |
This functionality has been released in v4.64.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! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
This PR fixes a segv occuring with sagemaker when:
At this stage, terraform plan fails with the following message:
With this patch, terraform plan works as expected.
Relations
None
Output from Acceptance Testing
Sorry, I cannot run the acceptance tests in my client's environment.