Skip to content

Troubleshooting GitLab CI

Sample Jobs

A job that fails at random

There are a bunch of ways to do this. Pop the following into or similar:

EXIT_CODE=$( curl --silent "" | cut -c2)
A job that tells you about your git clone/fetch results
git info check:
    - git describe --tags --always --abbrev=0
    - if test -f ".git/shallow" ; then cat .git/shallow ; else echo "nope"; fi
    - git tag --list
    - git remote -v
    - git ls-remote --tags origin
    - echo $GIT_STRATEGY
    - echo $GIT_DEPTH
    - git fetch --tags
    - git describe --tags --always --abbrev=0
    - git tag --list

Sample Projects

These are the projects I use frequently for testing miscellaneous GitLab CI things. - GitLab Smoke Tests: this is amazing and tests job artifacts and caching as well as pushing to Container Registry and Package Registry (Maven, NPM, NuGet, Helm). - detecting-secrets: A small project I put together to ensure that Secret Detection works as expected. - - -

Templates to Include

These are a few places with very interesting GitLab CI templates that can be included:

Generating .tf

Dynamically Generated Child Pipelines


External Examples and Write-Ups


Problem: remote: You are not allowed to download code from this project.

remote: You are not allowed to download code from this project.

Solution: Add yourself as a member of the project.


GitLab CI/CD doesn’t work with a Kerberos-enabled GitLab instance unless the integration is set to use a dedicated port.

The change required to get GitLab CI working in Kerberized environment is documented and amounts to updates to gitlab.rb and a gitlab-ctl reconfigure. Additionally: Git remote URLs need to be updated to use that port for Kerberos ticket-based auth to work.