Windows webdav mount thinks it may write to read-only files on webdav server

Excellent question!

And yes, Samba or NFS would have been my preference, too, but unfortunately the server behind the webdav server does not do any of these.
Currently, webdav seems to be the only semi-standard way to get files in and out - and we were delighted to see the speed at which rclone does this; now we are trying to figure out whether we have to make this a --read-only mount...

a shame, on that linux server, cannot install samba or some spin up a docker or some container with samba support.

imho, a rclone mount --vfs-cache-mode=writes over a webdav server with a combintation of ro+rw folders is not a viable solution.

Regarding "ro+rw" - thanks for confirming.

I start to wonder whether webdav in general is capable of transmitting/translating the permissions at all...

That leaves us with the remaining issue of rclone never giving up retrying to write something it cannot write to, despite the --retries 1 option... (see above) and the (IMO) failure to promote that error to the Windows user

to be clear, i was just stating my opinion, not confirming anything.
it might be possible to battle test a solution or perhaps wonder about another out of the box idea.

So is this a bug that the Windows file system mounted by rclone does not get notified of the write error (unless --read-only is used)?

I've answered that numerous times already...

Please see my above posts as I've answered this one too...

No, it is generally impossible to return file update errors from a mount using a write-behind cache, this is nothing specific to rclone, webdav or Windows. This is what @Animosity022 has been trying to tell you all the time.

You see a similar situation with the native OneDrive client on Windows if you provoke a sync/write conflict – it only shows the issue/error in the extended OneDrive status view. I guess you can see the same in the clients for Google Drive, Dropbox, etc.

The benefit of write-behind caching is the improved resilience in case of network glitches and the improved user experience:

but it sometimes comes at a price, as you have seen.

It may be possible to report an error if using --vfs-cache-mode=off, but this limits the usability significantly and it probably has the same response times as the native webdav support in Windows.

I would either go for the native webdav support in Windows, or split the data such that each user has two rclone mounts (one writeable and one --read-only).

Hi Ole,

thanks for helping me understand.

Here's what I get when trying to avoid the cache (without resorting to --read-only):

