Receive 403 when using DigitalOcean Spaces as S3 cache

Summary

If I configure my autoscale gitlab-runner to use S3-compatible Spaces from DigitalOcean, I get a 403 Forbidden on both pull from and push to cache.

Steps to reproduce

Configure the runners.cache to point at DigitalOcean Spaces.

Actual behavior

Checking cache for $PROJECT...
FATAL: Received: 403 Forbidden                     
Failed to extract cache

Expected behavior

That cache was successfully retrieved

Environment description

Custom installation, and docker+machine as executor

concurrent = 3
log_level = "debug"
check_interval = 0

[[runners]]
  name = "gitlab-ci-runner-auto-scale"
  url = "https://..."
  token = "..."
  executor = "docker+machine"
  limit = 3
  [runners.docker]
    tls_verify = false
    image = "node:carbon"
    privileged = true
    disable_cache = false
    volumes = ["/cache"]
  [runners.cache]
    Type = "s3"
    ServerAddress = "ams3.digitaloceanspaces.com"
    AccessKey = "$ACCESS_KEY"
    SecretKey = "$SECRET_KEY"
    BucketName = "bucket-name"
    BucketLocation = "ams3" # I've tried both with and without this option
    Insecure = false
    Path = "gitlab-ci-cache"
    Shared = true
  [runners.machine]
    ...
    MachineName = "auto-scale-%s"
    MachineDriver = "digitalocean"
    MachineOptions = [
        "digitalocean-image=coreos-stable",
        "digitalocean-ssh-user=core",
        "digitalocean-access-token=...",
        "digitalocean-region=ams3",
        "digitalocean-size=2gb",
        "digitalocean-private-networking"
    ]

Used GitLab Runner version

Version:      10.1.0
Git revision: c1ecf97f
Git branch:   10-1-stable
GO version:   go1.8.3
Built:        Sat, 21 Oct 2017 21:33:24 +0000
OS/Arch:      linux/amd64
Edited by Daniel Juhl