drone-plugins / drone-s3-cache

Caches build artifacts to S3 compatible storage backends

Home Page:http://plugins.drone.io/drone-plugins/drone-s3-cache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin suddenly stopped working

jtallinger opened this issue · comments

Hi,

I have been using the S3 cache plugin successfully for a couple of months, but now it suddenly stopped working and giving a validation error.

My yaml build step:

- name: cache-restore
  image: plugins/s3-cache
  settings:
    pull: true
    endpoint: https://s3.eu-central-1.amazonaws.com
    region: eu-central-1
    restore: true
    root: /mybucket/

Error:
“validation failed: region eu-central-1 already specified in endpoint remove from config”

I removed the region-value and tried again, then build step is passed as succeeding, but when inspecting closer it actually failed:

Status: Image is up to date for plugins/s3-cache:latest
4 time=“2020-08-19T10:47:12Z” level=info msg=“mode specified using boolean config” flush=false rebuild=false restore=true
5 time=“2020-08-19T10:47:12Z” level=info msg=“using mode” mode=restore
6 time=“2020-08-19T10:47:12Z” level=info msg=“region found in S3 endpoint” region=eu-central-1
7 time=“2020-08-19T10:47:12Z” level=info msg=“using S3 endpoint” endpoint=s3.amazonaws.[com] use-ssl=true
8 time=“2020-08-19T10:47:12Z” level=info msg=“restoring cache” fallback=/mybucket/master/archive.tar path=/mybucket/master/archive.tar
9 time=“2020-08-19T10:47:12Z” level=info msg=“downloading file” bucket=mybucket key=master/archive.tar
10 time=“2020-08-19T10:48:01Z” level=warning msg=“Cache could not be restored error when accessing bucket mybucket: Head “https://mybucket.s3.dualstack.us-east-1.amazonaws.com/”: 301 response missing Location header”
11 time=“2020-08-19T10:48:01Z” level=info msg=“cache restored”

us-east-1? 301 response?

Then build continued anyway and when reaching the step to rebuild the cache, which normally takes 15-30s, well now it is still sitting at that step 30 minutes later.

Any idea what has happened? Some change in the plugin recently?

Hey @jtallinger I think this PR will fix your issue. The s3 cache plugin got some refactoring due to other issues cropping up and I didn't see this in my testing.

Please reopen if that doesn't solve things for you and I'll keep debugging.

Thank you for swift action! Problem solved.