Skip to content

[AWS S3] Seems like after upgrading to 1.52 it is mandatory to grant CreateBucket permission #4297

Closed

Description

@shamil

What is the problem you are having with rclone?

Related to AWS S3 remote

Seems like after upgrading to rclone 1.52 it is mandatory to grant CreateBucket permission, otherwise even simple operations like copy/copyto or move/moveto are failing.

What is your rclone version (output from rclone version)

rclone v1.52.0
- os/arch: linux/amd64
- go version: go1.14.3

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

Which cloud storage system are you using? (eg Google Drive)

AWS S3

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone copy "/data/ongdb/data/backup/2020-06-02.tar.gz" "s3:redacted-bucket-name/backups/ongdb/staging" 

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

020/06/02 11:19:46 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2020/06/02 11:19:46 ERROR : 2020-06-02.tar.gz: Failed to copy: AccessDenied: Access Denied
        status code: 403, request id: A3EA8A40CED9BA4A, host id: rvDxoBl47BzL4nuRg8ANST+QL3j2ucekPmzAcHd64GOIhTVKKpus+/CRsILtzx61agYxsLQEi8Q=
2020/06/02 11:19:46 ERROR : 2020-06-02.tar.gz: Not deleting source as copy failed: AccessDenied: Access Denied
        status code: 403, request id: A3EA8A40CED9BA4A, host id: rvDxoBl47BzL4nuRg8ANST+QL3j2ucekPmzAcHd64GOIhTVKKpus+/CRsILtzx61agYxsLQEi8Q=
2020/06/02 11:19:46 ERROR : Attempt 2/3 failed with 1 errors and: AccessDenied: Access Denied
        status code: 403, request id: A3EA8A40CED9BA4A, host id: rvDxoBl47BzL4nuRg8ANST+QL3j2ucekPmzAcHd64GOIhTVKKpus+/CRsILtzx61agYxsLQEi8Q=
2020/06/02 11:19:46 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2020/06/02 11:19:46 DEBUG : HTTP REQUEST (req 0xc000230600)
2020/06/02 11:19:46 DEBUG : HEAD /redacted-bucket-name/backups/ongdb/staging/2020-06-02.tar.gz HTTP/1.1
Host: s3.amazonaws.com
User-Agent: rclone/v1.52.0
Authorization: XXXX
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20200602T111946Z
X-Amz-Security-Token: <removed>
2020/06/02 11:19:46 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2020/06/02 11:19:46 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2020/06/02 11:19:46 DEBUG : HTTP RESPONSE (req 0xc000230600)
2020/06/02 11:19:46 DEBUG : HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Tue, 02 Jun 2020 11:19:46 GMT
Server: AmazonS3
X-Amz-Delete-Marker: true
X-Amz-Id-2: LObJ0VYt8F/7aQ9Je7/xmXlQropS+o2MEsmyKW+jHvQdFzrS1vtltWKErUw7rSOrBdldKLUu6Uw=
X-Amz-Request-Id: 751113EE970D6558
X-Amz-Version-Id: ygLbkS9g_Swg6WgTN2pcjuahmv4mXIn0
2020/06/02 11:19:46 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2020/06/02 11:19:46 DEBUG : 2020-06-02.tar.gz: Need to transfer - File not found at Destination
2020/06/02 11:19:46 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2020/06/02 11:19:46 DEBUG : HTTP REQUEST (req 0xc0009e6200)
2020/06/02 11:19:46 DEBUG : PUT /redacted-bucket-name HTTP/1.1
Host: s3.amazonaws.com
User-Agent: rclone/v1.52.0
Content-Length: 0
Authorization: XXXX
X-Amz-Acl: private
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20200602T111946Z
X-Amz-Security-Token: <removed>
Accept-Encoding: gzip
2020/06/02 11:19:46 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2020/06/02 11:19:46 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2020/06/02 11:19:46 DEBUG : HTTP RESPONSE (req 0xc0009e6200)
2020/06/02 11:19:46 DEBUG : HTTP/1.1 403 Forbidden
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Tue, 02 Jun 2020 11:19:46 GMT
Server: AmazonS3
X-Amz-Id-2: pqfcM+dsq4PB7iw1PADA1NkSOcDewJD4CP1iGV/PN5/0xlKykO7FTLebmtwMyTk+Lq8OKWSyoDM=
X-Amz-Request-Id: 19D0F6CACECDC627
f3
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>19D0F6CACECDC627</RequestId><HostId>pqfcM+dsq4PB7iw1PADA1NkSOcDewJD4CP1iGV/PN5/0xlKykO7FTLebmtwMyTk+Lq8OKWSyoDM=</HostId></Error>
0
2020/06/02 11:19:46 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2020/06/02 11:19:46 ERROR : 2020-06-02.tar.gz: Failed to copy: AccessDenied: Access Denied
        status code: 403, request id: 19D0F6CACECDC627, host id: pqfcM+dsq4PB7iw1PADA1NkSOcDewJD4CP1iGV/PN5/0xlKykO7FTLebmtwMyTk+Lq8OKWSyoDM=
