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

aws_workspace_workspaces plan causes intermittent "RequestError: send request failed, read: connection reset by peer" #13843

Closed
dgershman opened this issue Jun 19, 2020 · 4 comments
Labels
bug Addresses a defect in current functionality. service/workspaces Issues and PRs that pertain to the workspaces service.

Comments

@dgershman
Copy link

dgershman commented Jun 19, 2020

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

Terraform Version

Terraform v0.12.26
+ provider.aws v2.67.0

Affected Resource(s)

  • aws_workspaces_workspace

Terraform Configuration Files

locals {
  now = formatdate("YYYY-MM-DD HH:MM:ss", timestamp())
}

resource aws_workspaces_directory workspaces_directory {
  directory_id = "<redacted>"
  subnet_ids = [
    aws_subnet.workspaces_private_subnet_a.id,
    aws_subnet.workspaces_private_subnet_b.id
  ]

  self_service_permissions {
    change_compute_type  = false
    increase_volume_size = false
    rebuild_workspace    = false
    restart_workspace    = true
    switch_running_mode  = false
  }
}

data aws_workspaces_bundle workspaces_bundle {
  bundle_id = "<redacted>"
}

resource aws_workspaces_workspace workspace_aws_linux {
  for_each     = var.usernames
  directory_id = aws_workspaces_directory.workspaces_directory.id
  bundle_id    = data.aws_workspaces_bundle.workspaces_bundle.id
  user_name    = each.value

  root_volume_encryption_enabled = true
  user_volume_encryption_enabled = true
  volume_encryption_key          = "<redacted>"

  workspace_properties {
    running_mode                              = "AUTO_STOP"
    running_mode_auto_stop_timeout_in_minutes = 60
    compute_type_name                         = "POWER"
    root_volume_size_gib                      = 175
    user_volume_size_gib                      = 100
  }

  tags = {
    User = each.value
    Name = each.value
    FirstSeen = local.now
  }

  lifecycle {
    ignore_changes = [
      tags,
    ]
  }
}

variable usernames {
  type = set(string)
}

I have a terraform.tfvars.json file with 350 or so "usernames".

Debug Output

Panic Output

N/A

Expected Behavior

The terraform plan should have produced a plan.

Actual Behavior

Error: error listing tags: RequestError: send request failed
caused by: Post https://workspaces..amazonaws.com/: read tcp y.y.y.y:00000->x.x.x.x:443: read: connection reset by peer
Error: error reading workspace ("redacted"): RequestError: send request failed
caused by: Post https://workspaces..amazonaws.com/: read tcp y.y.y.y:00000->x.x.x.x:443: read: connection reset by peer
Error: error reading workspace ("redacted"): RequestError: send request failed
caused by: Post https://workspaces..amazonaws.com/: read tcp y.y.y.y:00000->x.x.x.x:443: read: connection reset by peer
ERROR: Job failed: exit code 1

Steps to Reproduce

  1. terraform plan

The error doesn't always occur, and I believe it might be related to some kind of rate limiting panic.

Additional notes:

  • Tried using a VPC endpoint, did not improve anything.
  • Have tried reducing -parallelism=1
  • Have tried increasing retries to 50 in the provider configuration.
  • If I run the plan with -refresh=false the issue does not occur.

Important Factoids

  • Running in GovCloud (US)

References

  • #0000
@ghost ghost added the service/workspaces Issues and PRs that pertain to the workspaces service. label Jun 19, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 19, 2020
@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 10, 2020
@checker21
Copy link

I got a similar issue, when deploying a cloudfront distribution. In my setup I used S3 backend with encrypted S3 bucket. Once, I turned of encryption for S3 bucket, the error disappeared.

@Tensho
Copy link
Contributor

Tensho commented Nov 19, 2020

@radius314 Hi, seems like the issue with the network, not the provider itself. However, I sincerely ask you to verify the provided config with the latest Terrfarorm and AWS provider versions 🙇

Also, I noticed you set create POWER workspaces, which usually takes a lot of time to spin up from AWS service side. If you get intermittent timeout errors, consider tweaking the recently added workspace timeouts to give the provider a little bit more time.

@lagrianitis
Copy link

Isn't this similar behaviour as #10715 ?

@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 Jun 10, 2022
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/workspaces Issues and PRs that pertain to the workspaces service.
Projects
None yet
Development

No branches or pull requests

5 participants