CI job hangs on Terraform init with backend GCS

Summary

CI build hangs indefinitely during Terraform init when Google Cloud Storage used as backend This happens when builds are being run on the GitLab hosted infrastructure executing job locally works flawlessly.

$ gitlab-runner exec docker validate \
  --docker-volumes "$HOME/.ssh/id_rsa:/root/.ssh/id_rsa:ro" \
  --env "GOOGLE_CLOUD_KEYFILE_JSON=$GOOGLE_CREDENTIALS"

Steps to reproduce

  1. Create a git repo
  2. Add backend.tf file with backend gcs
  3. Add .gitlab-ci.yml with terraform init
  4. Push and see it hanging

Example Project

https://gitlab.com/duksis/gitlab_ci_terrafirm_init_bug_example

What is the current bug behavior?

It hangs during attempt to connect to google api ...

What is the expected correct behavior?

It initialises the backend or errors saying why it can't do that

Relevant logs and/or screenshots

https://gitlab.com/duksis/gitlab_ci_terrafirm_init_bug_example/-/jobs/279889921

Output of checks

This bug happens on GitLab.com

Assignee Loading
Time tracking Loading