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

r/aws_emr_cluster: fix panic reading instance fleet #38773

Merged
merged 1 commit into from
Aug 8, 2024
Merged

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Aug 8, 2024

Description

Fixes a panic when reading an instance fleet with an empty launch_specifications argument.

Relations

Closes #38276

Output from Acceptance Testing

% make testacc PKG=emr TESTS=TestAccEMRCluster_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/emr/... -v -count 1 -parallel 20 -run='TestAccEMRCluster_'  -timeout 360m

--- PASS: TestAccEMRCluster_basic (434.89s)
=== CONT  TestAccEMRCluster_autoTerminationPolicy
--- PASS: TestAccEMRCluster_Step_basic (458.24s)
=== CONT  TestAccEMRCluster_MasterInstanceGroup_instanceCount
--- PASS: TestAccEMRCluster_sJSON (463.57s)
=== CONT  TestAccEMRCluster_security
--- PASS: TestAccEMRCluster_additionalInfo (478.89s)
=== CONT  TestAccEMRCluster_MasterInstanceGroup_name
--- PASS: TestAccEMRCluster_disappears (497.97s)
=== CONT  TestAccEMRCluster_MasterInstanceGroup_instanceType
--- PASS: TestAccEMRCluster_CoreInstanceGroup_autoScalingPolicy (588.15s)
=== CONT  TestAccEMRCluster_Kerberos_clusterDedicatedKdc
--- PASS: TestAccEMRCluster_InstanceFleetMaster_only (670.75s)
=== CONT  TestAccEMRCluster_MasterInstanceGroup_bidPrice                                                                                                                                                        --- PASS: TestAccEMRCluster_StepConcurrency_level (724.43s)
=== CONT  TestAccEMRCluster_terminationProtected
--- PASS: TestAccEMRCluster_s3LogEncryption (759.72s)
=== CONT  TestAccEMRCluster_s3Logging
--- PASS: TestAccEMRCluster_unhealthyNodeReplacement (792.17s)
=== CONT  TestAccEMRCluster_Bootstrap_ordering
--- PASS: TestAccEMRCluster_tags (793.52s)
=== CONT  TestAccEMRCluster_visibleToAllUsers
--- PASS: TestAccEMRCluster_Step_mode (837.79s)
=== CONT  TestAccEMRCluster_PlacementGroupConfigs
--- PASS: TestAccEMRCluster_CoreInstanceGroup_instanceType (864.33s)                                                                                                                                            === CONT  TestAccEMRCluster_keepJob
--- PASS: TestAccEMRCluster_RootVolume_size (896.28s)
=== CONT  TestAccEMRCluster_EC2Attributes_defaultManagedSecurityGroups
--- PASS: TestAccEMRCluster_security (464.92s)
=== CONT  TestAccEMRCluster_Step_multiple_listStates
--- PASS: TestAccEMRCluster_CoreInstanceGroup_bidPrice (1007.29s)
=== CONT  TestAccEMRCluster_Step_multiple
--- PASS: TestAccEMRCluster_terminationProtected (389.17s)
--- PASS: TestAccEMRCluster_MasterInstanceGroup_instanceType (678.07s)
--- PASS: TestAccEMRCluster_Kerberos_clusterDedicatedKdc (614.73s)
--- PASS: TestAccEMRCluster_MasterInstanceGroup_name (737.79s)
--- PASS: TestAccEMRCluster_CoreInstanceGroup_name (1229.11s)
--- PASS: TestAccEMRCluster_keepJob (401.33s)
--- PASS: TestAccEMRCluster_Step_multiple_listStates (417.17s)
--- PASS: TestAccEMRCluster_autoTerminationPolicy (925.32s)
=== NAME  TestAccEMRCluster_visibleToAllUsers
    cluster_test.go:1296: Step 3/4 error: Check failed: Check 2/2 error: aws_emr_cluster.test: Attribute 'visible_to_all_users' expected "false", got "true"
