Onedrive mount stream error: CANCEL; received from peer

What is the problem you are having with rclone?

Received the following error on rclone Onedrive mount when first time adding and scanning library on Plex/Jellyfin:

vfs cache: failed to download: vfs reader: failed to write to cache file: stream error: stream ID 1403; CANCEL; received from peer

Is it beacause of Onedrive API throttled? Anyone experienced something like this before?

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

rclone v1.63.1
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-79-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.6
- go/linking: static
- go/tags: none

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


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

rclone mount onedrive: /data/mount-dir/testing \
--allow-other \
--allow-non-empty \
--poll-interval=1m \
--buffer-size 32M \
--vfs-read-chunk-size=32M \
--vfs-read-chunk-size-limit 2048M \
--vfs-cache-mode full \
--vfs-cache-max-size 100G \
--vfs-read-ahead 256M \
--vfs-cache-max-age 1h \
--cache-dir=/data/cache/onedrive \
--dir-cache-time 1h \
--log-level DEBUG \
--log-file /home/user/onedrive.log \
--timeout 1h \
--umask 000 \
--tpslimit 95 \
--tpslimit-burst 40 \
--checkers 10

The rclone config contents with secrets removed.

type = onedrive
token = {"access_token":"xxx"}
drive_id = xxx
drive_type = business
client_id = xxx
client_secret = xxx

A log from the command with the -vv flag

2023/08/22 21:57:19 ERROR : Media.mkv: vfs cache: failed to download: vfs reader: failed to write to cache file: stream error: stream ID 1403; CANCEL; received from peer

Full log located: onedrive mount error -

welcome to the forum,

is the issue with just that specific file or all flies?

seems like its hitting all the file but in random.

means, when the error appeared, i unmount and mount the remote and rescan again, and other file will be hitting with the same error.

i do not know the exact cause of the error message but onedrive has lots of throttling

you command has a lot of flags, not sure the logic of it?
i would remove all these flags.

--buffer-size 32M \
--vfs-read-chunk-size-limit 2048M \
--vfs-read-ahead 256M
--tpslimit 95 \
--tpslimit-burst 40 \

--checkers 10 does nothing on a mount, so remove that.

--allow-non-empty - remove that, unless 1000% sure you understand it and the reason to use it?

oh i just inherit the flags from the previous google drive mount.

as of --allow-non-empty i use that to avoid force remount error when the mount dropped previously if not mistaken since i'm using mergerfs on that mount-dir with sonarr/radarr directory.

i tried your suggestion by removing the flags and see the same error but notice something new:

vfs cache: stopping download thread as it timed out

the error appear before the file hit the stream error

The issues are most likely caused by onedrive throttling.


--tpslimit 10 \
--tpslimit-burst 0 \

and see if errors still occur. If yes decrease tpslimit, if not you can increase it. tpslimit-burst should be always 0.

1 Like

just thinking out loud,

might be that you are uploading illegal, pirated, copyrighted content and onedrive knows it.
and maybe, in response, onedrive just kills the connection.

for the media file in question, can you upload that one specific file to onedrive using rclone copy --vv --dump=headers

and begs the question, as to why not using a crypt remote to hide that from onedrive?

or mabye your network is having issues?

you posted CANCEL; received from peer but i also see one example of this and not sure what it means?
CANCEL; received from peer is not out of space

small clarification for tpslimit setting. Checking some older posts it looks like --tpslimit 3 is maximum acceptable for onedrive stored media libraries scanning.

here is the dump header log

i think CANCEL; received from peer is not out of space is at the end of the retry

by the way, i haven't try with encrypt. might have to try with another set of encrypt data

tested with --tpslimit set to 3 resulting in the same error

not able to view log

Forbidden (#403)
Error, this is a private paste or is pending moderation. If this paste belongs to you, please login to Pastebin to view it.

its saying pending moderation on the pastebin.

OP, did you get to bottom of this issue? I am getting the same error with encrypted Sharepoint Union as well.

Seems like I haven't find any solution to this. I dump jellyfin and use Plex instead.

With Plex I can do individual directory scan via Plex API. It's a painful process, but with that method I didn't see any error.