GitLab: "config contains unknown keys"
GitLab reports <keyword> config contains unknown keys: <key-name> when a keyword it does not know is where it expected another. GitLab names two causes: a typo in a keyword (imag instead of image), and a keyword at the wrong indentation (GitLab docs: debugging CI/CD pipelines, checked November 19, 2026).
GitLab's example
test-job:
artifacts:
path: # This is a typo, it should be `paths`
- test
image: test # This indentation is incorrect, it should be at the same level as `script`.
script:
- echo
Both mistakes give a message of that form, with the name of the key GitLab did not know at the end. The part before config contains unknown keys names the keyword whose contents it did not understand, so start there.
To see the error next to the pipeline that failed: Pipelines and Jobs Inbox for GitLab CI, a plugin for JetBrains IDEs, shows under a pipeline that failed before any job ran the messages GitLab gives, such as a configuration error.
Check it
- Pipeline editor: GitLab recommends it for editing
.gitlab-ci.yml; it completes only accepted keywords and validates the file. - CI Lint: paste the file or a single job in the CI Lint tool to verify the syntax without starting a pipeline. A pipeline with a syntax problem shows a
yaml invalidbadge and does not start. - Compare the name with the CI/CD YAML syntax reference keyword by keyword, and check which level each keyword belongs to.
The same pipeline can fail with no jobs for other reasons: GitLab pipeline failed with no jobs.
GitLab pipelines in IntelliJ IDEA
Pipelines and Jobs Inbox for GitLab CI, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pipelines of your GitLab projects with their jobs by stage. Under a pipeline that failed before any job ran it shows the messages GitLab gives (errorMessages), such as the configuration error, and it shows YAML errors as GitLab reports them, so you read the error without opening GitLab. After you fix the file, you can run a new pipeline on the branch from the IDE (Pro). Reading is free; retrying, cancelling and running are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.
More: GitLab pipeline failed with no jobs · GitLab "config should contain either a trigger or a needs:pipeline" · GitLab "config should be an array of hashes" (!reference) · GitLab "This GitLab CI configuration is invalid" in rules:if