GitLab Runner: Cache adapter could not be initialized: missing S3 configuration

Sometimes GitLab Runner cache stops working after upgrading. Example here with gitlab-runner 12.0.1.

No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
Sep 3 13:32:29 review gitlab-runner[354]: ERROR: Could not create cache adapter error=cache adapter could not be initialized: missing S3 configuration

Old Configuration

[[runners]]
  name = "review"
  url = "https://gitlabserver:443/ci/"
  token = "token"
  executor = "shell"
  output_limit = 12288
  builds_dir = "/data/builds"
  cache_dir = "/data/cache"
  [runners.cache]
    Type = "s3"
    ServerAddress = "s3.amazonaws.com"
    AccessKey = "AccessKey"
    SecretKey = "SecretKey"
    BucketName = "BucketName"
    BucketLocation = "eu-central-1"
    Insecure = false
    Path = "cache"
    Shared = true

Since GitLab Runner 11.3.0, S3-related configuration parameters were moved to a dedicated [runners.cache.s3] section. The old syntax with S3 configured directly under [runners.cache] was deprecated in 11.3.0 and removed in 12.0.0.

Updated Configuration

[[runners]]
  name = "review"
  url = "https://gitlabserver:443/ci/"
  token = "token"
  executor = "shell"
  output_limit = 12288
  builds_dir = "/data/builds"
  cache_dir = "/data/cache"
  [runners.cache]
    Type = "s3"
    Path = "cache"
    Shared = true
    [runners.cache.s3]
      ServerAddress = "s3.amazonaws.com"
      AccessKey = "AccessKey"
      SecretKey = "SecretKey"
      BucketName = "BucketName"
      BucketLocation = "eu-central-1"
      Insecure = false

Works perfectly with gitlab-runner 12.2.0.

Human Logic, AI Syntax... Note on Content: I'm a Systems Engineer, not a native English writer. To ensure my technical ideas are clear and accessible, I use AI tools to polish the grammar and style. The workflow is simple: I provide the logic, the code, and the real-world experience. The AI handles the "English-to-Human" translation layer. If you find a bug, that's on me. If you find a perfectly placed comma, that's probably the AI.

Comments

Post a Comment

Popular posts from this blog

FreeRadius with Google Workspace LDAP

Fixing pssh (parallel-ssh) Problems on Debian 10 with Python 3.7