SFTP breaks with create-empty-src-dirs

What is the problem you are having with rclone?

Copying to/from a SFTP host to/from local breaks if using create-empty-src-dirs. Without the flag everything appears to work.

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

rclone v1.71.2

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.0-161-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.25.3
  • go/linking: static
  • go/tags: none

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

SFTP; specifically:
restrict,command="rclone serve sftp --stdio /tmp/rclone-test/normal",restrict ssh-rsa <bla>

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

(maybe?) notable: /mnt/storage/merged/ is a MergerFS mount. Added --include specifiers to keep log somewhat managable (without them it still breaks)

rclone copy --transfers 1 --create-empty-src-dirs --include beun --include backup.sh /mnt/storage/merged/draw/ localTest: -vv

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[localTest]
type = sftp
host = localhost
key_file = /tmp/rclone-test/test
shell_type = unix
md5sum_command = none
sha1sum_command = none

A log from the command that you were trying to run with the -vv flag

Exerpt of actual errors for convenience/clarity:

59:2025/11/25 22:28:52 ERROR : backup.sh: Failed to copy: Update SetModTime failed: SetModTime failed: file does not exist
90:2025/11/25 22:28:52 ERROR : 3d/garage: Failed to update directory timestamp or metadata: SetModTime failed: file does not exist
108:2025/11/25 22:28:52 ERROR : Attempt 1/3 failed with 7 errors and: failed to set directory modtime: 2 errors: last error: SetModTime stat failed: object not found
134:2025/11/25 22:28:52 ERROR : backup.sh.e924b48f.partial: partial file rename failed: Move NewObject failed: object not found
167:2025/11/25 22:28:52 ERROR : Attempt 2/3 failed with 4 errors and: SetModTime failed: file does not exist
187:2025/11/25 22:28:52 ERROR : backup.sh: Failed to copy: Update SetModTime failed: SetModTime failed: file does not exist
234:2025/11/25 22:28:52 ERROR : 3d/garage/photos and ref: Failed to update directory timestamp or metadata: SetModTime stat failed: object not found
240:2025/11/25 22:28:52 ERROR : Attempt 3/3 failed with 3 errors and: failed to set directory modtime: SetModTime stat failed: object not found

Full log

