title: Gitlab Runner S3 Distributed Cache Not Working
body: <p>I am currently trying to implement a shared s3 distributed cache for our Gitlab runners, but the configuration does not appear to be working as intended.</p>
  
  <p>Below is my <code>config.toml</code> file:</p>
  
  <pre><code>concurrent = 1
  check_interval = 0
  
  [[runners]]
    name = "gitlab-runner-1"
    url = "https://gitlab.com/"
    token = "XXX"
    executor = "docker"
    [runners.docker]
      tls_verify = false
      image = "alpine:latest"
      privileged = true
      disable_cache = false
      shm_size = 0
    [runners.cache]
      Type = "s3"
      Shared = true
      [runners.cache.s3]
        ServerAddress = "s3.amazonaws.com"
        AccessKey = "XXX"
        SecretKey = "XXX"
        BucketName = "XXX"
        BucketLocation = "eu-west-2"
        Insecure = false
  </code></pre>
  
  <p>And here is my <code>.gitlab-ci.yml</code> file:</p>
  
  <pre><code>image: registry.gitlab.com/&lt;image&gt;
  
  services:
    - docker:dind
  
  cache:
    untracked: true
    key: $ECR_REPO
    paths:
      - "sbt-cache/ivy/cache"
      - "sbt-cache/boot"
      - "sbt-cache/sbtboot"
  
  stages:
    - build
  
  build:
    image: hseeberger/scala-sbt:8u151-2.12.4-1.1.1
    stage: build
    before_script: []
    script:
      - sbt test
  </code></pre>
  
  <p>The caching is working only on a local level, but when a job is picked up by a different runner it downloads all of the required data again. The S3 bucket is empty and the log from the pipeline job does not reference anything about the S3 bucket.</p>
  
  <p>All AWS permissions are set up appropriately.</p>
  
  <p>Gitlab Runner version: <code>12.1.0 (de7731dd)</code></p>
  
  <p>I tried many different configurations but none seem to work.</p>