Skip to content

CI clones fail for repositories with a path ending in a period

Summary

Initially reported by a customer in ticket: https://gitlab.zendesk.com/agent/tickets/184103 (internal use)

If a repository has a path ending in a period (.), any associated jobs will fail with a 503 response when attempting to clone the repository at the start of a job.

This does not occur on a self-managed instance running the latest release (13.6.3-ee) and seems to be specific to GitLab.com. Tested with older runner versions and the same error persists. The customer who reported the issue has a previous pipeline that passed as of a month ago, so it seems something changed within the last 30 days or so.

Steps to replicate

  1. Create a repository with a path ending in . (examplerepo.)

  2. Create a .gitlab-ci.yml that does literally anything

test:
  script:
    - echo "test"
  1. Execute a pipeline

Example and logs

I've created an example repository here. The failed pipelines all contain examples of these failures. The only passing pipeline was executed after I had briefly removed the period from the path to confirm that resolves the issue.

Snip of example job logs with debug tracing:
++ echo 'Fetching changes with git depth set to 50...'
++ mkdir -p /builds/calebw/dotreponame..tmp/git-template
++ git config -f /builds/calebw/dotreponame..tmp/git-template/config fetch.recurseSubmodules false
++ git init /builds/calebw/dotreponame. --template /builds/calebw/dotreponame..tmp/git-template
++ cd /builds/calebw/dotreponame.
++ rm -f .git/index.lock
++ rm -f .git/shallow.lock
++ rm -f .git/HEAD.lock
++ rm -f .git/hooks/post-checkout
++ git remote add origin https://gitlab-ci-token:[MASKED]@gitlab.com/calebw/dotreponame..git
++ echo 'Created fresh repository.'
++ git fetch origin +refs/pipelines/232080903:refs/pipelines/232080903 +refs/heads/master:refs/remotes/origin/master --depth 50 --prune --quiet
fatal: unable to access 'https://gitlab.com/calebw/dotreponame..git/': The requested URL returned error: 503
Cleaning up file based variables
00:01
+ set -eo pipefail
+ set +o noclobber
+ :
+ eval '$'\''rm'\'' "-f" "/builds/calebw/dotreponame..tmp/CI_SERVER_TLS_CA_FILE"
'
++ rm -f /builds/calebw/dotreponame..tmp/CI_SERVER_TLS_CA_FILE
+ exit 0
ERROR: Job failed: command terminated with exit code 1