Rclone copy copies uchg flags to partials and then cannot progress those files, on MacOS

What is the problem you are having with rclone?

It can't handle the uchg (immutable) flag correctly on MacOS, creating partial files that it can't update/remove. This is especially problematic when copying from a read-only filesystem, so you can't update the flag at source,

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

./rclone version
rclone v1.70.0-beta.8641.839eef0db

  • os/version: darwin 15.4 (64 bit)
  • os/kernel: 24.4.0 (arm64)
  • os/type: darwin
  • os/arch: arm64 (ARMv8 compatible)
  • go/version: go1.24.1
  • go/linking: dynamic
  • go/tags: cmount

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

None.

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

> ./rclone selfupdate --beta
2025/04/03 19:47:10 NOTICE: rclone is up to date
> echo Hello >file1.txt     
> chflags uchg file1.txt  
> ./rclone copy file1.txt file2.txt
2025/04/03 19:47:34 NOTICE: Config file "/Users/gh221/.config/rclone/rclone.conf" not found - using defaults
2025/04/03 19:47:34 ERROR : file1.txt.deda4a9f.partial: partial file rename failed: rename /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt.deda4a9f.partial /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt: operation not permitted
2025/04/03 19:47:34 ERROR : Attempt 1/3 failed with 1 errors and: rename /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt.deda4a9f.partial /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt: operation not permitted
2025/04/03 19:47:34 ERROR : file1.txt: Failed to copy: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:47:34 ERROR : Attempt 2/3 failed with 1 errors and: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:47:34 ERROR : file1.txt: Failed to copy: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:47:34 ERROR : Attempt 3/3 failed with 1 errors and: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:47:34 NOTICE: Failed to copy: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file2.txt/file1.txt.deda4a9f.partial: errno -1
> 

The rclone config contents with secrets removed.

(No config file - using defaults.)

A log from the command with the -vv flag

> ./rclone copy file1.txt file3.txt -vv
2025/04/03 19:48:18 DEBUG : rclone: Version "v1.70.0-beta.8641.839eef0db" starting with parameters ["./rclone" "copy" "file1.txt" "file3.txt" "-vv"]
2025/04/03 19:48:18 DEBUG : Creating backend with remote "file1.txt"
2025/04/03 19:48:18 NOTICE: Config file "/Users/gh221/.config/rclone/rclone.conf" not found - using defaults
2025/04/03 19:48:18 DEBUG : fs cache: renaming child cache item "file1.txt" to be canonical for parent "/Users/gh221/Dev/rcloneuchg"
2025/04/03 19:48:18 DEBUG : Creating backend with remote "file3.txt"
2025/04/03 19:48:18 DEBUG : fs cache: renaming cache item "file3.txt" to be canonical "/Users/gh221/Dev/rcloneuchg/file3.txt"
2025/04/03 19:48:18 DEBUG : file1.txt: Need to transfer - File not found at Destination
2025/04/03 19:48:18 DEBUG : /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: isCloned: true, error: <nil>
2025/04/03 19:48:18 DEBUG : file1.txt: md5 = 09f7e02f1290be211da707a266f153b3 OK
2025/04/03 19:48:18 ERROR : file1.txt.deda4a9f.partial: partial file rename failed: rename /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt: operation not permitted
2025/04/03 19:48:18 INFO  : file1.txt.deda4a9f.partial: Removing failed copy
2025/04/03 19:48:18 INFO  : file1.txt.deda4a9f.partial: Failed to remove failed copy: remove /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: operation not permitted
2025/04/03 19:48:18 ERROR : Attempt 1/3 failed with 1 errors and: rename /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt: operation not permitted
2025/04/03 19:48:18 DEBUG : file1.txt: Need to transfer - File not found at Destination
2025/04/03 19:48:18 DEBUG : /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: isCloned: false, error: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:48:18 ERROR : file1.txt: Failed to copy: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:48:18 INFO  : file1.txt.deda4a9f.partial: Removing failed copy
2025/04/03 19:48:18 INFO  : file1.txt.deda4a9f.partial: Failed to remove failed copy: remove /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: operation not permitted
2025/04/03 19:48:18 ERROR : Attempt 2/3 failed with 1 errors and: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:48:18 DEBUG : file1.txt: Need to transfer - File not found at Destination
2025/04/03 19:48:18 DEBUG : /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: isCloned: false, error: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:48:18 ERROR : file1.txt: Failed to copy: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:48:18 INFO  : file1.txt.deda4a9f.partial: Removing failed copy
2025/04/03 19:48:18 INFO  : file1.txt.deda4a9f.partial: Failed to remove failed copy: remove /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: operation not permitted
2025/04/03 19:48:18 ERROR : Attempt 3/3 failed with 1 errors and: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: errno -1
2025/04/03 19:48:18 INFO  : 
Transferred:   	          6 B / 6 B, 100%, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Server Side Copies:     1 @ 6 B
Elapsed time:         0.0s

2025/04/03 19:48:18 DEBUG : 5 go routines active
2025/04/03 19:48:18 NOTICE: Failed to copy: couldn't copy from /Users/gh221/Dev/rcloneuchg/file1.txt to /Users/gh221/Dev/rcloneuchg/file3.txt/file1.txt.deda4a9f.partial: errno -1
> 

welcome to the forum,

@kapitainsky ???

1 Like

Using copy you ask rclone to copy file1.txt to a directory called file2.txt
To copy file A->B you should use rclone copyto but this is not the key issue here (it fails too).

What is happening is that rclone preserves all file's attributes including uchg. Now difference between -w and uchg is that latter locks not only file content but also its directory entry. It means that you can not move it nor rename.

By default when local filesystem is involved rclone will first use temporary (.partial) file and rename to the correct name when transfer is finished. But when temporary file has uchg set it breaks rename operation.

Maybe rclone should apply all attributes after renaming tmp file? This is something to think about. In the meantime when doing local to local it is unnecessary to use .partial stage so just use --inplace flag and all should work.

Thank you. Apologies for the weird apparent directory name - I hadn't noticed that my last reduction was wrong. --inplace will fix my current problem, indeed.

I had a thought or two in this area - even if the partial bug were fixed by setting attributes after the rename, rclone would still be setting things up in a way that makes future rclone operations fail, as the files with uchg would prevent future updates by rclone, unless there were workarounds. So if you have a source with uchg flags, your destination would be forever tainted/pinned by them. It's tricky because uchg expresses user intent for a file to be unchangeable, but when rclone is setting it on the destination, it is now divorced from that intent.

1 Like