--- PASS: TestAccEMRCluster_s3Logging (633.74s)
--- PASS: TestAccEMRCluster_Step_multiple (395.48s)
--- PASS: TestAccEMRCluster_MasterInstanceGroup_instanceCount (961.03s)
--- PASS: TestAccEMRCluster_PlacementGroupConfigs (628.98s)
--- FAIL: TestAccEMRCluster_visibleToAllUsers (712.97s)
--- PASS: TestAccEMRCluster_MasterInstanceGroup_bidPrice (847.10s)
--- PASS: TestAccEMRCluster_CoreInstanceGroup_instanceCount (1612.28s)
--- PASS: TestAccEMRCluster_Bootstrap_ordering (1107.51s)
--- PASS: TestAccEMRCluster_InstanceFleet_basic (2024.62s)
--- PASS: TestAccEMRCluster_EC2Attributes_defaultManagedSecurityGroups (1842.94s)
=== NAME  TestAccEMRCluster_ebs
    cluster_test.go:1539: Step 1/2 error: Error running apply: exit status 1

        Error: waiting for EMR Cluster (j-33UEO2SNMV9LX) to create: unexpected state 'TERMINATING', wanted target 'RUNNING, WAITING'. last error: INTERNAL_ERROR: Failed to start the job flow due to an internal error

          with aws_emr_cluster.test,
          on terraform_plugin_test.tf line 194, in resource "aws_emr_cluster" "test":
         194: resource "aws_emr_cluster" "test" {

--- FAIL: TestAccEMRCluster_ebs (2950.94s)
=== NAME  TestAccEMRCluster_CustomAMI_id
    cluster_test.go:1573: Step 1/2 error: Error running apply: exit status 1

        Error: waiting for EMR Cluster (j-4KYO8528ZP33) to create: unexpected state 'TERMINATING', wanted target 'RUNNING, WAITING'. last error: INTERNAL_ERROR: Failed to start the job flow due to an internal error

          with aws_emr_cluster.test,
          on terraform_plugin_test.tf line 305, in resource "aws_emr_cluster" "test":
         305: resource "aws_emr_cluster" "test" {

--- FAIL: TestAccEMRCluster_CustomAMI_id (2995.13s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/emr        3001.300s

Test failures are pre-existing and not related to this change.

Copy link

github-actions bot commented Aug 8, 2024

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/emr Issues and PRs that pertain to the emr service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Aug 8, 2024
Fixes a panic when reading an instance fleet with an empty `launch_specifications` argument.

```console
% make testacc PKG=emr TESTS=TestAccEMRCluster_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/emr/... -v -count 1 -parallel 20 -run='TestAccEMRCluster_'  -timeout 360m

--- PASS: TestAccEMRCluster_basic (434.89s)
=== CONT  TestAccEMRCluster_autoTerminationPolicy
--- PASS: TestAccEMRCluster_Step_basic (458.24s)
=== CONT  TestAccEMRCluster_MasterInstanceGroup_instanceCount
--- PASS: TestAccEMRCluster_sJSON (463.57s)
=== CONT  TestAccEMRCluster_security
--- PASS: TestAccEMRCluster_additionalInfo (478.89s)
=== CONT  TestAccEMRCluster_MasterInstanceGroup_name
--- PASS: TestAccEMRCluster_disappears (497.97s)
=== CONT  TestAccEMRCluster_MasterInstanceGroup_instanceType
--- PASS: TestAccEMRCluster_CoreInstanceGroup_autoScalingPolicy (588.15s)
=== CONT  TestAccEMRCluster_Kerberos_clusterDedicatedKdc
--- PASS: TestAccEMRCluster_InstanceFleetMaster_only (670.75s)
=== CONT  TestAccEMRCluster_MasterInstanceGroup_bidPrice                                                                                                                                                        --- PASS: TestAccEMRCluster_StepConcurrency_level (724.43s)
=== CONT  TestAccEMRCluster_terminationProtected
--- PASS: TestAccEMRCluster_s3LogEncryption (759.72s)
=== CONT  TestAccEMRCluster_s3Logging
--- PASS: TestAccEMRCluster_unhealthyNodeReplacement (792.17s)
=== CONT  TestAccEMRCluster_Bootstrap_ordering
--- PASS: TestAccEMRCluster_tags (793.52s)
=== CONT  TestAccEMRCluster_visibleToAllUsers
--- PASS: TestAccEMRCluster_Step_mode (837.79s)
=== CONT  TestAccEMRCluster_PlacementGroupConfigs
--- PASS: TestAccEMRCluster_CoreInstanceGroup_instanceType (864.33s)                                                                                                                                            === CONT  TestAccEMRCluster_keepJob
--- PASS: TestAccEMRCluster_RootVolume_size (896.28s)
=== CONT  TestAccEMRCluster_EC2Attributes_defaultManagedSecurityGroups
--- PASS: TestAccEMRCluster_security (464.92s)
=== CONT  TestAccEMRCluster_Step_multiple_listStates
--- PASS: TestAccEMRCluster_CoreInstanceGroup_bidPrice (1007.29s)
=== CONT  TestAccEMRCluster_Step_multiple
--- PASS: TestAccEMRCluster_terminationProtected (389.17s)
--- PASS: TestAccEMRCluster_MasterInstanceGroup_instanceType (678.07s)
--- PASS: TestAccEMRCluster_Kerberos_clusterDedicatedKdc (614.73s)
--- PASS: TestAccEMRCluster_MasterInstanceGroup_name (737.79s)
--- PASS: TestAccEMRCluster_CoreInstanceGroup_name (1229.11s)
--- PASS: TestAccEMRCluster_keepJob (401.33s)
--- PASS: TestAccEMRCluster_Step_multiple_listStates (417.17s)
--- PASS: TestAccEMRCluster_autoTerminationPolicy (925.32s)
=== NAME  TestAccEMRCluster_visibleToAllUsers
    cluster_test.go:1296: Step 3/4 error: Check failed: Check 2/2 error: aws_emr_cluster.test: Attribute 'visible_to_all_users' expected "false", got "true"
--- PASS: TestAccEMRCluster_s3Logging (633.74s)
--- PASS: TestAccEMRCluster_Step_multiple (395.48s)
--- PASS: TestAccEMRCluster_MasterInstanceGroup_instanceCount (961.03s)
--- PASS: TestAccEMRCluster_PlacementGroupConfigs (628.98s)
--- FAIL: TestAccEMRCluster_visibleToAllUsers (712.97s)
--- PASS: TestAccEMRCluster_MasterInstanceGroup_bidPrice (847.10s)
--- PASS: TestAccEMRCluster_CoreInstanceGroup_instanceCount (1612.28s)
--- PASS: TestAccEMRCluster_Bootstrap_ordering (1107.51s)
--- PASS: TestAccEMRCluster_InstanceFleet_basic (2024.62s)
--- PASS: TestAccEMRCluster_EC2Attributes_defaultManagedSecurityGroups (1842.94s)
=== NAME  TestAccEMRCluster_ebs
    cluster_test.go:1539: Step 1/2 error: Error running apply: exit status 1

        Error: waiting for EMR Cluster (j-33UEO2SNMV9LX) to create: unexpected state 'TERMINATING', wanted target 'RUNNING, WAITING'. last error: INTERNAL_ERROR: Failed to start the job flow due to an internal error

          with aws_emr_cluster.test,
          on terraform_plugin_test.tf line 194, in resource "aws_emr_cluster" "test":
         194: resource "aws_emr_cluster" "test" {

--- FAIL: TestAccEMRCluster_ebs (2950.94s)
=== NAME  TestAccEMRCluster_CustomAMI_id
    cluster_test.go:1573: Step 1/2 error: Error running apply: exit status 1

        Error: waiting for EMR Cluster (j-4KYO8528ZP33) to create: unexpected state 'TERMINATING', wanted target 'RUNNING, WAITING'. last error: INTERNAL_ERROR: Failed to start the job flow due to an internal error

          with aws_emr_cluster.test,
          on terraform_plugin_test.tf line 305, in resource "aws_emr_cluster" "test":
         305: resource "aws_emr_cluster" "test" {

--- FAIL: TestAccEMRCluster_CustomAMI_id (2995.13s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/emr        3001.300s
```

Test failures are pre-existing and not related to this change.
@jar-b jar-b added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. labels Aug 8, 2024
@jar-b jar-b marked this pull request as ready for review August 8, 2024 18:24
@jar-b jar-b requested a review from a team as a code owner August 8, 2024 18:24
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

@jar-b jar-b merged commit 819631a into main Aug 8, 2024
52 checks passed
@jar-b jar-b deleted the b-emr-cluster-crash branch August 8, 2024 18:58
@github-actions github-actions bot added this to the v5.62.0 milestone Aug 8, 2024
terraform-aws-provider bot pushed a commit that referenced this pull request Aug 8, 2024
Copy link

github-actions bot commented Aug 9, 2024

This functionality has been released in v5.62.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

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.
If you have found a problem that seems related to this change, 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 Sep 9, 2024
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. crash Results from or addresses a Terraform crash or kernel panic. service/emr Issues and PRs that pertain to the emr service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Plugin Crash with aws_emr_cluster Resource
2 participants