2025/11/25 22:28:51 DEBUG : rclone: Version "v1.71.2" starting with parameters ["rclone" "copy" "--transfers" "1" "--create-empty-src-dirs" "--include" "beun" "--include" "backup.sh" "/mnt/storage/merged/draw/" "localTest:" "-vv"]
2025/11/25 22:28:51 DEBUG : Creating backend with remote "/mnt/storage/merged/draw/"
2025/11/25 22:28:51 DEBUG : Using config file from "/home/stavae/.config/rclone/rclone.conf"
2025/11/25 22:28:51 DEBUG : fs cache: renaming cache item "/mnt/storage/merged/draw/" to be canonical "/mnt/storage/merged/draw"
2025/11/25 22:28:51 DEBUG : Creating backend with remote "localTest:"
2025/11/25 22:28:51 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:48664->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Shell type "unix" from config
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Relative path resolved to "/"
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Using root directory "/"
2025/11/25 22:28:52 INFO  : 3d: Making directory
2025/11/25 22:28:52 INFO  : 3d: Made directory with modification time 2025-09-14 13:47:27.500648999 +0200 CEST
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d", newDst=<nil>
2025/11/25 22:28:52 INFO  : CloneAssets: Making directory
2025/11/25 22:28:52 INFO  : CloneAssets: Made directory with modification time 2025-07-14 23:36:03.624990122 +0200 CEST
2025/11/25 22:28:52 DEBUG : Added delayed dir = "CloneAssets", newDst=<nil>
2025/11/25 22:28:52 INFO  : SharkOpener: Making directory
2025/11/25 22:28:52 INFO  : SharkOpener: Made directory with modification time 2025-11-05 16:49:40.434805517 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "SharkOpener", newDst=<nil>
2025/11/25 22:28:52 INFO  : Vibes: Making directory
2025/11/25 22:28:52 INFO  : Vibes: Made directory with modification time 2025-08-12 23:18:16.316215814 +0200 CEST
2025/11/25 22:28:52 DEBUG : Added delayed dir = "Vibes", newDst=<nil>
2025/11/25 22:28:52 DEBUG : backup.sh: Need to transfer - File not found at Destination
2025/11/25 22:28:52 INFO  : beun: Making directory
2025/11/25 22:28:52 INFO  : beun: Made directory with modification time 2025-11-05 14:07:30.341999869 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "beun", newDst=<nil>
2025/11/25 22:28:52 INFO  : brushes: Making directory
2025/11/25 22:28:52 INFO  : brushes: Made directory with modification time 2024-04-08 14:15:39 +0200 CEST
2025/11/25 22:28:52 DEBUG : Added delayed dir = "brushes", newDst=<nil>
2025/11/25 22:28:52 INFO  : cast: Making directory
2025/11/25 22:28:52 INFO  : cast: Made directory with modification time 2025-11-23 14:17:00.960136219 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "cast", newDst=<nil>
2025/11/25 22:28:52 INFO  : learning: Making directory
2025/11/25 22:28:52 INFO  : learning: Made directory with modification time 2024-03-18 12:13:12.696999984 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "learning", newDst=<nil>
2025/11/25 22:28:52 INFO  : ref: Making directory
2025/11/25 22:28:52 INFO  : ref: Made directory with modification time 2024-10-26 21:41:06.658885473 +0200 CEST
2025/11/25 22:28:52 DEBUG : Added delayed dir = "ref", newDst=<nil>
2025/11/25 22:28:52 INFO  : synced: Making directory
2025/11/25 22:28:52 INFO  : synced: Made directory with modification time 2025-11-25 14:38:45.049224208 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "synced", newDst=<nil>
2025/11/25 22:28:52 INFO  : tattoo: Making directory
2025/11/25 22:28:52 INFO  : tattoo: Made directory with modification time 2025-03-08 19:59:33.996735349 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "tattoo", newDst=<nil>
2025/11/25 22:28:52 INFO  : template: Making directory
2025/11/25 22:28:52 INFO  : template: Made directory with modification time 2024-03-23 01:41:47 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "template", newDst=<nil>
2025/11/25 22:28:52 INFO  : cast/scrcpy-win64-v3.3.3: Making directory
2025/11/25 22:28:52 INFO  : synced/normal: Making directory
2025/11/25 22:28:52 INFO  : ref/kobold: Making directory
2025/11/25 22:28:52 INFO  : 3d/garage: Making directory
2025/11/25 22:28:52 INFO  : cast/scrcpy-win64-v3.3.3: Made directory with modification time 2025-11-23 14:37:15.62293118 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "cast/scrcpy-win64-v3.3.3", newDst=<nil>
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:48668->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:48680->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/25 22:28:52 ERROR : backup.sh: Failed to copy: Update SetModTime failed: SetModTime failed: file does not exist
2025/11/25 22:28:52 INFO  : backup.sh.e924b48f.partial: Removing failed copy
2025/11/25 22:28:52 INFO  : backup.sh.e924b48f.partial: Failed to remove failed copy: remove /backup.sh.e924b48f.partial: file does not exist
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:48686->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:48688->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/25 22:28:52 INFO  : synced/normal: Made directory with modification time 2025-11-25 19:07:44.936193284 +0100 CET
2025/11/25 22:28:52 INFO  : synced/secrets: Making directory
2025/11/25 22:28:52 INFO  : synced/secrets: Made directory with modification time 2025-11-10 15:45:04.406986298 +0100 CET
2025/11/25 22:28:52 INFO  : synced/secrets/F_hR8BJC1_WlzauziWxBqw: Making directory
2025/11/25 22:28:52 INFO  : synced/secrets/F_hR8BJC1_WlzauziWxBqw/ukf2kR_OuwQRPgIntfhL-Q: Making directory
2025/11/25 22:28:52 INFO  : ref/kobold: Made directory with modification time 2024-10-26 20:06:44.431809376 +0200 CEST
2025/11/25 22:28:52 INFO  : ref/women: Making directory
2025/11/25 22:28:52 INFO  : ref/women: Made directory with modification time 2024-10-26 20:06:00.544383105 +0200 CEST
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:48696->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/25 22:28:52 INFO  : 3d/garage: Made directory with modification time 2025-03-16 12:50:06.219365326 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d/garage", newDst=<nil>
2025/11/25 22:28:52 INFO  : 3d/grip: Making directory
2025/11/25 22:28:52 INFO  : 3d/grip: Made directory with modification time 2025-09-14 13:47:57.00025648 +0200 CEST
2025/11/25 22:28:52 INFO  : 3d/handle: Making directory
2025/11/25 22:28:52 INFO  : 3d/handle: Made directory with modification time 2025-09-14 13:47:57.00025648 +0200 CEST
2025/11/25 22:28:52 INFO  : 3d/logo: Making directory
2025/11/25 22:28:52 INFO  : 3d/logo: Made directory with modification time 2025-02-20 23:08:27.069086569 +0100 CET
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref: Making directory
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref: Made directory with modification time 2025-02-26 19:14:28.351867316 +0100 CET
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref/current appartment reference: Making directory
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Waiting for checks to finish
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Waiting for transfers to finish
2025/11/25 22:28:52 ERROR : 3d/garage: Failed to update directory timestamp or metadata: SetModTime failed: file does not exist
2025/11/25 22:28:52 INFO  : cast/scrcpy-win64-v3.3.3: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : 3d: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : cast: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : ref: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : synced: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : learning: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : template: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : tattoo: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : CloneAssets: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : Vibes: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : SharkOpener: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:48704->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:48708->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/25 22:28:52 INFO  : beun: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : brushes: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 ERROR : Attempt 1/3 failed with 7 errors and: failed to set directory modtime: 2 errors: last error: SetModTime stat failed: object not found
2025/11/25 22:28:52 DEBUG : backup.sh.e924b48f.partial: Excluded (Path Filter)
2025/11/25 22:28:52 DEBUG : backup.sh.e924b48f.partial: Excluded
2025/11/25 22:28:52 INFO  : 3d: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d", newDst=3d
2025/11/25 22:28:52 INFO  : CloneAssets: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "CloneAssets", newDst=CloneAssets
2025/11/25 22:28:52 INFO  : SharkOpener: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "SharkOpener", newDst=SharkOpener
2025/11/25 22:28:52 DEBUG : Vibes: Directory modification time the same (differ by -316.215814ms, within tolerance 1s)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "Vibes", newDst=Vibes
2025/11/25 22:28:52 DEBUG : backup.sh: Need to transfer - File not found at Destination
2025/11/25 22:28:52 INFO  : beun: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "beun", newDst=beun
2025/11/25 22:28:52 INFO  : brushes: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "brushes", newDst=brushes
2025/11/25 22:28:52 INFO  : cast: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "cast", newDst=cast
2025/11/25 22:28:52 INFO  : learning: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "learning", newDst=learning
2025/11/25 22:28:52 INFO  : ref: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "ref", newDst=ref
2025/11/25 22:28:52 INFO  : synced: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "synced", newDst=synced
2025/11/25 22:28:52 ERROR : backup.sh.e924b48f.partial: partial file rename failed: Move NewObject failed: object not found
2025/11/25 22:28:52 INFO  : backup.sh.e924b48f.partial: Removing failed copy
2025/11/25 22:28:52 INFO  : tattoo: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "tattoo", newDst=tattoo
2025/11/25 22:28:52 INFO  : backup.sh.e924b48f.partial: Failed to remove failed copy: remove /backup.sh.e924b48f.partial: file does not exist
2025/11/25 22:28:52 INFO  : template: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "template", newDst=template
2025/11/25 22:28:52 INFO  : ref/kobold: Making directory
2025/11/25 22:28:52 DEBUG : cast/scrcpy-win64-v3.3.3: Directory modification time the same (differ by -622.93118ms, within tolerance 1s)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "cast/scrcpy-win64-v3.3.3", newDst=cast/scrcpy-win64-v3.3.3
2025/11/25 22:28:52 INFO  : 3d/garage: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d/garage", newDst=3d/garage
2025/11/25 22:28:52 INFO  : ref/kobold: Made directory with modification time 2024-10-26 20:06:44.431809376 +0200 CEST
2025/11/25 22:28:52 INFO  : ref/women: Making directory
2025/11/25 22:28:52 INFO  : 3d/grip: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d/grip", newDst=3d/grip
2025/11/25 22:28:52 INFO  : synced/normal: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "synced/normal", newDst=synced/normal
2025/11/25 22:28:52 INFO  : ref/women: Made directory with modification time 2024-10-26 20:06:00.544383105 +0200 CEST
2025/11/25 22:28:52 INFO  : synced/secrets: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "synced/secrets", newDst=synced/secrets
2025/11/25 22:28:52 INFO  : synced/secrets/F_hR8BJC1_WlzauziWxBqw: Making directory
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d/garage/photos and ref", newDst=3d/garage/photos and ref
2025/11/25 22:28:52 INFO  : synced/secrets/F_hR8BJC1_WlzauziWxBqw/ukf2kR_OuwQRPgIntfhL-Q: Making directory
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref/current appartment reference: Making directory
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref/current appartment reference: Made directory with modification time 2025-02-22 22:34:10.345831576 +0100 CET
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Waiting for checks to finish
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Waiting for transfers to finish
2025/11/25 22:28:52 ERROR : Attempt 2/3 failed with 4 errors and: SetModTime failed: file does not exist
2025/11/25 22:28:52 DEBUG : backup.sh.e924b48f.partial: Excluded (Path Filter)
2025/11/25 22:28:52 DEBUG : backup.sh.e924b48f.partial: Excluded
2025/11/25 22:28:52 INFO  : 3d: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d", newDst=3d
2025/11/25 22:28:52 INFO  : CloneAssets: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "CloneAssets", newDst=CloneAssets
2025/11/25 22:28:52 DEBUG : SharkOpener: Directory modification time the same (differ by -434.805517ms, within tolerance 1s)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "SharkOpener", newDst=SharkOpener
2025/11/25 22:28:52 INFO  : Vibes: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "Vibes", newDst=Vibes
2025/11/25 22:28:52 DEBUG : backup.sh: Need to transfer - File not found at Destination
2025/11/25 22:28:52 INFO  : beun: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "beun", newDst=beun
2025/11/25 22:28:52 INFO  : brushes: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "brushes", newDst=brushes
2025/11/25 22:28:52 INFO  : cast: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "cast", newDst=cast
2025/11/25 22:28:52 ERROR : backup.sh: Failed to copy: Update SetModTime failed: SetModTime failed: file does not exist
2025/11/25 22:28:52 INFO  : learning: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "learning", newDst=learning
2025/11/25 22:28:52 INFO  : backup.sh.e924b48f.partial: Removing failed copy
2025/11/25 22:28:52 INFO  : ref: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "ref", newDst=ref
2025/11/25 22:28:52 DEBUG : synced: Directory modification time the same (differ by -49.224208ms, within tolerance 1s)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "synced", newDst=synced
2025/11/25 22:28:52 INFO  : tattoo: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "tattoo", newDst=tattoo
2025/11/25 22:28:52 DEBUG : template: Directory modification time the same (differ by 0s, within tolerance 1s)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "template", newDst=template
2025/11/25 22:28:52 INFO  : cast/scrcpy-win64-v3.3.3: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "cast/scrcpy-win64-v3.3.3", newDst=cast/scrcpy-win64-v3.3.3
2025/11/25 22:28:52 INFO  : synced/normal: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "synced/normal", newDst=synced/normal
2025/11/25 22:28:52 INFO  : synced/secrets: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "synced/secrets", newDst=synced/secrets
2025/11/25 22:28:52 INFO  : 3d/garage: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d/garage", newDst=3d/garage
2025/11/25 22:28:52 INFO  : 3d/grip: Making directory
2025/11/25 22:28:52 INFO  : 3d/grip: Made directory with modification time 2025-09-14 13:47:57.00025648 +0200 CEST
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d/grip", newDst=<nil>
2025/11/25 22:28:52 INFO  : 3d/handle: Making directory
2025/11/25 22:28:52 INFO  : ref/kobold: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "ref/kobold", newDst=ref/kobold
2025/11/25 22:28:52 INFO  : ref/women: Making directory
2025/11/25 22:28:52 INFO  : synced/secrets/F_hR8BJC1_WlzauziWxBqw: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 DEBUG : Added delayed dir = "synced/secrets/F_hR8BJC1_WlzauziWxBqw", newDst=synced/secrets/F_hR8BJC1_WlzauziWxBqw
2025/11/25 22:28:52 INFO  : ref/women: Made directory with modification time 2024-10-26 20:06:00.544383105 +0200 CEST
2025/11/25 22:28:52 DEBUG : Added delayed dir = "ref/women", newDst=<nil>
2025/11/25 22:28:52 INFO  : synced/secrets/F_hR8BJC1_WlzauziWxBqw/ukf2kR_OuwQRPgIntfhL-Q: Making directory
2025/11/25 22:28:52 INFO  : 3d/handle: Made directory with modification time 2025-09-14 13:47:57.00025648 +0200 CEST
2025/11/25 22:28:52 INFO  : 3d/logo: Making directory
2025/11/25 22:28:52 INFO  : synced/secrets/F_hR8BJC1_WlzauziWxBqw/ukf2kR_OuwQRPgIntfhL-Q: Made directory with modification time 2025-11-09 23:05:54.696464383 +0100 CET
2025/11/25 22:28:52 INFO  : 3d/logo: Made directory with modification time 2025-02-20 23:08:27.069086569 +0100 CET
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref: Making directory
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref: Made directory with modification time 2025-02-26 19:14:28.351867316 +0100 CET
2025/11/25 22:28:52 DEBUG : Added delayed dir = "3d/garage/photos and ref", newDst=<nil>
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref/current appartment reference: Making directory
2025/11/25 22:28:52 INFO  : 3d/garage/photos and ref/current appartment reference: Made directory with modification time 2025-02-22 22:34:10.345831576 +0100 CET
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Waiting for checks to finish
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Waiting for transfers to finish
2025/11/25 22:28:52 ERROR : 3d/garage/photos and ref: Failed to update directory timestamp or metadata: SetModTime stat failed: object not found
2025/11/25 22:28:52 INFO  : 3d/garage: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : 3d/grip: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : ref/women: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : 3d: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 INFO  : ref: Set directory modification time (using DirSetModTime)
2025/11/25 22:28:52 ERROR : Attempt 3/3 failed with 3 errors and: failed to set directory modtime: SetModTime stat failed: object not found
2025/11/25 22:28:52 INFO  : 
Transferred:   	    3.683 KiB / 3.683 KiB, 100%, 0 B/s, ETA -
Errors:                 3 (retrying may help)
Checks:                 0 / 0, -, Listed 131
Elapsed time:         0.9s

