Repository navigation
Rclone Serve S3 does not list files in a sorted order #9002
Copy link
Copy link
Closed
Description
The associated forum post URL from https://forum.rclone.org
What is the problem you are having with rclone?
The rclone serve s3 feature serves an S3 server and it’s not compatible with the official aws s3 sync cli utility. The root cause is because ListObjects operation does not return a sorted list of objects (it’s sorted by mod time, not object names). The official aws s3 sync command assumes a sorted list by name returned by the API when it processes src and dest iterators (src). When used with a custom S3 backend served by rclone, the aws s3 sync command mistakenly identifies missing files at the destination and redownload already up-to-date files.
What is your rclone version (output from rclone version)
rclone v1.72.0
- os/version: alpine 3.22.2 (64 bit)
- os/kernel: 5.15.0-69-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.25.4
- go/linking: static
- go/tags: none
Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
Linux 64 bit
Which cloud storage system are you using? (e.g. Google Drive)
AWS S3
The command you were trying to run (e.g. rclone copy /tmp remote:tmp)
rclone serve s3 mirror-server:
A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)
2025/11/28 19:07:56 NOTICE: S3 root: Starting s3 server on [https://[::]:8080/]
2025/11/28 19:08:01 DEBUG : serve s3: LIST BUCKET
2025/11/28 19:08:01 DEBUG : serve s3: bucketname: [redacted] prefix: prefix:"[redacted]" page: {Marker: HasMarker:false MaxKeys:1000}
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Metadata
Metadata
Assignees
Labels
No labels
Activity
vqng commentedon Nov 29, 2025
The sort order comes from s3
pager.go(src)@ncw do you know why we need to sort the results by modtime?
vqng commentedon Nov 29, 2025
I can confirm removing mod-time sort fixed the issue
ncw commentedon Nov 29, 2025
No idea what this is doing!
rclone/cmd/serve/s3/pager.go
Lines 16 to 19 in a99d155
I suspect it needs sorting still but I haven't traced the code through
cmd/serve/s3: return object listings in key order
cmd/serve/s3: return object listings in key order
cmd/serve/s3: return object listings in key order