Skip to content

fix(copy): copy folders to rclone mounts without a staged rename - #2327

Merged
l0gicgate merged 2 commits into
mainfrom
fix/2203-folder-copy-rclone-rename
Nov 16, 2026
Merged

l0gicgate merged 2 commits into
mainfrom
fix/2203-folder-copy-rclone-rename

Conversation

@l0gicgate

@l0gicgate l0gicgate commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Copying a folder into an rclone mount failed with "The result could not be confirmed", left only empty subfolders at the destination, and left every file in a hidden .strata-copy-* folder.

Cause. The mount rejects RENAME_NOREPLACE and has no hard links, so the staged folder was published by step 3 of the placement routine: make an empty placeholder at the final name, then rename the stage over it. rclone does not rename a folder over an existing one. It logs Can't DirMove - falling back to file moves, makes the subfolders at the new name, moves only the files its storage already holds, and returns EIO (RenameDir rmdir: directory not empty) while files still waiting to upload are in the stage. It also merges into a folder that is not empty and replaces same-named files, so the placeholder never gave the protection step 3 counts on there.

Fix. On FUSE daemons over remote storage:

  • A new folder is made under its final name and filled there, with no stage and no rename. This reuses the existing path for mounts where no step can place a folder, and covers folders new to a merge.
  • The placement routine skips the placeholder for folders and, once RENAME_NOREPLACE is known to be missing, renames to a name just found free (the existing folder check of step 5, as for names ntfs-3g would cut). Moves, renames, extraction and Replace on the mount now give the daemon one rename, which rclone passes to its storage as a single move, instead of a file-by-file move.

Scope, for review. "FUSE daemon over remote storage" is every FUSE mount except fuseblk devices, sshfs (whose server renames the folder, and which the lab covers) and the local overlays already listed in is_local_fuse_overlay. Only rclone was tested; s3fs, gvfsd-fuse and unknown fuse.* daemons get the same treatment because nothing tells Strata how they rename a filled folder. The cost is that a folder being copied there is visible under its final name while it fills. Narrowing this to fuse.rclone is a one-line change in MountType::renames_folders_in_steps.

Not changed: files copied on their own are still staged (that works on rclone), there is no new setting, and the "could not be confirmed" message is as before. Stages left by earlier failed attempts still show in the folder's leftover review.

docs/filesystem-compatibility.md describes the new rule under "FUSE daemons over remote storage".

Also, separately: data/locales/installer.json takes the Hungarian installer strings that #2304 wrote only into install.sh. They were out of sync, which failed the installer translation check on main and on every pull request.

Visual evidence

N/A. No interface change; the fix is in the copy engine and the placement routine.

How to test

A throwaway rclone mount over a local WebDAV server, throttled so uploads are still pending when the copy ends, reproduces the report without a cloud account:

  1. Start the server and the mount:
    mkdir -p /tmp/lab/{remote,cache,mnt}
    rclone serve webdav /tmp/lab/remote --addr 127.0.0.1:18203 &
    rclone mount ":webdav,url='http://127.0.0.1:18203',vendor=rclone:" /tmp/lab/mnt \
      --vfs-cache-mode full --cache-dir /tmp/lab/cache --tpslimit 6 \
      -v --log-file /tmp/lab/rclone.log &
  2. In Strata, copy a local folder with nested subfolders and about 50 files of 150 kB into /tmp/lab/mnt.
  3. Rename the copied folder on the mount right away, while files are still uploading.
  4. When done: fusermount3 -u /tmp/lab/mnt, then stop rclone serve.

Expected result: The folder appears with every file, no .strata-copy-* folder is left beside it, and the rename succeeds at once. /tmp/lab/rclone.log has no Can't DirMove or Dir.Rename error line, and after the uploads finish /tmp/lab/remote holds the complete folder under its new name. On main, step 2 fails after about 25 s with the error above, the destination holds only empty subfolders, and the files stay in the hidden stage.

Related issue

Closes #2203

A folder copied to an rclone mount was built in a hidden .strata-copy-*
stage and renamed over an empty placeholder at its final name. rclone
does not rename a folder over an existing one: it moves it file by file,
and fails with EIO while files it has yet to upload are still in the
stage. The copy then failed as unconfirmed, with empty subfolders at the
destination and the files left in the hidden stage.

On FUSE daemons over remote storage, which is every FUSE mount but
fuseblk devices, sshfs and the daemons that layer or encrypt local
storage:

- a new folder is made under its final name and filled there, as on
  mounts where no step can place a folder, also for folders new to a
  merge;
- the placement routine no longer renames a folder over a placeholder.
  Once RENAME_NOREPLACE is known to be missing it renames the folder to
  a name just found free, so moves, renames, extraction and Replace give
  the daemon a single rename.

Refs #2203
@github-actions github-actions Bot added the fix label Nov 13, 2026
#2304 updated the Hungarian installer strings in install.sh but not in
data/locales/installer.json, which they are generated from, so the
installer translation check failed on main and every pull request.
@l0gicgate
l0gicgate merged commit 8ff4079 into main Nov 16, 2026
13 checks passed
@l0gicgate
l0gicgate deleted the fix/2203-folder-copy-rclone-rename branch November 24, 2026 05:18
wmfeht added a commit to wmfeht/strata-feature-map that referenced this pull request Nov 29, 2026
Sync lgse/strata#2327–#2544: rclone folder copies, desktop window-button defaults, GVfs mount dedupe, launcher icon, KDE MTP warning, entry tooltips and footer names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copying a folder to an rclone (OneDrive) FUSE mount fails: .strata-copy-* staging dir rename returns IO error, files left in hidden folder

1 participant