2025/11/25 22:28:52 DEBUG : 77 go routines active
2025/11/25 22:28:52 DEBUG : sftp://stavae@localhost:22/: Closing 8 unused connections
2025/11/25 22:28:53 NOTICE: Failed to copy with 3 errors: last error was: failed to set directory modtime: SetModTime stat failed: object not found

welcome to the forum,

can test the sftp server without using mergerfs...


to keep the log smaller, use --retries=1

Much fewer files/dirs -- no MergerFS and --retries=1; same problem

/tmp/rclone-test/source2 -- local source 
/tmp/rclone-test/a       -- empty destination (using 'restrict,command="rclone serve sftp --stdio /tmp/rclone-test/a",restrict ssh-rsa <bla>') 

Result:

rclone copy -vv --retries 1 --transfers 1 --create-empty-src-dirs source2/ localTest:
2025/11/26 15:59:40 DEBUG : rclone: Version "v1.71.2" starting with parameters ["rclone" "copy" "-vv" "--retries" "1" "--transfers" "1" "--create-empty-src-dirs" "source2/" "localTest:"]
2025/11/26 15:59:40 DEBUG : Creating backend with remote "source2/"
2025/11/26 15:59:40 DEBUG : Using config file from "/home/stavae/.config/rclone/rclone.conf"
2025/11/26 15:59:40 DEBUG : fs cache: renaming cache item "source2/" to be canonical "/tmp/rclone-test/source2"
2025/11/26 15:59:40 DEBUG : Creating backend with remote "localTest:"
2025/11/26 15:59:40 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:38168->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/26 15:59:41 DEBUG : sftp://stavae@localhost:22/: Shell type "unix" from config
2025/11/26 15:59:41 DEBUG : sftp://stavae@localhost:22/: Relative path resolved to "/"
2025/11/26 15:59:41 DEBUG : sftp://stavae@localhost:22/: Using root directory "/"
2025/11/26 15:59:41 DEBUG : backup.sh: Need to transfer - File not found at Destination
2025/11/26 15:59:41 DEBUG : export-as-pngs.sh: Need to transfer - File not found at Destination
2025/11/26 15:59:41 INFO  : tattoo: Making directory
2025/11/26 15:59:41 DEBUG : backup.sh.53d3863c.partial: renamed to: backup.sh
2025/11/26 15:59:41 INFO  : backup.sh: Copied (new)
2025/11/26 15:59:41 DEBUG : export-as-pngs.sh.2e330cd2.partial: renamed to: export-as-pngs.sh
2025/11/26 15:59:41 INFO  : export-as-pngs.sh: Copied (new)
2025/11/26 15:59:41 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:38176->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/26 15:59:41 INFO  : tattoo: Made directory with modification time 2025-03-08 19:59:33.996735349 +0100 CET
2025/11/26 15:59:41 DEBUG : tattoo/blood.png: Need to transfer - File not found at Destination
2025/11/26 15:59:41 DEBUG : tattoo/blood.svg: Need to transfer - File not found at Destination
2025/11/26 15:59:41 DEBUG : tattoo/plasma.png: Need to transfer - File not found at Destination
2025/11/26 15:59:41 DEBUG : sftp://stavae@localhost:22/: Waiting for checks to finish
2025/11/26 15:59:41 DEBUG : sftp://stavae@localhost:22/: Waiting for transfers to finish
2025/11/26 15:59:41 ERROR : tattoo/blood.png: Failed to copy: Update Create failed: file does not exist
2025/11/26 15:59:41 ERROR : tattoo/blood.svg: Failed to copy: Update Create failed: file does not exist
2025/11/26 15:59:41 ERROR : tattoo/plasma.png: Failed to copy: Update Create failed: file does not exist
2025/11/26 15:59:41 ERROR : Attempt 1/1 failed with 3 errors and: Update Create failed: file does not exist
2025/11/26 15:59:41 INFO  :
Transferred:            548 B / 548 B, 100%, 0 B/s, ETA -
Errors:                 3 (retrying may help)
Checks:                 0 / 0, -, Listed 6
Transferred:            2 / 2, 100%
Elapsed time:         0.2s