2021/12/14 16:48:50 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone.exe" "mount" "webdav:" "X:" "--network-mode" "--vfs-cache-mode" "off" "--log-file" "./rclone.log" "--log-level" "DEBUG" "--retries" "0"]
2021/12/14 16:48:50 DEBUG : Creating backend with remote "webdav:"
2021/12/14 16:48:50 DEBUG : Using config file from "C:\\Users\\localuser\\AppData\\Roaming\\rclone\\rclone.conf"
2021/12/14 16:48:50 DEBUG : found headers: 
2021/12/14 16:48:50 INFO  : webdav root '': poll-interval is not supported by this remote
2021/12/14 16:48:50 NOTICE: webdav root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2021/12/14 16:48:50 DEBUG : Network mode mounting is enabled
2021/12/14 16:48:50 DEBUG : Mounting on "X:" ("\\server\\webdav")
2021/12/14 16:48:50 DEBUG : webdav root '': Mounting with options: ["-o" "attr_t
[...]
2021/12/14 16:49:24 DEBUG : /readonlyfolder: Mkdir: mode=0700
2021/12/14 16:49:24 DEBUG : /readonlyfolder: >Mkdir: errc=0
2021/12/14 16:49:24 DEBUG : /readonlyfolder: Opendir: 
2021/12/14 16:49:24 DEBUG : /readonlyfolder: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2021/12/14 16:49:24 DEBUG : /readonlyfolder: >OpenFile: fd=readonlyfolder/ (r), err=<nil>
2021/12/14 16:49:24 DEBUG : /readonlyfolder: >Opendir: errc=0, fh=0x5
[...]
2021/12/14 16:49:24 DEBUG : /readonlyfolder: Getattr: fh=0xFFFFFFFFFFFFFFFF
2021/12/14 16:49:24 DEBUG : /readonlyfolder: >Getattr: errc=0
2021/12/14 16:49:24 DEBUG : /readonlyfolder/rclone.exe: CreateEx: flags=0x502, mode=0700
2021/12/14 16:49:24 DEBUG : readonlyfolder/rclone.exe: Open: flags=O_RDWR|O_CREATE|O_EXCL
2021/12/14 16:49:24 DEBUG : readonlyfolder: Added virtual directory entry vAddFile: "rclone.exe"
2021/12/14 16:49:24 DEBUG : readonlyfolder/rclone.exe: >Open: fd=readonlyfolder/rclone.exe (w), err=<nil>
[...]
2021/12/14 16:49:24 DEBUG : webdav root '': Target remote doesn't support streaming uploads, creating temporary local FS to spool file
2021/12/14 16:49:24 DEBUG : /readonlyfolder/rclone.exe: >Write: n=1048576
2021/12/14 16:49:24 DEBUG : Creating backend with remote "C:/Users/localuser/AppData/Local/Temp/rclone-spool1946678196"
[...]
2021/12/14 16:49:24 DEBUG : /readonlyfolder/rclone.exe: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2021/12/14 16:49:24 DEBUG : readonlyfolder/rclone.exe: Open: flags=O_RDONLY
2021/12/14 16:49:25 ERROR : readonlyfolder/rclone.exe: Failed to copy: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<hr>
<address>Apache/2.4.29 (Ubuntu) Server at webdavserver Port 80</address>
</body></html>: 403 Forbidden
2021/12/14 16:49:25 ERROR : readonlyfolder/rclone.exe: WriteFileHandle.New Rcat failed: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<hr>
<address>Apache/2.4.29 (Ubuntu) Server at webdavserver Port 80</address>
</body></html>: 403 Forbidden
2021/12/14 16:49:25 ERROR : readonlyfolder/rclone.exe: WriteFileHandle.Flush error: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<hr>
<address>Apache/2.4.29 (Ubuntu) Server at webdavserver Port 80</address>
</body></html>: 403 Forbidden
2021/12/14 16:49:25 ERROR : IO error: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<hr>
<address>Apache/2.4.29 (Ubuntu) Server at webdavserver Port 80</address>
</body></html>: 403 Forbidden
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: >Flush: errc=-5
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: Release: fh=0x3
2021/12/14 16:49:25 DEBUG : readonlyfolder/rclone.exe: WriteFileHandle.Release nothing to do
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: >Release: errc=0
2021/12/14 16:49:25 DEBUG : readonlyfolder/rclone.exe: >Open: fd=<nil *ReadFileHandle>, err=can't open file - writer failed
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: >OpenFile: fd=<nil *ReadFileHandle>, err=can't open file - writer failed
2021/12/14 16:49:25 ERROR : IO error: can't open file - writer failed
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: >OpenEx: errc=-5, fh=0xFFFFFFFFFFFFFFFF
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: Getattr: fh=0xFFFFFFFFFFFFFFFF
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: >Getattr: errc=0
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: Getattr: fh=0xFFFFFFFFFFFFFFFF
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: >Getattr: errc=0
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: OpenEx: flags=0x0
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2021/12/14 16:49:25 DEBUG : readonlyfolder/rclone.exe: Open: flags=O_RDONLY
2021/12/14 16:49:25 DEBUG : readonlyfolder/rclone.exe: >Open: fd=<nil *ReadFileHandle>, err=can't open file - writer failed
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: >OpenFile: fd=<nil *ReadFileHandle>, err=can't open file - writer failed
2021/12/14 16:49:25 ERROR : IO error: can't open file - writer failed
2021/12/14 16:49:25 DEBUG : /readonlyfolder/rclone.exe: >OpenEx: errc=-5, fh=0xFFFFFFFFFFFFFFFF

I've answered that a few times now as well:

Glad to help.

Which option are you pursuing?

1 Like

good point.

wanted the OP to know that rclone mount can mount to a folder, instead of a drive and then create a virtual drive letter for both mounts

rclone mount remote01: b:\rclone\mount\01
rclone mount remote02: b:\rclone\mount\02
subst x: B:\rclone\mount

rclone tree b:\rclone\mount\01 --max-depth=1
/
├── audio
├── books
├── movies
└── tv

rclone tree b:\rclone\mount\02 --max-depth=1
/
├── WindowsFrotz
├── data
├── save
└── zork_dos_win


rclone tree x: -L --max-depth=2
/
├── 01
│   ├── audio
│   ├── books
│   ├── movies
│   └── tv
└── 02
    ├── WindowsFrotz
    ├── data
    ├── save
    └── zork_dos_win

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