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

tests/service/workspaces: InvalidResourceStateException Issues #18352

Closed
bflad opened this issue Mar 23, 2021 · 2 comments · Fixed by #20462
Closed

tests/service/workspaces: InvalidResourceStateException Issues #18352

bflad opened this issue Mar 23, 2021 · 2 comments · Fixed by #20462
Labels
service/workspaces Issues and PRs that pertain to the workspaces service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Mar 23, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

There are currently fairly regular test failures with the WorkSpaces testing, such as:

=== CONT  TestAccAwsWorkspacesIpGroup_MultipleDirectories
    resource_aws_workspaces_ip_group_test.go:140: Step 1/1 error: Error running apply: exit status 1

        Error: InvalidResourceStateException: The specified directory is not in a valid state. Confirm that the directory has a status of Active, and try again.

          on terraform_plugin_test.tf line 68, in resource "aws_workspaces_directory" "test1":
          68: resource "aws_workspaces_directory" "test1" {


--- FAIL: TestAccAwsWorkspacesIpGroup_MultipleDirectories (601.98s)

=== CONT  TestAccAwsWorkspacesIpGroup_MultipleDirectories
    testing_new.go:63: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: error deleting WorkSpaces Directory (d-92670cef35): error deregistering WorkSpaces Directory (d-92670cef35): InvalidResourceStateException: The specified directory is not in a valid state. Confirm that the directory has a status of Active, and try again.


--- FAIL: TestAccAwsWorkspacesIpGroup_MultipleDirectories (308.88s)

There are other issues with Error: DirectoryLimitExceededException: Directory limit exceeded. A maximum of 10 directories may be created. but would like to keep those out of scope for this since the fix will be unrelated.

Affected Resources

  • aws_workspaces_directory
  • aws_workspaces_ip_group
@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/workspaces Issues and PRs that pertain to the workspaces service. labels Mar 23, 2021
bflad added a commit that referenced this issue Mar 23, 2021
…(T-W resources)

Reference: #12992

Previously:

```
aws/resource_aws_transfer_ssh_key.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
101:			body = *s.SshPublicKeyBody
--------------------------------------------------------------------------------
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
100:		if sshKeyID == *s.SshPublicKeyId {

aws/resource_aws_volume_attachment.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
179:				if a.InstanceId != nil && *a.InstanceId == instanceID {
--------------------------------------------------------------------------------
215:	if len(vols.Volumes) == 0 || *vols.Volumes[0].State == ec2.VolumeStateAvailable {

aws/resource_aws_vpc.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
339:					classiclink_enabled = *v.ClassicLinkEnabled
--------------------------------------------------------------------------------
364:					classiclinkdns_enabled = *v.ClassicLinkDnsSupported
--------------------------------------------------------------------------------
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
337:			if *v.VpcId == vpcid {
--------------------------------------------------------------------------------
362:			if *v.VpcId == vpcid {

aws/resource_aws_vpc_peering_connection.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
146:	if (client.accountid == *pc.AccepterVpcInfo.OwnerId) && (client.accountid != *pc.RequesterVpcInfo.OwnerId) {
--------------------------------------------------------------------------------
146:	if (client.accountid == *pc.AccepterVpcInfo.OwnerId) && (client.accountid != *pc.RequesterVpcInfo.OwnerId) {

aws/resource_aws_vpn_connection_route.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
158:		if *r.DestinationCidrBlock == cidrBlock && *r.State != "deleted" {
--------------------------------------------------------------------------------
158:		if *r.DestinationCidrBlock == cidrBlock && *r.State != "deleted" {

aws/resource_aws_vpn_gateway_route_propagation.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
90:		if *vgw.GatewayId == gwID {

aws/resource_aws_waf_sql_injection_match_set.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
179:		m["text_transformation"] = *t.TextTransformation

aws/resource_aws_wafregional_rule.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
228:		m["negated"] = *p.Negated
--------------------------------------------------------------------------------
229:		m["type"] = *p.Type
--------------------------------------------------------------------------------
230:		m["data_id"] = *p.DataId

aws/resource_aws_workspaces_ip_group.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
219:			r["description"] = *rule.RuleDesc
ran 15 rules on 2163 files: 18 findings
```

Output from acceptance testing:

```
--- PASS: TestAccAWSTransferSshKey_basic (172.65s)

--- PASS: TestAccAWSVolumeAttachment_attachStopped (379.45s)
--- PASS: TestAccAWSVolumeAttachment_basic (137.33s)
--- PASS: TestAccAWSVolumeAttachment_disappears (127.64s)
--- PASS: TestAccAWSVolumeAttachment_skipDestroy (106.70s)
--- PASS: TestAccAWSVolumeAttachment_update (117.94s)

--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (96.85s)
--- PASS: TestAccAWSVpc_basic (35.87s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (45.41s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (39.09s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (38.76s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (30.39s)
--- PASS: TestAccAWSVpc_defaultAndIgnoreTags (69.04s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag (5.12s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag (74.60s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag (77.40s)
--- PASS: TestAccAWSVpc_defaultTags_providerOnly (74.67s)
--- PASS: TestAccAWSVpc_defaultTags_updateToProviderOnly (53.56s)
--- PASS: TestAccAWSVpc_defaultTags_updateToResourceOnly (54.07s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (44.39s)
--- PASS: TestAccAWSVpc_disappears (21.95s)
--- PASS: TestAccAWSVpc_ignoreTags (69.04s)
--- PASS: TestAccAWSVpc_tags (79.06s)
--- PASS: TestAccAWSVpc_Tenancy (77.06s)
--- PASS: TestAccAWSVpc_update (58.54s)

--- FAIL: TestAccAWSVPCPeeringConnection_region (39.86s) # #18348
--- PASS: TestAccAWSVPCPeeringConnection_accept (81.01s)
--- PASS: TestAccAWSVPCPeeringConnection_basic (43.58s)
--- PASS: TestAccAWSVPCPeeringConnection_failedState (18.09s)
--- PASS: TestAccAWSVPCPeeringConnection_options (78.71s)
--- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (30.00s)
--- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (16.39s)
--- PASS: TestAccAWSVPCPeeringConnection_plan (31.03s)
--- PASS: TestAccAWSVPCPeeringConnection_tags (85.86s)

--- PASS: TestAccAWSVpnConnectionRoute_basic (457.75s)

--- PASS: TestAccAWSVPNGatewayRoutePropagation_basic (55.88s)

--- PASS: TestAccAWSWafRegionalRule_basic (61.65s)
--- PASS: TestAccAWSWafRegionalRule_changeNameForceNew (107.77s)
--- PASS: TestAccAWSWafRegionalRule_changePredicates (103.24s)
--- PASS: TestAccAWSWafRegionalRule_disappears (64.90s)
--- PASS: TestAccAWSWafRegionalRule_noPredicates (44.78s)
--- PASS: TestAccAWSWafRegionalRule_tags (97.70s)

--- PASS: TestAccAWSWafSqlInjectionMatchSet_basic (21.90s)
--- PASS: TestAccAWSWafSqlInjectionMatchSet_changeNameForceNew (38.62s)
--- PASS: TestAccAWSWafSqlInjectionMatchSet_changeTuples (35.26s)
--- PASS: TestAccAWSWafSqlInjectionMatchSet_disappears (16.76s)
--- PASS: TestAccAWSWafSqlInjectionMatchSet_noTuples (20.81s)

--- FAIL: TestAccAwsWorkspacesIpGroup_MultipleDirectories (612.05s) # #18352
--- PASS: TestAccAwsWorkspacesIpGroup_basic (44.84s)
--- PASS: TestAccAwsWorkspacesIpGroup_disappears (24.70s)
--- PASS: TestAccAwsWorkspacesIpGroup_tags (69.57s)
```
bflad added a commit that referenced this issue Mar 26, 2021
…(T-W resources) (#18353)

Reference: #12992

Previously:

```
aws/resource_aws_transfer_ssh_key.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
101:			body = *s.SshPublicKeyBody
--------------------------------------------------------------------------------
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
100:		if sshKeyID == *s.SshPublicKeyId {

aws/resource_aws_volume_attachment.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
179:				if a.InstanceId != nil && *a.InstanceId == instanceID {
--------------------------------------------------------------------------------
215:	if len(vols.Volumes) == 0 || *vols.Volumes[0].State == ec2.VolumeStateAvailable {

aws/resource_aws_vpc.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
339:					classiclink_enabled = *v.ClassicLinkEnabled
--------------------------------------------------------------------------------
364:					classiclinkdns_enabled = *v.ClassicLinkDnsSupported
--------------------------------------------------------------------------------
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
337:			if *v.VpcId == vpcid {
--------------------------------------------------------------------------------
362:			if *v.VpcId == vpcid {

aws/resource_aws_vpc_peering_connection.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
146:	if (client.accountid == *pc.AccepterVpcInfo.OwnerId) && (client.accountid != *pc.RequesterVpcInfo.OwnerId) {
--------------------------------------------------------------------------------
146:	if (client.accountid == *pc.AccepterVpcInfo.OwnerId) && (client.accountid != *pc.RequesterVpcInfo.OwnerId) {

aws/resource_aws_vpn_connection_route.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
158:		if *r.DestinationCidrBlock == cidrBlock && *r.State != "deleted" {
--------------------------------------------------------------------------------
158:		if *r.DestinationCidrBlock == cidrBlock && *r.State != "deleted" {

aws/resource_aws_vpn_gateway_route_propagation.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
90:		if *vgw.GatewayId == gwID {

aws/resource_aws_waf_sql_injection_match_set.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
179:		m["text_transformation"] = *t.TextTransformation

aws/resource_aws_wafregional_rule.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
228:		m["negated"] = *p.Negated
--------------------------------------------------------------------------------
229:		m["type"] = *p.Type
--------------------------------------------------------------------------------
230:		m["data_id"] = *p.DataId

aws/resource_aws_workspaces_ip_group.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue()
219:			r["description"] = *rule.RuleDesc
ran 15 rules on 2163 files: 18 findings
```

Output from acceptance testing:

```
--- PASS: TestAccAWSTransferSshKey_basic (172.65s)

--- PASS: TestAccAWSVolumeAttachment_attachStopped (379.45s)
--- PASS: TestAccAWSVolumeAttachment_basic (137.33s)
--- PASS: TestAccAWSVolumeAttachment_disappears (127.64s)
--- PASS: TestAccAWSVolumeAttachment_skipDestroy (106.70s)
--- PASS: TestAccAWSVolumeAttachment_update (117.94s)

--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (96.85s)
--- PASS: TestAccAWSVpc_basic (35.87s)
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (45.41s)
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (39.09s)
--- PASS: TestAccAWSVpc_classiclinkOptionSet (38.76s)
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (30.39s)
--- PASS: TestAccAWSVpc_defaultAndIgnoreTags (69.04s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag (5.12s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag (74.60s)
--- PASS: TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag (77.40s)
--- PASS: TestAccAWSVpc_defaultTags_providerOnly (74.67s)
--- PASS: TestAccAWSVpc_defaultTags_updateToProviderOnly (53.56s)
--- PASS: TestAccAWSVpc_defaultTags_updateToResourceOnly (54.07s)
--- PASS: TestAccAWSVpc_DisabledDnsSupport (44.39s)
--- PASS: TestAccAWSVpc_disappears (21.95s)
--- PASS: TestAccAWSVpc_ignoreTags (69.04s)
--- PASS: TestAccAWSVpc_tags (79.06s)
--- PASS: TestAccAWSVpc_Tenancy (77.06s)
--- PASS: TestAccAWSVpc_update (58.54s)

--- FAIL: TestAccAWSVPCPeeringConnection_region (39.86s) # #18348
--- PASS: TestAccAWSVPCPeeringConnection_accept (81.01s)
--- PASS: TestAccAWSVPCPeeringConnection_basic (43.58s)
--- PASS: TestAccAWSVPCPeeringConnection_failedState (18.09s)
--- PASS: TestAccAWSVPCPeeringConnection_options (78.71s)
--- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (30.00s)
--- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (16.39s)
--- PASS: TestAccAWSVPCPeeringConnection_plan (31.03s)
--- PASS: TestAccAWSVPCPeeringConnection_tags (85.86s)

--- PASS: TestAccAWSVpnConnectionRoute_basic (457.75s)

--- PASS: TestAccAWSVPNGatewayRoutePropagation_basic (55.88s)

--- PASS: TestAccAWSWafRegionalRule_basic (61.65s)
--- PASS: TestAccAWSWafRegionalRule_changeNameForceNew (107.77s)
--- PASS: TestAccAWSWafRegionalRule_changePredicates (103.24s)
--- PASS: TestAccAWSWafRegionalRule_disappears (64.90s)
--- PASS: TestAccAWSWafRegionalRule_noPredicates (44.78s)
--- PASS: TestAccAWSWafRegionalRule_tags (97.70s)

--- PASS: TestAccAWSWafSqlInjectionMatchSet_basic (21.90s)
--- PASS: TestAccAWSWafSqlInjectionMatchSet_changeNameForceNew (38.62s)
--- PASS: TestAccAWSWafSqlInjectionMatchSet_changeTuples (35.26s)
--- PASS: TestAccAWSWafSqlInjectionMatchSet_disappears (16.76s)
--- PASS: TestAccAWSWafSqlInjectionMatchSet_noTuples (20.81s)

--- FAIL: TestAccAwsWorkspacesIpGroup_MultipleDirectories (612.05s) # #18352
--- PASS: TestAccAwsWorkspacesIpGroup_basic (44.84s)
--- PASS: TestAccAwsWorkspacesIpGroup_disappears (24.70s)
--- PASS: TestAccAwsWorkspacesIpGroup_tags (69.57s)
```
@github-actions github-actions bot added this to the v3.54.0 milestone Aug 9, 2021
@github-actions
Copy link

This functionality has been released in v3.54.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 Sep 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/workspaces Issues and PRs that pertain to the workspaces service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant