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

If you are using GitLab 17.5 with a distributed cache based on MinIO, you will need to adjust the runner configuration following 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 the shared cache server. 
Instead, a local version of the 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 is attempting 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 (MinIO) 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 Option 2

Add the feature flag FF_USE_LEGACY_S3_CACHE_ADAPTER to the GitLab Runner environment configuration:

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

  # [..]

  environment = ["FF_USE_LEGACY_S3_CACHE_ADAPTER=1"]


After that, you won’t need to specify a region, and the pre-signed S3 URL can be generated again without any issues.



Sources