Introduction
In TFE environments usually customers have the need to create custom terraform-bundles to include custom and community providers to be used by TFE.
Problem
A new terraform-bundle has been created by the customer and TFE is not able to download the bundle from the new URL with a connection refused error:
Operation failed: failed fetching Terraform: failed downloading terraform:
failed downloading "http://<ip>:<port>/<filename>.zip":
GET http://<ip>:<port>/<filename>.zip giving up after 5 attempt(s):
Get "http://<ip>:<port>/<filename>.zip": dial tcp <ip>:<port>:
connect: connection refused
Prerequisites
- Have the terraform-bundle in a file, in a custom URL
Cause
-
Terraform Enterprise Worker is not able to download the file
Solutions:
- Solution 1
Ensure the terraform-bundle can be downloaded and has correct checksum. Work with your web admin to achieve that.
- Solution 2
TFE is a client of the HTTPS web server and if TFE is not able to download the new custom terraform-bundle the workspaces that will run the latest created bundle, will not plan & apply.
To fix the critical situation, follow the below steps:
- The workspaces should be rolled back to use the last known terraform-bundle that worked on these critical workspaces if you have one, or use one of the Terraform binaries included in TFE
- Upload the bundle file to your web server
-
Test from your TFE server the bundle can be downloaded
curl -kL http://<ip>:<port>/<filename>.zip
- Create a new terraform-bundle
- Create a test workspace
- Test the plan/apply on the new workspace with the new bundle
- If you still have any error about connection refused, please work with your Linux/Unix WebAdmin to get the right URL to use
- You can rollback to the known bundle to confirm it works
- Test again when you get a new URL or confirmation that the URL will work
Outcome
TFE will be able to download the new terraform-bundle successfully