I recently upgrade my machine and and installed the latest Ubuntu 20.04 as part of that.
Very smugly I fired it up the new install and, as I use devcontainers, looked forward to not installing lots of devtools as the Dockerfile in each project had all the tooling needed for VSCode to spin up and get going.
Sadly it wasn’t that smooth. After spinning up a project which uses
terraform I found an odd message when running
failed to retrieve schema from provider “random”: rpc error: code = Unavailable desc = connection error: desc = “transport: authentication handshake failed: EOFerror from
Terraform has a
provider model which uses GRPC to talk between the CLI and the individual providers.
Random is one of the HashiCorp made providers so it’s a really odd one to see a bug in.
Initially I assumed that the downloaded provider was corrupted. Nope, clearing the download and retrying didn’t help.
So assuming I’d messed something up I:
- Tried changing the docker image using by the devcontainer. Nope. Same problem.
- Different versions of
terraform. Nope. Same problem.
- Updated the Docker version I was using. Nope. Same problem.
- Restarted the machine. Nope. Same problem.
Now feeling quite frustrated I finally remembered a trick I’d used lots when building my own terraform providers. I enabled debug logging on the terraform CLI.
TF_LOG=DEBUG terraform plan
This is where it gets interesting…Continue reading