B
B
Boris Dergachev2019-08-20 21:42:23
Continuous Integration
Boris Dergachev, 2019-08-20 21:42:23

How to fix gitlab-runner-cache lookup error when running docker from gitlab-runner?

I'm trying to run a build via gitlab-runner docker:

$ gitlab-runner exec docker build:deb
ERRO[0000] Docker executor: prebuilt image helpers will be loaded from /var/lib/gitlab-runner. 
Running with gitlab-runner 11.2.0 (11.2.0)
Using Docker executor with image debian:buster ...
ERROR: Preparation failed: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"gitlab-runner-cache\": executable file not found in $PATH": unknown (executor_docker.go:412:0s)
Will be retried in 3s ...
Using Docker executor with image debian:buster ...
ERROR: Preparation failed: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"gitlab-runner-cache\": executable file not found in $PATH": unknown (executor_docker.go:412:0s)
Will be retried in 3s ...
Using Docker executor with image debian:buster ...
ERROR: Preparation failed: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"gitlab-runner-cache\": executable file not found in $PATH": unknown (executor_docker.go:412:0s)
Will be retried in 3s ...
ERROR: Job failed (system failure): Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"gitlab-runner-cache\": executable file not found in $PATH": unknown (executor_docker.go:412:0s)
FATAL: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"gitlab-runner-cache\": executable file not found in $PATH": unknown (executor_docker.go:412:0s)

Contents of .gitlab-ci.yml:
stages:
  - build

build:deb:
  stage: build
  image: debian:buster
  tags:
  - deb
  before_script:
  - mkdir build && cd build
  - apt install cmake
  script:
  - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DRA_STATIC_LINK=ON ..
  - cmake --build . -- -j 8
  artifacts:
    paths:
    - build/run

How to fix the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
klirichek, 2021-08-12
@klirichek

There is some confusion about packages. From the "official" distribution repository very often does not fit.
The problem with them is that they refer to an external docker image tag that can go rotten. Then the runner does not have access to the images where the auxiliary binaries it needs to work are located, and everything falls down.

sudo apt-get remove gitlab-runner
sudo curl -L https://packages.gitlab.com/install/repositories/r... | sudo bash
sudo apt-get install gitlab-runner

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question