"invalid reference format" error when running a pipeline with an unreferenced variable

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

When running a pipeline with an unreferenced variable, the error following error message is presented:

"WARNING: Failed to pull image with policy "always": invalid reference format (manager.go:237:0s)"

Which is really just docker says that the syntax of the docker image name is wrong and is not very specific or helpful.

Steps to reproduce

Make a project and use this gitlab-ci.yml:

variables:
#    DOCKER_IMAGES_TO_SCAN: ${CI_PROJECT_PATH}

include:
  - template: Security/SAST.gitlab-ci.yml

stages:
  - stage1

test-job-1:
  stage: stage1
  tags:
    - shell-runner
  rules:
    - if: $DOCKER_IMAGES_TO_SCAN != null
      when: always
    - if: $DOCKER_IMAGES_TO_SCAN == null
      when: never
  script:
    - echo THIS IS A TEST.

sast:
  stage: stage1
  tags:
    - docker-runner
  variables:
    SAST_DISABLE_DIND: "true"
    SEARCH_MAX_DEPTH: 16
  artifacts:
    reports:
      sast: gl-sast-report.json
    paths:
      - gl-sast-report.json

Example Project

https://gitlab.com/gitlab-gold/gyoachum/test-group/compliance-project/-/jobs/4932109272

What is the current bug behavior?

The following error message is presented when a variable in the gitlab-ci.yml is not referenced:

"WARNING: Failed to pull image with policy "always": invalid reference format (manager.go:237:0s)"

Which is really just docker says that the syntax of the docker image name is wrong and is not very specific or helpful.

What is the expected correct behavior?

The error message should indicate that there is an unreferenced variable in the gitlab-ci.yml.

Relevant logs and/or screenshots

Screenshot_2023-09-01_at_12.31.57

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

This bug happens on GitLab.com

Results of GitLab application Check

This bug happens on GitLab.com

Possible fixes

Edited Aug 27, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading