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
- Create a git repo
- Add
backend.tffile with backendgcs - Add
.gitlab-ci.ymlwithterraform init - 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