2025/11/26 15:59:41 DEBUG : 24 go routines active
2025/11/26 15:59:41 DEBUG : sftp://stavae@localhost:22/: Closing 2 unused connections
2025/11/26 15:59:41 NOTICE: Failed to copy with 3 errors: last error was: Update Create failed: file does not exist

Oh I also just remembered that the server is running Ubuntu 22.04.5 LTS -> rclone version available with apt was old -> I installed this version sudo -v ; curl https://rclone.org/install.sh | sudo bash

sorry, confused. what does it matter which rclone version is running on the server?

I dont know that it does, I am just pointing out it isnt the 'standard/vetted' apt version -> weird dependency issues could happen.
But I just realized the binary is statically linked -> should not matter

This does look like a bug.

The only unusual part of your setup is the restricted ssh key. Can you try it without that?

No difference (yes I tripple checked I actually removed it [also I apparently have restrict in there twice for some reason])

rclone copy --retries 1 --transfers 1 --create-empty-src-dirs source2/ localTest: -vv
2025/11/26 22:26:34 DEBUG : rclone: Version "v1.71.2" starting with parameters ["rclone" "copy" "--retries" "1" "--transfers" "1" "--create-empty-src-dirs" "source2/" "localTest:" "-vv"]
2025/11/26 22:26:34 DEBUG : Creating backend with remote "source2/"
2025/11/26 22:26:34 DEBUG : Using config file from "/home/stavae/.config/rclone/rclone.conf"
2025/11/26 22:26:34 DEBUG : fs cache: renaming cache item "source2/" to be canonical "/tmp/rclone-test/source2"
2025/11/26 22:26:34 DEBUG : Creating backend with remote "localTest:"
2025/11/26 22:26:34 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:53120->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/26 22:26:34 DEBUG : sftp://stavae@localhost:22/: Shell type "unix" from config
2025/11/26 22:26:34 DEBUG : sftp://stavae@localhost:22/: Relative path resolved to "/"
2025/11/26 22:26:34 DEBUG : sftp://stavae@localhost:22/: Using root directory "/"
2025/11/26 22:26:34 DEBUG : backup.sh: Need to transfer - File not found at Destination
2025/11/26 22:26:34 DEBUG : export-as-pngs.sh: Need to transfer - File not found at Destination
2025/11/26 22:26:34 INFO  : tattoo: Making directory
2025/11/26 22:26:34 INFO  : tattoo: Made directory with modification time 2025-03-08 19:59:33.996735349 +0100 CET
2025/11/26 22:26:34 DEBUG : Added delayed dir = "tattoo", newDst=<nil>
2025/11/26 22:26:34 DEBUG : tattoo/blood.png: Need to transfer - File not found at Destination
2025/11/26 22:26:34 DEBUG : tattoo/blood.svg: Need to transfer - File not found at Destination
2025/11/26 22:26:34 DEBUG : tattoo/plasma.png: Need to transfer - File not found at Destination
2025/11/26 22:26:34 DEBUG : sftp://stavae@localhost:22/: Waiting for checks to finish
2025/11/26 22:26:34 DEBUG : sftp://stavae@localhost:22/: Waiting for transfers to finish
2025/11/26 22:26:34 DEBUG : sftp://stavae@localhost:22/: New connection 127.0.0.1:53126->127.0.0.1:22 to "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13"
2025/11/26 22:26:34 ERROR : backup.sh: Failed to copy: Update SetModTime failed: SetModTime failed: file does not exist
2025/11/26 22:26:34 INFO  : backup.sh.53d3863c.partial: Removing failed copy
2025/11/26 22:26:34 INFO  : backup.sh.53d3863c.partial: Failed to remove failed copy: remove /backup.sh.53d3863c.partial: file does not exist
2025/11/26 22:26:34 ERROR : export-as-pngs.sh: Failed to copy: Update SetModTime failed: SetModTime failed: file does not exist
2025/11/26 22:26:34 INFO  : export-as-pngs.sh.2e330cd2.partial: Removing failed copy
2025/11/26 22:26:34 INFO  : export-as-pngs.sh.2e330cd2.partial: Failed to remove failed copy: remove /export-as-pngs.sh.2e330cd2.partial: file does not exist
2025/11/26 22:26:34 ERROR : tattoo/blood.png.aacb46b3.partial: partial file rename failed: Move NewObject failed: object not found
2025/11/26 22:26:34 INFO  : tattoo/blood.png.aacb46b3.partial: Removing failed copy
2025/11/26 22:26:34 INFO  : tattoo/blood.png.aacb46b3.partial: Failed to remove failed copy: remove /tattoo/blood.png.aacb46b3.partial: file does not exist
2025/11/26 22:26:34 ERROR : tattoo/blood.svg: Failed to copy: Update SetModTime failed: SetModTime failed: file does not exist
2025/11/26 22:26:35 INFO  : tattoo/blood.svg.422e65c1.partial: Removing failed copy
2025/11/26 22:26:35 INFO  : tattoo/blood.svg.422e65c1.partial: Failed to remove failed copy: remove /tattoo/blood.svg.422e65c1.partial: file does not exist
2025/11/26 22:26:35 ERROR : tattoo/plasma.png: Failed to copy: Update SetModTime failed: SetModTime failed: file does not exist
2025/11/26 22:26:35 INFO  : tattoo/plasma.png.59132860.partial: Removing failed copy
2025/11/26 22:26:35 INFO  : tattoo/plasma.png.59132860.partial: Failed to remove failed copy: remove /tattoo/plasma.png.59132860.partial: file does not exist
2025/11/26 22:26:35 INFO  : tattoo: Set directory modification time (using DirSetModTime)
2025/11/26 22:26:35 ERROR : Attempt 1/1 failed with 5 errors and: Update SetModTime failed: SetModTime failed: file does not exist
2025/11/26 22:26:35 INFO  :
Transferred:      916.203 KiB / 916.203 KiB, 100%, 0 B/s, ETA -
Errors:                 5 (retrying may help)
Checks:                 0 / 0, -, Listed 6
Elapsed time:         0.2s

2025/11/26 22:26:35 DEBUG : 22 go routines active
2025/11/26 22:26:35 DEBUG : sftp://stavae@localhost:22/: Closing 2 unused connections
2025/11/26 22:26:35 NOTICE: Failed to copy with 5 errors: last error was: Update SetModTime failed: SetModTime failed: file does not exist

Thanks for checking. Can you report this on GitHub please and we'll try to make a fix

I think it is to do with the different order that things happen with the --create-empty-src-dirs flag.

Thank you