Even with `cache: {}` in gitlab-ci.yml, cache is used amongst different pipelines and jobs

Summary

With a .gitlab-ci.yml that specifically denies usage of cache, jobs run with cache from previous jobs.

Steps to reproduce

Sample small real-life .gitlab.yml from our project which presents the problem:

cache: {}

stages:
  - deploy

build:
  stage: deploy
  image: registry.xxxxxxx.com/build/jessie64
  script:
    - ls -la ../
    - dpkg-buildpackage -us -uc

Sample /etc/gitlab-runner/config.toml from one of our runners:

concurrent = 2
check_interval = 0

[[runners]]
  name = "docker-03"
  url = "https://gitlab.xxxxxxxx.com/"
  token = "066bb92025xxxxxxxxxxxxxxxx"
  output_limit = 16384
  executor = "docker"
  pull_policy = "always"
  [runners.docker]
    tls_verify = false
    image = "debian:stable-slim"
    privileged = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
  [runners.cache]

What is the current bug behavior?

Output of ls command from gitlab-ci:

drwxrwxrwx 4 root root  4096 Oct  8 22:14 .
drwxr-xr-x 3 root root  4096 Oct  8 22:17 ..
-rw-r--r-- 1 root root 13212 Oct  8 22:10 xxxxx-yyyy-debug_2.0.2_amd64.deb
-rw-r--r-- 1 root root 13222 Oct  8 22:14 xxxxx-yyyy-debug_2.0.3_amd64.deb
-rw-r--r-- 1 root root 13720 Oct  8 22:10 xxxxx-yyyy-release_2.0.2_amd64.deb
-rw-r--r-- 1 root root 13732 Oct  8 22:14 xxxxx-yyyy-release_2.0.3_amd64.deb

What is the expected correct behavior?

Folder should be clean and not contain previous packages from other jobs/pipelines.

Output of ls command from gitlab-ci:

drwxrwxrwx 4 root root  4096 Oct  8 22:14 .
drwxr-xr-x 3 root root  4096 Oct  8 22:17 ..

Results of GitLab application Check

Not root on gitlab machine (root on gitlab runners though)

Misc

  • Clearing the runner cache makes the problem disappear for a little while.
  • This being pretty problematic for us, I temporarily disabled cache globally in config.toml on all runners.
Assignee Loading
Time tracking Loading