No URL provided, cache will not be downloaded from shared cache server - GitLab 17.5 with MinIO

If you are using GitLab 17.5 with a distributed cache based on MinIO, an adjustment of the runner configuration is required since the GitLab 17.5 update.



Error message (pipeline)

Skipping Git submodules setup
Restoring cache
00:00
Checking cache for ...
No URL provided, cache will not be downloaded from shared cache server.
Instead a local version of cache will be extracted.                    


Error message (Runner)

Oct 18 14:00:00 sXXXX.creolineserver.com gitlab-runner[PID]:

ERROR: error while generating S3 pre-signed URL error=operation error S3:
GetObject, failed to resolve service endpoint, endpoint rule error, A region must be set when
sending requests to S3


The error occurs because the GitLab pipeline tries to generate a pre-signed S3 URL. However, this command fails because the new AWS SDK v2 for Go adapter requires a REGION configuration.



Troubleshooting

In your GitLab-Runner environment configuration, add the region configured in MinIO as BucketLocation:

[[runners]]
  name = "sXXXXX.creolineserver.com"

 [runners.cache]
    Type = "s3"
    Shared = true
    [runners.cache.s3]
      ServerAddress = "sXXXX.creoline.cloud"
      AccessKey = "**********"
      SecretKey = "**********"
      BucketName = "gitlab-distributed-cache"

      # [...]

      BucketLocation = "us-east-1"


If you have not defined a region in your Distributed Cache (MiniIO) server, the default region value is: us-east-1.


If you want to change the MinIO region, log in to the MinIO web interface and navigate to MinIO Configuration → Region → Server Location.



Solution variant 2

Add the feature flag FF_USE_LEGACY_S3_CACHE_ADAPTER in the GitLab-Runner environment configuration:

[[runners]]
  name = "sXXXXX.creolineserver.com"

  # [..]

  environment = ["FF_USE_LEGACY_S3_CACHE_ADAPTER=1"]


Afterwards, no specification of the region is required and the pre-signed S3 URL can be generated again without any problems.



Sources