What is the problem you are having with rclone?
The problem was first noticed with rclone v1.75.2 while editing and saving an existing JSON file in GNOME Text Editor on Ubuntu 26.04.1 LTS. The file was located on a Google Drive mounted through Talaryn, a GUI wrapper that launches rclone mount. During a save, the file contents disappeared and its size became 0 bytes.
After updating to rclone v1.76.0, further testing on a dedicated Google Drive mount confirmed the GIO-related truncation described below: a 1552-byte replacement was reduced to 17 bytes. This subsequent test used GIO directly rather than the text editor itself.
On a Google Drive mount using --vfs-cache-mode full, replacing a file through GIO can truncate the new contents when a previously opened read handle is first read after the replacement.
This was reproduced on rclone v1.76.0, after running rclone selfupdate, using a dedicated Google Drive test account and newly created synthetic files.
Expected result: a complete 1552-byte JSON document.
Actual result: only the first 17 bytes of the replacement remained. Both reading the mounted file and independently downloading the object with rclone cat returned the same truncated contents:
{"value":"new-new
This is incomplete JSON. It is the beginning of the new contents, not a restoration of the original file.
The original file was 17 bytes long. After the atomic replacement, rclone logged that the new 1552-byte cached file was unexpectedly larger than the 17-byte remote object and truncated it to 17 bytes. A subsequent upload eventually succeeded, leaving the truncated contents on Google Drive.
There was no unclean shutdown. The test used a newly created directory and files.
Test results on the same mount:
| Scenario | Expected size | Mounted result | Independent Google Drive read |
|---|---|---|---|
| GIO replacement, no previously opened read handle, growing file | 1552 | 1552 — correct contents | 1552 — correct contents |
| GIO replacement, no previously opened read handle, unchanged file size | 1552 | 1552 — correct contents | 1552 — correct contents |
| GIO replacement, old read handle first read after replacement | 1552 | 17 — truncated | 17 — truncated |
The test stopped at the first data-loss result, so the remaining planned scenarios were not executed.
Reproduction sequence:
- Create a valid 17-byte JSON file in a new directory on the mounted Google Drive.
- Wait for its upload to complete and independently verify its contents with
rclone cat. - Open the mounted file with
os.open(path, os.O_RDONLY), without reading from that descriptor yet. - Replace the file with a valid 1552-byte JSON document using
Gio.File.replace_contents. - Read from the old descriptor with
os.pread(fd, 65536, 0). - Read the destination through the mount.
- Close the old descriptor, wait for upload completion, and independently read the Google Drive object with
rclone cat.
The core operation sequence was:
fd = os.open(path, os.O_RDONLY)
try:
success, _ = Gio.File.new_for_path(str(path)).replace_contents(
replacement,
None,
False,
Gio.FileCreateFlags.NONE,
None,
)
assert success
old_reader_data = os.pread(fd, 65536, 0)
mounted_data = path.read_bytes()
finally:
os.close(fd)
Here, path refers to the previously uploaded test file and replacement contains the new 1552-byte JSON document.
The payloads were constructed as follows:
def payload(size, label):
prefix, suffix = b'{"value":"', b'"}\n'
count = size - len(prefix) - len(suffix)
value = ((label + "-").encode() * (count + 1))[:count]
return prefix + value + suffix
original = payload(17, "old")
replacement = payload(1552, "new")
Before replacement, the initial upload was confirmed using clean file-specific VFS cache metadata with a remote fingerprint, an idle upload queue, and an independent remote read. After replacement, upload completion was confirmed again before the final independent remote read.
The mounted and downloaded results were byte-for-byte identical and exactly equal to replacement[:17].
Environment:
- Ubuntu 26.04.1 LTS, x86_64
- GLib/GIO:
2.88.0-1ubuntu0.1 - Real Google Drive backend mounted through rclone FUSE
- VFS cache mode:
full - The reproduction calls GIO directly; it does not require launching a text editor.
Run the command 'rclone version' and share the full output of the command.
I ran rclone selfupdate before this test. The installed version reports:
rclone v1.76.0
- os/version: ubuntu 26.04 (64 bit)
- os/kernel: 7.0.0-44-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.27.3
- go/linking: static
- go/tags: none
The running mount was also checked through core/version and confirmed to be using v1.76.0.
Which cloud storage system are you using? (eg Google Drive)
Google Drive.
The reproduction used a dedicated development remote named google-drive-dev, with synthetic files in a newly created test directory.
The command you were trying to run (eg rclone copy /tmp remote:tmp)
The mount is launched through Talaryn, a GUI wrapper around rclone. The recorded mount command was:
rclone mount google-drive-dev: /home/user/cloud/google-drive-dev \
--vfs-cache-mode full \
--vfs-cache-max-size 10G \
--vfs-cache-max-age 24h \
--dir-cache-time 1h \
--umask 022 \
--drive-export-formats link.html \
--cache-dir /home/user/.cache/talaryn/google-drive-dev \
--log-file /home/user/.cache/talaryn/google-drive-dev.log \
--log-level INFO \
--rc \
--rc-addr unix:///run/user/1000/talaryn/google-drive-dev.sock \
--rc-no-auth \
--log-file-max-size 10M \
--log-file-max-backups 3 \
--log-file-max-age 30d
/home/user replaces my personal home-directory path.
For the test, logging was changed from INFO to DEBUG at runtime through the mount's RC options/set endpoint. The equivalent RC command is:
rclone rc \
--unix-socket /run/user/1000/talaryn/google-drive-dev.sock \
options/set \
--json '{"main":{"LogLevel":"DEBUG"}}'
The previous INFO level was restored after the test.
Neither --vfs-write-back nor --vfs-handle-caching was explicitly set. The running VFS reported WriteBack: 5s and HandleCaching: 5s.
The independent remote verification used:
rclone cat \
google-drive-dev:rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json \
--config /home/user/.config/rclone/rclone.conf \
--log-level ERROR
The rclone config contents with secrets removed.
[google-drive-dev]
type = drive
scope = drive
client_id =
client_secret =
token = REDACTED
team_drive =
A log from the command with the -vv flag
The mount was switched to DEBUG logging through RC for this test. Below are the relevant DEBUG/INFO/ERROR lines; unrelated polling and other debug lines are omitted.
Timestamps are local time, UTC+01:00.
The initial 17-byte file was successfully uploaded before the replacement:
2026/11/29 21:53:51 INFO : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: Copied (new)
2026/11/29 21:53:51 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: fingerprint now "17,2026-11-29 20:53:45.458 +0000 UTC,9dc59bf221719bf142a2877bbf5514f5"
2026/11/29 21:53:51 INFO : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: upload succeeded try #1
GIO then wrote the replacement and renamed the temporary file over the destination:
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/.goutputstream-V6MCZ3(0x2f3e83053580): _writeAt: size=1552, off=0
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/.goutputstream-V6MCZ3(0x2f3e83053580): >_writeAt: n=1552, err=<nil>
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/.goutputstream-V6MCZ3: Fsync:
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/.goutputstream-V6MCZ3: >Fsync: err=<nil>
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/: Rename: oldName=".goutputstream-V6MCZ3", newName="00-gio-late-17-1552.json", newDir=rclone-vfs-repro-20261129-215211-291ba603/
2026/11/29 21:53:55 INFO : rclone-vfs-repro-20261129-215211-291ba603/.goutputstream-V6MCZ3: vfs cache: renamed in cache to "rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json"
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/: >Rename: err=<nil>
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: >Attr: a=valid=1s ino=0 size=1552 mode=-rw-r--r--, err=<nil>
Reading from the previously opened handle was followed by the cache-recovery message and truncation:
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json(0x2f3e830530c0): _readAt: size=4096, off=0
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json(0x2f3e830530c0): openPending:
2026/11/29 21:53:55 INFO : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: queuing for upload in 5s
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: checking remote fingerprint "17,2026-11-29 20:53:45.458 +0000 UTC,9dc59bf221719bf142a2877bbf5514f5" against cached fingerprint "17,2026-11-29 20:53:45.458 +0000 UTC,9dc59bf221719bf142a2877bbf5514f5"
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: truncate to size=1552 (not needed as size correct)
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json(0x2f3e830530c0): >openPending: err=<nil>
2026/11/29 21:53:55 ERROR : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: cached file (1552) is unexpectedly larger than the remote object (17). The cached file is likely corrupted after an unclean shutdown; recovering the 17 bytes available from the remote
2026/11/29 21:53:55 DEBUG : vfs cache: looking for range={Pos:0 Size:17} in [{Pos:0 Size:17}] - present true
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: Size has changed from 1552 to 17
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: truncate to size=17
2026/11/29 21:53:55 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json(0x2f3e830530c0): >_readAt: n=17, err=EOF
The first upload attempt failed because the source modification time changed. The retry subsequently uploaded the truncated file:
2026/11/29 21:54:30 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: size = 17 OK
2026/11/29 21:54:30 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: md5 = fbdc05cc1abf324454de11476a1889c5 OK
2026/11/29 21:54:30 INFO : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: Copied (new)
2026/11/29 21:54:30 DEBUG : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: fingerprint now "17,2026-11-29 20:53:45.458 +0000 UTC,fbdc05cc1abf324454de11476a1889c5"
2026/11/29 21:54:30 INFO : rclone-vfs-repro-20261129-215211-291ba603/00-gio-late-17-1552.json: vfs cache: upload succeeded try #2
After upload completion, the independently downloaded Google Drive object matched the truncated mounted contents exactly.
The expected replacement SHA-256 was:
7f2b9528664bc6b6f6f6a1d654391f264e98d6e5e28ad2ecc3f4c8cab37fe5ea
Both the mounted result and independently downloaded result had SHA-256:
33bf4767d43d7d31b4d345e96e0636212886e2fb4d94406ab5971796229c2801