Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

v1.2.0 breaks EC2 IAM role bucket access #188

Closed
jimsheldon opened this issue Sep 30, 2021 · 0 comments · Fixed by #187
Closed

v1.2.0 breaks EC2 IAM role bucket access #188

jimsheldon opened this issue Sep 30, 2021 · 0 comments · Fixed by #187
Labels
bug Something isn't working

Comments

@jimsheldon
Copy link

jimsheldon commented Sep 30, 2021

Describe the bug

v1.2.0 introduced a regression where EC2 instances that had been using their instance role to access an S3 bucket can't anymore:

level=error name=drone-cache ts=2021-09-30T12:11:38.462747703Z caller=main.go:601 err=\"[IMPORTANT] restore cache, restore failed, download from <masfsearch/1/maven-repo> to <./maven-repo>, extract files from downloaded archive, pipe reader failed, tar reader <get file from storage backend, pipe writer failed, get the object, AccessDenied: Access Denied\n\tstatus code: 403, request id: 28D3T3K1F818TDS2, host id: iGaoRvybXfPFR6A1ECpSJDIml2o5uU1X6o6ZYzhm08EKrsUzFXo0Y9lnYqOCOe3CKdhCPWG9Ix0=>, archive not readable\n\"

To Reproduce
Steps to reproduce the behavior:

  1. On an AWS EC2 instance where its instance role gives it read/write access to an S3 bucket, run a pipeline step like this:
  - name: cache-restore
    pull: if-not-exists
    image: meltwater/drone-cache:v1.2.0
    settings:
      cache_key: '1'
      bucket: my-s3-bucket
      region: eu-west-1
      mount:
        - ./maven-repo
      restore: true

Expected behavior
The plugin should use the instance role of the agent to authenticate and pull files from the S3 bucket.

This seems to have started with #133

@jimsheldon jimsheldon added the bug Something isn't working label Sep 30, 2021
cmckeen added a commit that referenced this issue Oct 1, 2021
* Only use anon credentials for public s3 buckets

Fixes #188
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant