OpenTofu... Job failed: failed to pull image

OpenTofu CI Error

Hey there. I’m trying to set up a new project to use OpenTofu in CI to manage infra + deployment. I’ve verified that the Terraform code works locally with OpenTofu. Whenever the pipeline runs in CI, I get the following error:

ERROR: Job failed: failed to pull image "registry.gitlab.com/components/opentofu/$[[ inputs.image_name ]]:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]" with specified policies [always]: invalid reference format (manager.go:237:0s)

I’m following all the documentation here: GitLab components / OpenTofu · GitLab

This is what my CI config looks like right now:

include:
  - component: gitlab.com/components/opentofu/full-pipeline@0.16.0
    inputs:
      version: 0.16.0
      opentofu_version: 1.6.1
      root_dir: src/terraform/

stages: [validate, test, build, deploy, cleanup]

I’m sure I’m missing something obvious, but I can’t figure out what’s up. Any tips will be appreciated.

This just started happening to my pipelines as well. I’d converted mine from old Terraform templates and had them running successfully last week. I feel like some bug found it’s way in, but I don’t see any updates to the OpenTofu component which would cause it. The runner code that calls the component seems to not be expanding variables correctly.

I’m using the “customized” template as well, so my call to the component is like this:

include:
  - template: Jobs/SAST-IaC.latest.gitlab-ci.yml
  - component: gitlab.com/components/opentofu/job-templates@0.16.0
    inputs:
      version: 0.16.0
      opentofu_version: 1.6.1

Output from the job:

Running with gitlab-runner 16.6.0~beta.105.gd2263193 (d2263193)
  on blue-4.saas-linux-small-amd64.runners-manager.gitlab.com/default J2nyww-s, system ID: s_cf1798852952
  feature flags: FF_USE_IMPROVED_URL_MASKING:true
Preparing the "docker+machine" executor
00:04
ERROR: Job failed: failed to pull image "registry.gitlab.com/components/opentofu/$[[ inputs.image_name ]]:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]" with specified policies [always]: invalid reference format (manager.go:237:0s)

FYI, just wanted to say his is fixed for me now. No changes were required on my side.

Still no dice for me.

This has been due to an incident which has been resolved As @jarrodjohnston noticed, it should work again.

Not sure what I’m doing to get a different experience, but this is what I got just now:

Update: When I updated to version 0.17.0 of the OpenTofu Gitlab component, I got over the hump :+1:

Hello.

Does anyone have information how to make this work on self-managed version? Have tried different version combinations, but am always getting
ERROR: Job failed: failed to pull image "/components/opentofu/gitlab-opentofu:0.17.0-opentofu1.6.1" with specified policies [always]: invalid reference format (manager.go:250:0s)

Thank you.

yes, you need to create the containers in the container registry as well.
Or reference the gitlab one.
I used the external one:

include: