Sync from AWS S3 to local hangs

What is the problem you are having with rclone?

I'm trying to mirror the Zimbra repositories, for which they provide a public endpoint from S3. Their own documentation have example incantations using the aws CLI, like:

aws s3 sync s3:// ./repo --no-sign-request --delete

And I figured that I could use rclone instead of the AWS client. Listing the remote with:

rclone ls :s3,provider=AWS,

seems successful (note that I'm using the on-the-fly backend generation with a connection string.) However, when I try to use the sync command, rclone will hang.

Run the command 'rclone version' and share the full output of the command.

rclone v1.59.1
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-43-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.5
- go/linking: static
- go/tags: none

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


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

rclone sync :s3,provider=AWS, ./repo

The rclone config contents with secrets removed.

(none since I'm using connection strings)

A log from the command with the -vv flag

2022/08/11 16:27:27 DEBUG : rclone: Version "v1.59.1" starting with parameters ["rclone" "-vv" "sync" ":s3,provider=AWS," "./repo/"]
2022/08/11 16:27:27 DEBUG : Creating backend with remote ":s3,provider=AWS,"
2022/08/11 16:27:27 DEBUG : :s3: detected overridden config - adding "{rdsIh}" suffix to name
2022/08/11 16:27:27 NOTICE: Config file "/home/user/.config/rclone/rclone.conf" not found - using defaults
2022/08/11 16:27:28 DEBUG : fs cache: renaming cache item ":s3,provider=AWS," to be canonical ":s3{rdsIh}:repo/apt"
2022/08/11 16:27:28 DEBUG : Creating backend with remote "./repo/"
2022/08/11 16:27:28 DEBUG : fs cache: renaming cache item "./repo/" to be canonical "/home/user/tmp/zimbra/repo"

hello and welcome to the forum,

rclone needs certain basic information, as requested when creating a remote.
so if you want to use connection string, need to supply info such as client id/secret, etc.

aws s3 tools create their own config files, which rclone can use as is.

and provider=AWS should be provider=Other

Thank you!

Indeed. Since this particular source is available for anonymous users, I followed rclone's own documentation for those cases. This is the resulting command with the full connection string:

rclone sync :s3,provider=AWS,,env_auth=false,
  storage_class='':repo/apt ./repo

(line broken for readability)

And still Iḿ faced with the same issue: a simple ls will properly list all the remote files but a sync will stay there, hung.

Honestly, I did not want to install the AWS tools, but thanks to your comment I will; and continue debugging this.

and that debug log is the complete debug log, rclone does not append anything after that?

this worked

+ rclone copy -vv /home/user01/zork :s3,provider=Wasabi,access_key_id=redacted,secret_access_key=redacted,
DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "copy" "-vv" "/home/user01/zork" ":s3,provider=Wasabi,access_key_id=redacted,secret_access_key=redacted,"]
DEBUG : Creating backend with remote "/home/user01/zork"
DEBUG : Using config file from "/home/user01/.config/rclone/rclone.conf"
DEBUG : Creating backend with remote ":s3,provider=Wasabi,access_key_id=redacted,secret_access_key=redacted,"
DEBUG : :s3: detected overridden config - adding "{NylMo}" suffix to name
DEBUG : fs cache: renaming cache item ":s3,provider=Wasabi,access_key_id=redacted,secret_access_key=redacted," to be canonical ":s3{NylMo}:zork"
DEBUG : S3 bucket zork: Waiting for checks to finish
DEBUG : S3 bucket zork: Waiting for transfers to finish
DEBUG : zork1.dat: md5 = b732a93a6244ddd92a9b9a3e3a46c687 OK
INFO  : zork1.dat: Copied (new)

That seems to work fine for me. I am not sure the hang is what you think as I think it's just slow.

rclone ls works fine for me and returns stuff:

rclone ls :s3,provider=AWS,,env_auth=false,access_key_id='',secret_access_key='',region=us-east-1,location_constraint='',acl=private,server_side_encryption='',storage_class='':repo/apt

anything else takes forever as I'm not familiar with whatever that is.

 rclone ls :s3,provider=AWS,,env_auth=false,access_key_id='',secret_access_key='',region=us-east-1,location_constraint='',acl=private,server_side_encryption='',storage_class='':repo/apt
      734 8.8.15.p32-ne/conf/distributions
       15 8.8.15.p32-ne/conf/options
   499712 8.8.15.p32-ne/db/checksums.db
    16384 8.8.15.p32-ne/db/contents.cache.db
   184320 8.8.15.p32-ne/db/packagenames.db
  2121728 8.8.15.p32-ne/db/packages.db
   253952 8.8.15.p32-ne/db/references.db
    69632 8.8.15.p32-ne/db/release.caches.db
       31 8.8.15.p32-ne/db/version
     2471 8.8.15.p32-ne/dists/bionic/InRelease
     1603 8.8.15.p32-ne/dists/bionic/Release
      819 8.8.15.p32-ne/dists/bionic/Release.gpg

that goes on and on..

maybe try adding --fast-list.
and if you want a deeper look, add --dump=headers

[ Note add --use-server-modtime and it will run a lot quicker as it isn't querying the objects for rclone metadata which isn't there. ]

A bit of testing reveals it has got stuck in a directory loop listing the same directory over and over again. This is likely a bug in the server or rclone...

This is what we send the server (see with -vv --dump bodies)

2022/08/12 10:49:20 DEBUG : HTTP REQUEST (req 0xc000269500)
2022/08/12 10:49:20 DEBUG : GET /?delimiter=&encoding-type=url&list-type=2&max-keys=1000&prefix=apt%2F HTTP/1.1
User-Agent: rclone/v1.60.0-beta.6419.b3b520090
Accept-Encoding: gzip

And this is what it replies with

2022/08/12 10:49:20 DEBUG : HTTP RESPONSE (req 0xc000269500)
2022/08/12 10:49:21 DEBUG : HTTP/1.1 200 OK
Transfer-Encoding: chunked
Age: 12534
Connection: keep-alive
Content-Type: application/xml
Date: Fri, 12 Aug 2022 06:20:26 GMT
Server: AmazonS3
Via: 1.1 (CloudFront)
X-Amz-Bucket-Region: us-east-1
X-Amz-Cf-Id: rHN4u7P7CbKwMy11UTeIVc4c4H0TFSE4ygWi6WCMmeSdQtiOJqc1HA==
X-Amz-Cf-Pop: LHR62-C3
X-Cache: Hit from cloudfront

Plus an XML body which I'd shortened and tidied here

<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="">

Notice that this returns <IsTruncated>true</IsTruncated> so we are expecting more entries to list, but it doesn't return <NextContinuationToken>string</NextContinuationToken> so rclone just starts listing the directory again which is not too clever but explains the loop.

So the results look out of spec for s3 responses. It might be that rclone is supposed to be doing something different...

So there is definitely something whacky going on there! I don't think it is rclone's fault, but I'm not 100% sure!

Adding --disable ListR to rclone to stop recursive listings doesn't seem to stop the server sending them.

So I think the server is broken in some way.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.