Terraform with Gitlab - Error refreshing state

We are running a gitlab community server. Terraform back end is enabled.
The gitlab-ci.yml file is:

default:
  tags:
    - docker

include:
  - template: Terraform.latest.gitlab-ci.yml

variables:
  TF_STATE_NAME: default
  TF_CACHE_KEY: default
  TF_ROOT: iac

CI is broken. The error is:

Using docker image sha256:764fe72b1590cf6b9ec9bc4c088dbeaef76d41694ab475aaecf64bf8b8322c94 for registry.gitlab.com/gitlab-org/terraform-images/stable:latest with digest registry.gitlab.com/gitlab-org/terraform-images/stable@sha256:85ef4c5f18dca0e28d106741d7a9fd8f50b1beb8599d3571614ccf83cecc100f ...
$ cd "${TF_ROOT}"
$ gitlab-terraform plan
Initializing the backend...
Successfully configured the backend "http"! Terraform will automatically
use this backend unless the backend configuration changes.
Error refreshing state: Failed to get state: GET https://gitlab.server/api/v4/projects/60802/terraform/state/default giving up after 1 attempt(s): Get "https://gitlab.server/api/v4/projects/60802/terraform/state/default": x509: certificate signed by unknown authority

Is it a (docker) runner issue or something else? Would appreciate some insights.

Thanks,
Liora

1 Like

I have the same issue, any suggestions?