How to get rclone mount to issue an I/O timeout after a remote becomes unavaliable

What is the problem you are having with rclone?

If a device goes offline, the rclone mount command does not issue a timeout. Applications that are trying to use files in an rclone mount either display a forever spinning icon or they freeze completely.

What is your rclone version (output from rclone version)

rclone v1.54.0

  • os/arch: linux/amd64
  • go version: go1.15.7

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Linux x64
Android 10

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

pCloud

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

/usr/bin/rclone mount \
>     --config=rclone.conf \
>     -v \
>     --cache-dir=/tmp/rclone \
>     --uid=1000 \
>     --dir-perms=0777 \
>     --gid=1000 \
>     --vfs-cache-mode=writes \
>     --attr-timeout=1s \
> remote: /path

I would like to know, if there a command I can issue to rclone mount to force it to give up and issue a timeout after a period of not being able to access a remote? This scenario occurs when the device goes offline and the remote is not reachable.

I have tested a variety of file accessing apps on Linux and Android (file managers, password stores, photo and music apps) etc. They all behave well as long as the remote is accessible. If the device goes offline and the app attempts to access a file, they either show a "forever spinner" or their UI freezes entirely.

I think this is because all of the apps assume that the file stores are local and always available. When using rclone mount this is not always the case. All of the apps get stuck in this weird indeterminate state where they do not realize the files are offline so they keep trying indefinite to accesss the files.

Is it possible to set a timeout in this case to help the apps understand that the files are not available so they can better recover from this state?

I reviewed all of commands here but didn't see anything:

https://rclone.org/commands/rclone_mount/

Meaning you lose network access?

Majority of systems get hung up as they are expecting network access so you can always restart it.

Some folks do process monitoring or things like that. I wouldn't expect rclone to deal with things like that as it will time out, but it takes time.

Lose network access is one scenario. Another is when running rclone on a mobile device (phone). I am specifically talking about the rclone remote command so the apps most likely not expecting that the files they are tying to access are on network (cloud) drives. To them it looks like the files are a local filesystem.

One example, If I put my phone into airplane mode or lost wifi or cellular signal and try to open a note taking app it freezes the UI as soon as it tried to access a file- which is immediate. Rclone isn't telling the apps that the file is unavailable and the app never recovers, it will always keep trying to read the file until the device goes back online.

The same for the file manager apps. They are assume that the rclone mount is a local file (because to their view it is) and should always be available. They either freeze or forever spin trying to continuously access the files.

I want to know is it possible for me to set the timeout on an rclone mount command when the remote is not available?

I think rclone is the only place to deal with this scenario because rclone is the bridge between the file on the remove internet system and the local app. The apps can't deal with it because they do not know the files they are trying to access are fuse mounted remotes. To them they look like a local filesystem.

I have so far waited for up to 45 minutes. The apps are constantly trying to access the file, rclone is not registering any error. What is the default timeout and can it be set?

These applications mostly work and an rclone mounted fuse drive is the stuff of magic but it would really help the apps out if rclone mount could send them an IO error or similar signal after a period when the remote is not available. Currently it seems that rclone just allows them to keep asking to access the file over an over sort of a weird available but not available state even after the remove is not available.

Do you know if it is possible to set an IO timeout on an rclone remote command?

If you paste a log with -vv of what rclone does after the remote filesystem has gone away that might give a clue.

You can try --timeout and --conntimeout and they may help.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.