Skip to content
Latchkey

GitLab CI "Secret-Detection.gitlab-ci.yml could not be loaded" in CI

An include: template: for a built-in scanner (Secret Detection, SAST) could not be fetched. The template path may be wrong for your GitLab version, or the instance cannot reach the bundled template location.

What this error means

The pipeline fails to create with "Secret-Detection.gitlab-ci.yml ... could not be fetched" or "Included file ... could not be loaded". No scanning job is generated.

Pipeline Editor / CI lint
This GitLab CI configuration is invalid: Included file `Security/Secret-Detection.gitlab-ci.yml` could not be loaded

Common causes

Wrong template path for the GitLab version

Template names change between releases; an old path like Secret-Detection.gitlab-ci.yml may not exist on a newer or self-managed instance.

The instance cannot fetch the bundled template

A self-managed GitLab that is offline or misconfigured may fail to resolve template: includes.

How to fix it

Use the current template path

  1. Check the template path your GitLab version ships.
  2. Update the include: template: to the correct relative path.
  3. Re-run CI Lint to confirm the include resolves.
.gitlab-ci.yml
include:
  - template: Jobs/Secret-Detection.gitlab-ci.yml

Pin to a remote include if templates are unavailable

On an instance that cannot resolve bundled templates, reference the file via a remote URL for your version.

.gitlab-ci.yml
include:
  - remote: 'https://gitlab.com/gitlab-org/gitlab/-/raw/master/lib/gitlab/ci/templates/Jobs/Secret-Detection.gitlab-ci.yml'

How to prevent it

  • Match security template paths to your GitLab version.
  • Review template path changes in upgrade notes.
  • Prefer pinned includes on offline self-managed instances.

Frequently asked questions

What causes ""could not be loaded" (security template)"?
Template names change between releases; an old path like Secret-Detection.gitlab-ci.yml may not exist on a newer or self-managed instance.
How do I fix "could not be loaded" (security template)?
Use the current template path

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card