I’m running 10 runners on one server with docker-compose. Sometimes the pipeline failes with errors like this:
fatal: Unable to create '/builds/xxx.de/xxx.de/.git/index.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
or
Reinitialized existing Git repository in /builds/xxx.de/xxx.de/.git/
fatal: shallow file has changed since we read it
Each runner has a configuration like this, only the name, id and tokens are different:
aconcurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "runner-1-farm-1"
url = "https://git.xyz.com/"
id = 12
token = "-94xSx9-blablabla"
token_obtained_at = 2022-09-16T07:52:10Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
host = "tcp://dind:2375"
tls_verify = false
image = "registry.xyz.com/docker/docker:latest"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]
shm_size = 0
docker-compose config:
version: "3.9"
services:
dind:
image: docker:20-dind
restart: always
privileged: true
environment:
DOCKER_TLS_CERTDIR: ""
command:
- --storage-driver=overlay2
runner_1:
restart: always
image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
depends_on:
- dind
environment:
- DOCKER_HOST=tcp://dind:2375
- REGISTRATION_TOKEN=${REGISTRATION_TOKEN}
volumes:
- ./config:/etc/gitlab-runner:rw
So far, the errors only occur in one project currently.
How can I fix it?