Repository navigation
Closed
Labels
Milestone
Description
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/*"
]
}
]
}Reacted by Daniel Bershatsky
Activity
ncw commentedon Jun 2, 2020
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)
shamil commentedon Jun 2, 2020
@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.
ncw commentedon Jun 2, 2020
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.
s3: fix upload of single files into buckets without create permission
s3: fix upload of single files into buckets without create permission
s3: fix detection of bucket existing
ncw commentedon Aug 21, 2020
@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 🤞
daskol commentedon Dec 14, 2020
Why does
rclonenot assume that a bucket exists on default? Such behaviour is highly misleading especially if one does not use common S3 provider.ncw commentedon Dec 18, 2020
Rclone will create the bucket for you (just like it creates directories for you) - that is why it doesn't assume the bucket exists.
s3: fix upload of single files into buckets without create permission
s3: fix detection of bucket existing
s3: fix upload of single files into buckets without create permission