What is the problem you are having with rclone?
I use rclone to mount S3 drives on windows machines. I experience intermittent issues with file renames and drag-and-drop operations from Windows Explorer on various machines and various Windows editions.
If I try to drag and drop a file from one folder to a subfolder very often (and with some files repeatedly) I get an I/O error message. The file is then present in both places and I have to delete the original file manually, which happens without an issue.
Not that often the issue happens with file rename operations. The problem becomes very apparent if I open a Word document and try to edit and save it as Word does a lot of temp file renames during the process.
From my analysis (speculation, could be very wrong) I figured out that if I run the rclone mount
command with -vv
flag the issue is "almost" not reproducible. It seems that the S3 server-side copy command takes some time to run on the server and the subsequent delete operation comes too early and it gets Access denied error 403. If extensive logging is enabled with the -vv
flag, it slows down rclone enough so that the issue happens very rarely and I cannot replicate it on demand.
I played quite a lot with retries, and I also noticed that for the low-level retries there is no option for delay. All the low level retries of the delete command happen very fast and all of them get the 403 error, which is not present if I manually delete the initial file immediately after.
All of this makes the local folder structure and contents to differ from the server - many copies of the same file (with the same name!!!) appear in Windows explorer and some of them cannot be opened with a 404 not found error. This I usually fix by remounting the drive.
Run the command 'rclone version' and share the full output of the command.
Machine 1 - an Amazon Workspace machine:
rclone v1.60.1
- os/version: Microsoft Windows Server 2016 Datacenter 1607 (64 bit)
- os/kernel: 10.0.14393.5501 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.19.3
- go/linking: static
- go/tags: cmount
Machine 2 - my laptop:
rclone v1.60.1
- os/version: Microsoft Windows 11 Pro 22H2 (64 bit)
- os/kernel: 10.0.22621.819 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.19.3
- go/linking: static
- go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
S3
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
Operations from Windows explorer.
The drive is mounted with the following options using the SYSTEM account:
rclone.exe mount algos1storage1:algos1storage1/ Y: --vfs-cache-mode full -v --s3-no-check-bucket --vfs-fast-fingerprint --transfers 1 --retries 10 --retries-sleep 500ms --vfs-write-back 1s --volname "Algos Server" --log-file D:/rclone/rclone_y.log --file-perms 0777 --dir-perms 0777 -o --UserName=XXX
The rclone config contents with secrets removed.
[algos1storage1]
type = s3
provider = AWS
access_key_id = XXX
secret_access_key = XXX
region = eu-west-1
A log from the command with the -vv
flag
Note: the 2 logs below come from -v
flag only because the issue is hard to reproduce with the -vv
flag. In the second log it is obvious how some rename operations go without an issue and then a drag and drop fails in the same path.
2022/12/13 13:16:49 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy.docx: Copied (server-side copy) to: algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/New folder/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy.docx
2022/12/13 13:16:49 ERROR : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy.docx: Couldn't delete: AccessDenied: Access Denied
status code: 403, request id: BVAE7E5NH4RF67RE, host id: K6UcjVtHWuhuAqL53rKsj0fpj6OmMZL2h7qCZp36vQ5Z+ULCyIyG7oJ0Y4otma6KDQg8upqYyqo=
2022/12/13 13:16:49 ERROR : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/New folder/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy.docx: File.Rename error: AccessDenied: Access Denied
status code: 403, request id: BVAE7E5NH4RF67RE, host id: K6UcjVtHWuhuAqL53rKsj0fpj6OmMZL2h7qCZp36vQ5Z+ULCyIyG7oJ0Y4otma6KDQg8upqYyqo=
2022/12/13 13:16:49 ERROR : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy.docx: Dir.Rename error: AccessDenied: Access Denied
status code: 403, request id: BVAE7E5NH4RF67RE, host id: K6UcjVtHWuhuAqL53rKsj0fpj6OmMZL2h7qCZp36vQ5Z+ULCyIyG7oJ0Y4otma6KDQg8upqYyqo=
2022/12/13 13:16:49 ERROR : IO error: AccessDenied: Access Denied
status code: 403, request id: BVAE7E5NH4RF67RE, host id: K6UcjVtHWuhuAqL53rKsj0fpj6OmMZL2h7qCZp36vQ5Z+ULCyIyG7oJ0Y4otma6KDQg8upqYyqo=
2022/12/13 13:16:53 INFO : vfs cache: cleaned: objects 5 (was 5) in use 0, to upload 0, uploading 0, total size 158.175Ki (was 158.175Ki)
Another example:
2022/12/14 10:52:36 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/12/14 10:53:36 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/12/14 10:54:05 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/New folder/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Copied (server-side copy) to: algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx
2022/12/14 10:54:05 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/New folder/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Deleted
2022/12/14 10:54:11 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~$0919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: vfs cache: queuing for upload in 1s
2022/12/14 10:54:12 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~$0919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Copied (new)
2022/12/14 10:54:12 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~$0919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: vfs cache: upload succeeded try #1
2022/12/14 10:54:17 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~WRD0000.tmp: vfs cache: queuing for upload in 1s
2022/12/14 10:54:17 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Copied (server-side copy) to: algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~WRL0001.tmp
2022/12/14 10:54:17 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Deleted
2022/12/14 10:54:17 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: vfs cache: renamed in cache to "algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~WRL0001.tmp"
2022/12/14 10:54:17 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~WRD0000.tmp: vfs cache: renamed in cache to "algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx"
2022/12/14 10:54:17 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: vfs cache: queuing for upload in 1s
2022/12/14 10:54:17 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~WRL0001.tmp: vfs cache: removed cache file as file deleted
2022/12/14 10:54:18 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Copied (new)
2022/12/14 10:54:18 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: vfs cache: upload succeeded try #1
2022/12/14 10:54:21 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/~$0919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: vfs cache: removed cache file as file deleted
2022/12/14 10:54:21 ERROR : IO error: AccessDenied: Access Denied
status code: 403, request id: ANVWVHDB5G9EJK23, host id: 7nwxKI7kcKepRw2HAqUwEm85lhSc8QT/99rNx6GZ4L/MjWq8h/x4M6wWQl63o8C5BBii7S1rpJcxFJ3wB+7Kig==
2022/12/14 10:54:25 INFO : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Copied (server-side copy) to: algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/New folder/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx
2022/12/14 10:54:25 ERROR : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Couldn't delete: AccessDenied: Access Denied
status code: 403, request id: DHHKJE9T3RCAJQ7K, host id: d8ohwjDDDaYja0mr3UQU6Trb8Bo5WovoiiNOkqOvi/UD8cQV/Rtzo28J3bJP2mLTtx57UlIo4xSDA9vgMse2xA==
2022/12/14 10:54:25 ERROR : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/New folder/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: File.Rename error: AccessDenied: Access Denied
status code: 403, request id: DHHKJE9T3RCAJQ7K, host id: d8ohwjDDDaYja0mr3UQU6Trb8Bo5WovoiiNOkqOvi/UD8cQV/Rtzo28J3bJP2mLTtx57UlIo4xSDA9vgMse2xA==
2022/12/14 10:54:25 ERROR : algos_zacc/InvoiceArchive/ΡΠ΅ΡΡ/220919 - Π’ΠΈΠΊΠ΅ΡΠΈ - ΡΠ°Π±Π»ΠΎΠ½ΠΈ - Copy337 - Copy (24).docx: Dir.Rename error: AccessDenied: Access Denied
status code: 403, request id: DHHKJE9T3RCAJQ7K, host id: d8ohwjDDDaYja0mr3UQU6Trb8Bo5WovoiiNOkqOvi/UD8cQV/Rtzo28J3bJP2mLTtx57UlIo4xSDA9vgMse2xA==
2022/12/14 10:54:25 ERROR : IO error: AccessDenied: Access Denied
status code: 403, request id: DHHKJE9T3RCAJQ7K, host id: d8ohwjDDDaYja0mr3UQU6Trb8Bo5WovoiiNOkqOvi/UD8cQV/Rtzo28J3bJP2mLTtx57UlIo4xSDA9vgMse2xA==
2022/12/14 10:54:36 INFO : vfs cache: cleaned: objects 2 (was 2) in use 0, to upload 0, uploading 0, total size 79.076Ki (was 79.076Ki)