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

Error configuring the backend "s3": RequestError: [...] TLS handshake timeout #299

Closed
gcaraman-zz opened this issue Sep 11, 2018 · 15 comments
Assignees
Labels
bug Something isn't working major

Comments

@gcaraman-zz
Copy link
Contributor


❌ [lambda_thub_user_create] Error configuring the backend "s3": RequestError: send request failed
caused by: Post https://sts.amazonaws.com/: net/http: TLS handshake timeout

Please update the configuration in your Terraform files to fix this error.
If you'd like to update the configuration interactively without storing

❌ [lambda_thub_user_create] the values in your configuration, run "terraform init".

❌ [lambda_thub_user_create] 
@eistrati eistrati added the bug Something isn't working label Sep 12, 2018
@eistrati eistrati changed the title Error configuring the backend "s3": RequestError: send request failed caused by: Post https://sts.amazonaws.com/: net/http: TLS handshake timeout Error configuring the backend "s3": RequestError: [...] TLS handshake timeout Sep 12, 2018
@eistrati
Copy link
Contributor

@Leichtwind @ddimitrioglo @gcaraman I'd like to propose to address this issue by retrying failed terrahub command up to 3 times with exponential backoff approach. Thoughts?

@ddimitrioglo
Copy link

@eistrati generally this is on terraform's side, but we can re-run terraform init as much times as we want

@eistrati
Copy link
Contributor

@ddimitrioglo that's correct, something is "fishy" between terraform and s3 ... and we can open an issue to terraform, but I fear that S3 is throttling multiple parallel terraform calls to S3 backend, so I'd like to propose an improvement by catching this issue and retrying in exponential backoff manner. Does this make sense?

@ddimitrioglo
Copy link

@eistrati it definitely does!

@gcaraman-zz
Copy link
Contributor Author

Here is another sample error:


❌ [iam_thub_lambda_exec] caused by: read tcp 192.168.1.85:33808->54.231.120.27:443: read: connection reset by peer

❌ [ddb_vcs] SerializationError: failed to decode REST XML response

❌ [ddb_vcs] caused by: read tcp 192.168.1.85:33806->54.231.120.27:443: read: connection reset by peer

❌ Worker error: "`/home/grigore/.terrahub/terraform/0.11.7/terraform workspace list` failed with code 1"```

@mciuchitu
Copy link
Contributor

mciuchitu commented Sep 21, 2018

Add option number of retries --retry (-r) for exponential backoff with default value 2.
Add default value in global config.

@avozicov avozicov added this to the 2018/09/17 - 2018/09/28 milestone Sep 24, 2018
@gcaraman-zz
Copy link
Contributor Author

Error: Error loading state: RequestError: send request failed
❌ [lambda_thub_mailchimp_subscribe] caused by: Get https://data-lake-terrahub-us-east-1.s3.amazonaws.com/terraform_workspaces/test/terraform/MitocGroup/terrahub-api/lambda_thub_mailchimp_subscribe/terraform.tfstate: EOF

@vcalmic
Copy link

vcalmic commented Sep 25, 2018

Same error about S3 backend here hashicorp/terraform-provider-aws#4709

@eistrati
Copy link
Contributor

eistrati commented Oct 4, 2018

One more use case:

❌ [lambda_github_repo_sync] 
Error: Error refreshing state: 1 error(s) occurred:

* data.external.lambda_github_repo_sync: 1 error(s) occurred:

* data.external.lambda_github_repo_sync: data.external.lambda_github_repo_sync: unexpected EOF

@eistrati
Copy link
Contributor

eistrati commented Oct 8, 2018

❌ [s3_bucket] �[31mRequestError: send request failed

❌ [s3_bucket] caused by: Get https://data-lake-terrahub-us-east-1.s3.amazonaws.com/?prefix=terraform_workspaces%2F: net/http: TLS handshake timeout�[0m�[0m

❌ Worker error: "\u001b[31mRequestError: send request failed\n,caused by: Get https://data-lake-terrahub-us-east-1.s3.amazonaws.com/?prefix=terraform_workspaces%2F: net/http: TLS handshake timeout\u001b[0m\u001b[0m\n"```

@avozicov
Copy link
Contributor

Reproduced again and this time there were network connection issue and terrahub did not try to re-run . In case this will be helpful I will attach log

[sqs_dbol_resource] This plan was saved to: /Users/alexandrvozicov/Projects/terrahub-api/.terrahub/sqs_dbol_resource/terraform.tfplan
[sqs_dbol_resource]
[sqs_dbol_resource] To perform exactly these actions, run the following command to apply:
[sqs_dbol_resource]     terraform apply "/Users/alexandrvozicov/Projects/terrahub-api/.terrahub/sqs_dbol_resource/terraform.tfplan"
[sqs_dbol_resource]
❌ [lambda_github_webhook_trigger] SerializationError: failed to decode REST XML response

❌ [lambda_github_webhook_trigger] caused by: read tcp 192.168.1.230:50508->52.216.165.75:443: read: connection reset by peer

❌ Worker error: "\u001b[31mSerializationError: failed to decode REST XML response\n,caused by: read tcp 192.168.1.230:50508->52.216.165.75:443: read: connection reset by peer\u001b[0m\u001b[0m\n"
Alexandrs-MacBook-Pro-2:Projects alexandrvozicov$

@avozicov avozicov added this to the November - December milestone Nov 2, 2018
@avozicov avozicov added the major label Nov 21, 2018
@avozicov
Copy link
Contributor

This is fixed by implementing exponential backoff for init and plan actions.
I am marking as resolved but we will reopen this if will catch other use cases.

@eistrati
Copy link
Contributor

eistrati commented Nov 21, 2018

💡 [lambda_pay_customer_retrieve] terraform apply -no-color -auto-approve=true [REDACTED]
[...]
❌ [lambda_pay_customer_retrieve] Failed to load backend: 
Error configuring the backend "s3": RequestError: send request failed
caused by: Post https://sts.amazonaws.com/: net/http: TLS handshake timeout```

@avozicov avozicov added bug Something isn't working and removed bug Something isn't working labels Dec 7, 2018
@avozicov
Copy link
Contributor

avozicov commented Dec 7, 2018

Fixed in and success for the following job and configured backend:
https://jenkins.mitocgroup.com/job/mitocgroup-terrahub-api/1886/consoleFull

screen shot 2018-12-07 at 15 44 29

@eistrati
Copy link
Contributor

eistrati commented Dec 7, 2018

Checked.

@eistrati eistrati closed this as completed Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

6 participants