2020/06/02 11:19:46 ERROR : 2020-06-02.tar.gz: Not deleting source as copy failed: AccessDenied: Access Denied
        status code: 403, request id: 19D0F6CACECDC627, host id: pqfcM+dsq4PB7iw1PADA1NkSOcDewJD4CP1iGV/PN5/0xlKykO7FTLebmtwMyTk+Lq8OKWSyoDM=
2020/06/02 11:19:46 ERROR : Attempt 3/3 failed with 1 errors and: AccessDenied: Access Denied
        status code: 403, request id: 19D0F6CACECDC627, host id: pqfcM+dsq4PB7iw1PADA1NkSOcDewJD4CP1iGV/PN5/0xlKykO7FTLebmtwMyTk+Lq8OKWSyoDM=
2020/06/02 11:19:46 INFO  : 
Transferred:             0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors:                 1 (retrying may help)
Checks:                 3 / 3, 100%
Elapsed time:         0.2s
2020/06/02 11:19:46 DEBUG : 4 go routines active
2020/06/02 11:19:46 Failed to move: AccessDenied: Access Denied
        status code: 403, request id: 19D0F6CACECDC627, host id: pqfcM+dsq4PB7iw1PADA1NkSOcDewJD4CP1iGV/PN5/0xlKykO7FTLebmtwMyTk+Lq8OKWSyoDM=

IAM role permissions

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetBucketLocation",
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::redacted-bucket-name"
            ]
        },
        {
            "Action": [
                "s3:*"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::redacted-bucket-name/backups",
                "arn:aws:s3:::redacted-bucket-name/backups/*"
            ]
        }
    ]
}

Activity

  1. ncw commented on Jun 2, 2020

    @ncw
    Member

    Ah, I think this error code was being silently masked until e2bf914 was fixed.

    Can you try this which stops rclone trying to create the bucket in the first place?

    https://beta.rclone.org/branch/v1.52.0-021-gcb7d5520-fix-4297-s3-mkdir-beta/ (uploaded in 15-30 mins)

  2. added this to the v1.52.x milestone on Jun 2, 2020
  3. shamil commented on Jun 2, 2020

    @shamil
    Author

    @ncw amazing, I can validate that with the proposed beta it works as expected.
    Thanks. If we could have a patch version with this fix, that would be great. Since we prefer not to keep the permission for creating new bucket for long time.

    Thanks again for quick response.

  4. ncw commented on Jun 2, 2020

    @ncw
    Member

    Thanks for testing :-)

    I've merged this to master now which means it will be in the latest beta in 15-30 mins and released in v1.52.1 which will be out in a few days hopefully.

  5. added a commit that references this issue on Jun 9, 2020
    723c1df
  6. added a commit that references this issue on Jun 12, 2020
    99260d5
  7. added a commit that references this issue on Aug 21, 2020
  8. ncw commented on Aug 21, 2020

    @ncw
    Member

    @shamil I've had to adjust this fix as it contained an incorrect assumption. This breaks the fix as-is.

    However if you try the latest beta with the --s3-assume-bucket-exists you should find it works fine for you 🤞

  9. daskol commented on Dec 14, 2020

    @daskol

    Why does rclone not assume that a bucket exists on default? Such behaviour is highly misleading especially if one does not use common S3 provider.

  10. ncw commented on Dec 18, 2020

    @ncw
    Member

    Rclone will create the bucket for you (just like it creates directories for you) - that is why it doesn't assume the bucket exists.

  11. added 2 commits that reference this issue on Jul 20, 2026
    2c2d0e7
    d92e95a
  12. added a commit that references this issue on Nov 21, 2026
    decec2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions