Introduction
Problem
When starting a run on a workspace with Terraform Enterprise it fails to install the provider with the following error
│ Error: Failed to install provider
│
│ Error while installing some/third-party-provider v1.3.1: github.com: Get
│ "https://objects.githubusercontent.com/github-production-release-asset-xxxxxx/220481523/dd51f8bb-9806-4f14-815f.....":
│ net/http: TLS handshake timeout
Prerequisites
- Terraform Enterprise running on Google Cloud
Cause
The issue is only seen with third-party providers that are hosted on Github itself. The official providers from HashiCorp are able to be installed.
The issue might be related to the MTU settings for Docker on Google Cloud, which should be set to 1460. Some Docker networks, for instance, may not have this setting configured properly.
Verify the networks using the following
docker network inspect tfe_services
docker network inspect tfe_terraform_isolation
Incorrect output regarding MTU:
...
"Options": {},
"Labels": {}
...
Correct output regarding MTU
...
"Options": {
"com.docker.network.driver.mtu": "1460"
},
"Labels": {}
...
Solution
The issue can be found in the MTU network settings for Docker on the Terraform Enterprise server for Google Cloud.
The official documentation about this configuration can be found here
For GCP only: Configure Docker to use an MTU (maximum transmission unit) of 1460, as required by Google (GCP Cloud VPN Documentation: MTU Considerations).
To configure Docker's MTU, create an /etc/docker/daemon.json file with the following content:
{
"mtu": 1460
}
Please take a look at the above settings and the following KB article here about additional steps for specific docker networks that may be used by Terraform Enterprise.
Outcome
Third-party providers can be used with Terraform Enterprise running on Google Cloud