.gitlab-ci.yml
with the pipeline editor
.gitlab-ci.yml
locally
group/project
not found or access denied
.gitlab-ci.yml
file
GitLab provides several tools to help make troubleshooting your pipelines easier.
This guide also lists common issues and possible solutions.
.gitlab-ci.yml
with the pipeline editor
The pipeline editor is the recommended editing experience (rather than the single file editor or the Web IDE). It includes:
.gitlab-ci.yml
file.
.gitlab-ci.yml
locally
If you prefer to edit your pipeline configuration locally, you can use the GitLab CI/CD schema in your editor to verify basic syntax issues. Any editor with Schemastore support uses the GitLab CI/CD schema by default.
If you need to link to the schema directly, it is at:
https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/editor/schema/ci.json
To see the full list of custom tags covered by the CI/CD schema, check the latest version of the schema.
The
CI Lint tool
is a simple way to ensure the syntax of a CI/CD configuration
file is correct. Paste in full
.gitlab-ci.yml
files or individual jobs configuration,
to verify the basic syntax.
When a
.gitlab-ci.yml
file is present in a project, you can also use the CI Lint
tool to
simulate the creation of a full pipeline
.
It does deeper verification of the configuration syntax.
Export the full list of variables available in each problematic job. Check if the variables you expect are present, and check if their values are what you expect.
The
complete
.gitlab-ci.yml
reference
contains a full list of
every keyword you can use to configure your pipelines.
You can also look at a large number of pipeline configuration examples and templates .
Troubleshooting guides are available for some CI/CD features and related topics:
If your
rules
or
only/except
configuration makes use of
predefined variables
like
CI_PIPELINE_SOURCE
,
CI_MERGE_REQUEST_ID
, you should
verify them
as the first troubleshooting step.
If you are converting from
only/except
to the
rules
keyword, you should check
the
rules
configuration details
carefully. The behavior
of
only/except
and
rules
is different and can cause unexpected behavior when migrating
between the two.
The
common
if
clauses for
rules
can be very helpful for examples of how to write rules that behave the way you expect.
This situation is usually caused by the
rules
configuration, and there are several ways to
prevent duplicate pipelines
.
GitLab determines if a job is added to a pipeline based on the
only/except
or
rules
defined for the job. If it didn’t run, it’s probably
not evaluating as you expect.
It’s also possible that your
workflow: rules
configuration
blocked the pipeline, or allowed the wrong pipeline type.
A Pipeline that has more jobs than the instance’s defined CI/CD limits fails to start.
To reduce the number of jobs in your pipeline, you can split your
.gitlab-ci.yml
configuration using
parent-child pipelines
.
The
changes
keyword is used in combination with
only/except
or
rules
). It’s recommended to use
changes
with
rules
or
only/except
configuration that ensures the job is only added to branch
pipelines or merge request pipelines.
Introduced in GitLab 12.4.
Previously, you’d have encountered unexpected pipeline failures when you force-pushed a branch to its remote repository. To illustrate the problem, suppose you’ve had the current workflow:
example
and pushes it to a remote repository.
example
branch.
example
branch on the latest default branch and force-pushes it to its remote repository.
example
branch again, however,
the previous pipeline (2) fails because of
fatal: reference is not a tree:
error.
This occurs because the previous pipeline cannot find a checkout-SHA (which is associated with the pipeline record)
from the
example
branch that the commit history has already been overwritten by the force-push.
Similarly,
Merged results pipelines
might have failed intermittently due to
the same reason
.
As of GitLab 12.4, we’ve improved this behavior by persisting pipeline refs exclusively. To illustrate its life cycle:
example
.
refs/pipelines/<pipeline-id>
,
which retains the checkout-SHA of the associated pipeline record.
This persistent ref stays intact during the pipeline execution,
even if the commit history of the
example
branch has been overwritten by force-push.
The merge request pipeline widget shows information about the pipeline status in a merge request. It’s displayed above the ability to merge status widget .
There is a
known issue
where a merge request can be stuck with the
Checking ability to merge automatically
message.
If your merge request has this message and it does not disappear after a few minutes, you can try one of these workarounds:
/rebase
quick action
.
/merge
quick action.
After the pipeline is created, the message updates with the pipeline status.
The merge request status widget shows:
This message is shown if the Pipelines must succeed setting is enabled in the project and a pipeline has not yet run successfully. This also applies if the pipeline has not been created yet, or if you are waiting for an external CI service. If you don’t use pipelines for your project, then you should disable Pipelines must succeed so you can accept merge requests.
This message is shown if the merge request pipeline , merged results pipeline , or merge train pipeline has failed or been canceled. This does not happen when a basic branch pipeline fails.
If a merge request pipeline or merged result pipeline was canceled or failed, you can:
If the merge train pipeline has failed, you can:
/merge
quick action
to immediately add the merge request to the train again.
If the merge train pipeline was canceled before the merge request was merged, without a failure, you can:
group/project
not found or access denied
This message is shown if configuration is added with
include
and one of the following:
To resolve this, check that:
my-group/my-project
and does not include
any folders in the repository.
To reduce the configuration size, you can:
script
sections into standalone scripts in the project.
On a self-managed instance, you can increase the size limits .
.gitlab-ci.yml
file
A
loop of included configuration files
can cause a
500
error when editing the
.gitlab-ci.yml
file with the
web editor
.
The configuration for a pipeline is only fetched when the pipeline is created.
When you rerun a job, uses the same configuration each time. If you update configuration files,
including separate files added with
include
, you must
start a new pipeline to use the new configuration.
This error can happen if the following are both true:
The recommended solution is to add your project to the private project’s job token scope allowlist .
Pipeline configuration warnings are shown when you:
When you use
rules
with a
when
clause without an
if
clause, multiple pipelines may run. Usually this occurs when you push a commit to
a branch that has an open merge request associated with it.
To
prevent duplicate pipelines
, use
workflow: rules
or rewrite your rules to control
which pipelines can run.
resource_group
gets stuck
When clearing a large backlog of jobs, you can temporarily enable the
ci_queueing_disaster_recovery_disable_fair_scheduling
feature flag
. This flag disables fair scheduling
on shared runners, which reduces system resource usage on the
jobs/request
endpoint.
When enabled, jobs are processed in the order they were put in the system, instead of balanced across many projects.
To disable the enforcement of
compute quotas
on shared runners, you can temporarily
enable the
ci_queueing_disaster_recovery_disable_quota
feature flag
.
This flag reduces system resource usage on the
jobs/request
endpoint.
When enabled, jobs created in the last hour can run in projects which are out of quota.
Earlier jobs are already canceled by a periodic background worker (
StuckCiJobsWorker
).
The following commands are run in the rails console .
.gitlab-ci.yml
file
If you are unable to resolve pipeline issues, you can get help from:
If you didn't find what you were looking for,
search the docs
.
If you want help with something specific and could use community support,
post on the GitLab forum
.
For problems setting up or using this feature (depending on your GitLab
subscription).