Copying a file to a webdav directory with read-only permissions, which is mounted locally via rclone mount

What is the problem you are having with rclone?

A locally mounted remote webdav read-only folder allows you to copy a file there. The file is located in vfs and tries to transfer to a remote folder but is refused, 403 error

ilya@ilya-Lenovo-C440:/mnt/portal$ touch 1.dat
touch: failed to close '1.dat': Input/output error
ilya@ilya-Lenovo-C440:/mnt/portal$ mkdir test
mkdir: cannot create directory ‘test’: Input/output error
ilya@ilya-Lenovo-C440:/mnt/portal$ cp /home/ilya/1.dat .
ilya@ilya-Lenovo-C440:/mnt/portal$ ls 1.dat
1.dat

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

rclone v1.67.0

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 6.2.0-39-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.4
  • go/linking: static
  • go/tags: none

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

alfresco webdav
vendor - other

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

rclone mount "test_load:/" /mnt/portal/ --vfs-cache-mode minimal -vv --no-check-certificate   --cache-workers 8  --attr-timeout 3s --dir-cache-time 10s   --webdav-pacer-min-sleep 0 -log-level=DEBUG --log-file=/home/ilya/rclone-mount-debug10.log

The rclone config contents with secrets removed.

[test_load]
type = webdav
pass = ***
url = https://192.168.100.21/alfresco/webdav
vendor = other
user = i.chibisov
bearer_token =
bearer_token_command =
encoding =
headers =
pacer_min_sleep =
nextcloud_chunk_size =
owncloud_exclude_shares = false
description =

A log from the command with the -vv flag

2024/07/04 19:20:06 NOTICE: webdav root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2024/07/04 19:20:06 Fatal error: failed to mount FUSE fs: directory already mounted, use --allow-non-empty to mount anyway: /mnt/portal
2024/07/04 19:20:19 NOTICE: webdav root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2024/07/04 19:20:19 Fatal error: failed to mount FUSE fs: directory already mounted, use --allow-non-empty to mount anyway: /mnt/portal
2024/07/04 19:20:38 DEBUG : rclone: Version "v1.67.0" starting with parameters ["rclone" "mount" "test_load:/" "/mnt/portal/" "--vfs-cache-mode" "minimal" "-vv" "--no-check-certificate" "--cache-workers" "8" "--attr-timeout" "3s" "--dir-cache-time" "10s" "--webdav-pacer-min-sleep" "0" "-log-level=DEBUG" "--log-file=/home/ilya/rclone-mount-debug10.log"]
2024/07/04 19:20:38 DEBUG : Creating backend with remote "test_load:/"
2024/07/04 19:20:38 DEBUG : Using config file from "/home/ilya/.config/rclone/rclone.conf"
2024/07/04 19:20:38 DEBUG : test_load: detected overridden config - adding "{xWQ76}" suffix to name
2024/07/04 19:20:38 DEBUG : found headers: 
2024/07/04 19:20:38 DEBUG : fs cache: renaming cache item "test_load:/" to be canonical "test_load{xWQ76}:"
2024/07/04 19:20:38 INFO  : webdav root '': poll-interval is not supported by this remote
2024/07/04 19:20:38 NOTICE: webdav root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2024/07/04 19:20:38 DEBUG : vfs cache: root is "/home/ilya/.cache/rclone"
2024/07/04 19:20:38 DEBUG : vfs cache: data root is "/home/ilya/.cache/rclone/vfs/test_load{xWQ76}"
2024/07/04 19:20:38 DEBUG : vfs cache: metadata root is "/home/ilya/.cache/rclone/vfsMeta/test_load{xWQ76}"
2024/07/04 19:20:38 DEBUG : Creating backend with remote "/home/ilya/.cache/rclone/vfs/test_load{xWQ76}/"
2024/07/04 19:20:38 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
2024/07/04 19:20:38 DEBUG : fs cache: renaming cache item "/home/ilya/.cache/rclone/vfs/test_load{xWQ76}/" to be canonical "local{b6816}:/home/ilya/.cache/rclone/vfs/test_load{xWQ76}"
2024/07/04 19:20:38 DEBUG : Creating backend with remote "/home/ilya/.cache/rclone/vfsMeta/test_load{xWQ76}/"
2024/07/04 19:20:38 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
2024/07/04 19:20:38 DEBUG : fs cache: renaming cache item "/home/ilya/.cache/rclone/vfsMeta/test_load{xWQ76}/" to be canonical "local{b6816}:/home/ilya/.cache/rclone/vfsMeta/test_load{xWQ76}"
2024/07/04 19:20:38 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2024/07/04 19:20:38 Fatal error: failed to mount FUSE fs: directory already mounted, use --allow-non-empty to mount anyway: /mnt/portal
2024/07/04 19:21:50 DEBUG : rclone: Version "v1.67.0" starting with parameters ["rclone" "mount" "test_load:/" "/mnt/portal/" "--vfs-cache-mode" "minimal" "-vv" "--no-check-certificate" "--cache-workers" "8" "--attr-timeout" "3s" "--dir-cache-time" "10s" "--webdav-pacer-min-sleep" "0" "-log-level=DEBUG" "--log-file=/home/ilya/rclone-mount-debug10.log"]
2024/07/04 19:21:50 DEBUG : Creating backend with remote "test_load:/"
2024/07/04 19:21:50 DEBUG : Using config file from "/home/ilya/.config/rclone/rclone.conf"
2024/07/04 19:21:50 DEBUG : test_load: detected overridden config - adding "{xWQ76}" suffix to name
2024/07/04 19:21:50 DEBUG : found headers: 
2024/07/04 19:21:50 DEBUG : fs cache: renaming cache item "test_load:/" to be canonical "test_load{xWQ76}:"
2024/07/04 19:21:50 INFO  : webdav root '': poll-interval is not supported by this remote
2024/07/04 19:21:50 NOTICE: webdav root '': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2024/07/04 19:21:50 DEBUG : vfs cache: root is "/home/ilya/.cache/rclone"
2024/07/04 19:21:50 DEBUG : vfs cache: data root is "/home/ilya/.cache/rclone/vfs/test_load{xWQ76}"
2024/07/04 19:21:50 DEBUG : vfs cache: metadata root is "/home/ilya/.cache/rclone/vfsMeta/test_load{xWQ76}"
2024/07/04 19:21:50 DEBUG : Creating backend with remote "/home/ilya/.cache/rclone/vfs/test_load{xWQ76}/"
2024/07/04 19:21:50 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
2024/07/04 19:21:50 DEBUG : fs cache: renaming cache item "/home/ilya/.cache/rclone/vfs/test_load{xWQ76}/" to be canonical "local{b6816}:/home/ilya/.cache/rclone/vfs/test_load{xWQ76}"
2024/07/04 19:21:50 DEBUG : Creating backend with remote "/home/ilya/.cache/rclone/vfsMeta/test_load{xWQ76}/"
2024/07/04 19:21:50 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
2024/07/04 19:21:50 DEBUG : fs cache: renaming cache item "/home/ilya/.cache/rclone/vfsMeta/test_load{xWQ76}/" to be canonical "local{b6816}:/home/ilya/.cache/rclone/vfsMeta/test_load{xWQ76}"
2024/07/04 19:21:50 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2024/07/04 19:21:50 DEBUG : webdav root '': Mounting on "/mnt/portal/"
2024/07/04 19:21:50 ERROR : -o/--option not supported with this FUSE backend
2024/07/04 19:21:50 DEBUG : : Root: 
2024/07/04 19:21:50 DEBUG : : >Root: node=/, err=<nil>
2024/07/04 19:22:10 DEBUG : : forgetting directory cache
2024/07/04 19:22:19 DEBUG : /: Attr: 
2024/07/04 19:22:19 DEBUG : /: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:22:21 DEBUG : /: ReadDirAll: 
2024/07/04 19:22:21 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/07/04 19:22:21 DEBUG : /: Lookup: name="Домашние пространства пользователей"
2024/07/04 19:22:21 DEBUG : /: >Lookup: node=Домашние пространства пользователей/, err=<nil>
2024/07/04 19:22:21 DEBUG : Домашние пространства пользователей/: Attr: 
2024/07/04 19:22:21 DEBUG : Домашние пространства пользователей/: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:22:21 DEBUG : /: Lookup: name="Сайты"
2024/07/04 19:22:21 DEBUG : /: >Lookup: node=Сайты/, err=<nil>
2024/07/04 19:22:21 DEBUG : Сайты/: Attr: 
2024/07/04 19:22:21 DEBUG : Сайты/: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:22:36 DEBUG : /: Lookup: name="1.dat"
2024/07/04 19:22:36 DEBUG : : Re-reading directory (14.582616272s old)
2024/07/04 19:22:36 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2024/07/04 19:22:36 DEBUG : /: Create: name="1.dat"
2024/07/04 19:22:36 DEBUG : 1.dat: Open: flags=O_WRONLY|O_CREATE|0x800
2024/07/04 19:22:36 DEBUG : : Added virtual directory entry vAddFile: "1.dat"
2024/07/04 19:22:36 DEBUG : 1.dat: >Open: fd=1.dat (w), err=<nil>
2024/07/04 19:22:36 DEBUG : /: >Create: node=1.dat, handle=&{1.dat (w)}, err=<nil>
2024/07/04 19:22:36 DEBUG : 1.dat: Attr: 
2024/07/04 19:22:36 DEBUG : 1.dat: Set virtual modtime to 2024-07-04 19:22:36.347501334 +0700 +07 m=+46.125863689
2024/07/04 19:22:36 DEBUG : 1.dat: >Attr: a=valid=3s ino=0 size=0 mode=-rw-rw-r--, err=<nil>
2024/07/04 19:22:36 DEBUG : &{1.dat (w)}: Flush: 
2024/07/04 19:22:36 DEBUG : 1.dat: WriteFileHandle.Flush unwritten handle, writing 0 bytes to avoid race conditions
2024/07/04 19:22:36 DEBUG : : Added virtual directory entry vAddFile: "1.dat"
2024/07/04 19:22:36 DEBUG : &{1.dat (w)}: >Flush: err=<nil>
2024/07/04 19:22:36 DEBUG : 1.dat: Setattr: a=Setattr [ID=0x1a Node=0x4 Uid=1000 Gid=1000 Pid=423049] atime=2024-07-04 19:22:36.343030748 +0700 +07 atime=now mtime=2024-07-04 19:22:36.343030748 +0700 +07 mtime=now handle=INVALID-0x0
2024/07/04 19:22:36 DEBUG : 1.dat: >Setattr: err=<nil>
2024/07/04 19:22:36 DEBUG : 1.dat: Attr: 
2024/07/04 19:22:36 DEBUG : 1.dat: Set virtual modtime to 2024-07-04 19:22:36.343030748 +0700 +07
2024/07/04 19:22:36 DEBUG : 1.dat: >Attr: a=valid=3s ino=0 size=0 mode=-rw-rw-r--, err=<nil>
2024/07/04 19:22:36 DEBUG : &{1.dat (w)}: Flush: 
2024/07/04 19:22:36 DEBUG : webdav root '': File to upload is small (0 bytes), uploading instead of streaming
2024/07/04 19:22:36 DEBUG : 1.dat: Update will use the normal upload strategy (no chunks)
2024/07/04 19:22:37 ERROR : 1.dat: WriteFileHandle.New Rcat failed: 403 Forbidden
2024/07/04 19:22:37 DEBUG : 1.dat: Remove: 
2024/07/04 19:22:37 DEBUG : : Added virtual directory entry vDel: "1.dat"
2024/07/04 19:22:37 DEBUG : 1.dat: >Remove: err=<nil>
2024/07/04 19:22:37 ERROR : 1.dat: WriteFileHandle.Flush error: 403 Forbidden
2024/07/04 19:22:37 ERROR : IO error: 403 Forbidden
2024/07/04 19:22:37 DEBUG : &{1.dat (w)}: >Flush: err=403 Forbidden
2024/07/04 19:22:37 DEBUG : &{1.dat (w)}: Release: 
2024/07/04 19:22:37 DEBUG : 1.dat: WriteFileHandle.Release nothing to do
2024/07/04 19:22:37 DEBUG : &{1.dat (w)}: >Release: err=<nil>
2024/07/04 19:22:41 DEBUG : Сайты: forgetting directory cache
2024/07/04 19:22:41 DEBUG : Домашние пространства пользователей: forgetting directory cache
2024/07/04 19:22:45 DEBUG : /: Attr: 
2024/07/04 19:22:45 DEBUG : /: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:22:45 DEBUG : /: Lookup: name="test"
2024/07/04 19:22:45 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2024/07/04 19:22:45 DEBUG : /: Mkdir: name="test"
2024/07/04 19:22:45 ERROR : /: Dir.Mkdir failed to create directory: 403 Forbidden
2024/07/04 19:22:45 ERROR : IO error: 403 Forbidden
2024/07/04 19:22:45 DEBUG : /: >Mkdir: node=<nil>, err=403 Forbidden
2024/07/04 19:22:50 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item 1.dat not removed, freed 0 bytes
2024/07/04 19:22:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2024/07/04 19:22:56 DEBUG : : forgetting directory cache
2024/07/04 19:22:56 DEBUG : Домашние пространства пользователей: forgetting directory cache
2024/07/04 19:22:56 DEBUG : Сайты: forgetting directory cache
2024/07/04 19:22:56 DEBUG : : Removed virtual directory entry vDel: "1.dat"
2024/07/04 19:22:58 DEBUG : /: Attr: 
2024/07/04 19:22:58 DEBUG : /: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:23:11 DEBUG : /: Attr: 
2024/07/04 19:23:11 DEBUG : /: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:23:11 DEBUG : 1.dat: Attr: 
2024/07/04 19:23:11 DEBUG : 1.dat: >Attr: a=valid=3s ino=0 size=0 mode=-rw-rw-r--, err=<nil>
2024/07/04 19:23:11 DEBUG : 1.dat: Open: flags=OpenWriteOnly
2024/07/04 19:23:11 DEBUG : 1.dat: Open: flags=O_WRONLY
2024/07/04 19:23:11 DEBUG : 1.dat: >Open: fd=1.dat (w), err=<nil>
2024/07/04 19:23:11 DEBUG : 1.dat: >Open: fh=&{1.dat (w)}, err=<nil>
2024/07/04 19:23:11 DEBUG : 1.dat: Setattr: a=Setattr [ID=0x30 Node=0x4 Uid=1000 Gid=1000 Pid=423075] size=0 handle=INVALID-0x0 lockowner
2024/07/04 19:23:11 DEBUG : 1.dat: Truncating 1 file handles
2024/07/04 19:23:11 DEBUG : 1.dat: >Setattr: err=<nil>
2024/07/04 19:23:11 DEBUG : 1.dat: Attr: 
2024/07/04 19:23:11 DEBUG : 1.dat: >Attr: a=valid=3s ino=0 size=0 mode=-rw-rw-r--, err=<nil>
2024/07/04 19:23:11 DEBUG : &{1.dat (w)}: Flush: 
2024/07/04 19:23:11 DEBUG : 1.dat: WriteFileHandle.Flush unwritten handle, writing 0 bytes to avoid race conditions
2024/07/04 19:23:11 DEBUG : : Added virtual directory entry vAddFile: "1.dat"
2024/07/04 19:23:11 DEBUG : &{1.dat (w)}: >Flush: err=<nil>
2024/07/04 19:23:11 DEBUG : &{1.dat (w)}: Release: 
2024/07/04 19:23:11 DEBUG : 1.dat: WriteFileHandle.Release closing
2024/07/04 19:23:11 DEBUG : webdav root '': File to upload is small (0 bytes), uploading instead of streaming
2024/07/04 19:23:11 DEBUG : 1.dat: Update will use the normal upload strategy (no chunks)
2024/07/04 19:23:12 ERROR : 1.dat: WriteFileHandle.New Rcat failed: 403 Forbidden
2024/07/04 19:23:12 DEBUG : 1.dat: Remove: 
2024/07/04 19:23:12 DEBUG : : Added virtual directory entry vDel: "1.dat"
2024/07/04 19:23:12 DEBUG : 1.dat: >Remove: err=<nil>
2024/07/04 19:23:12 ERROR : 1.dat: WriteFileHandle.Release error: 403 Forbidden
2024/07/04 19:23:12 ERROR : IO error: 403 Forbidden
2024/07/04 19:23:12 DEBUG : &{1.dat (w)}: >Release: err=403 Forbidden
2024/07/04 19:23:14 DEBUG : /: ReadDirAll: 
2024/07/04 19:23:14 DEBUG : : Removed virtual directory entry vDel: "1.dat"
2024/07/04 19:23:14 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/07/04 19:23:14 DEBUG : /: Lookup: name="Домашние пространства пользователей"
2024/07/04 19:23:14 DEBUG : /: >Lookup: node=Домашние пространства пользователей/, err=<nil>
2024/07/04 19:23:14 DEBUG : Домашние пространства пользователей/: Attr: 
2024/07/04 19:23:14 DEBUG : Домашние пространства пользователей/: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:23:14 DEBUG : /: Lookup: name="Домашние пространства пользователей"
2024/07/04 19:23:14 DEBUG : /: >Lookup: node=Домашние пространства пользователей/, err=<nil>
2024/07/04 19:23:14 DEBUG : Домашние пространства пользователей/: Attr: 
2024/07/04 19:23:14 DEBUG : Домашние пространства пользователей/: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:23:14 DEBUG : /: Lookup: name="Сайты"
2024/07/04 19:23:14 DEBUG : /: >Lookup: node=Сайты/, err=<nil>
2024/07/04 19:23:14 DEBUG : Сайты/: Attr: 
2024/07/04 19:23:14 DEBUG : Сайты/: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:23:14 DEBUG : /: Lookup: name="Сайты"
2024/07/04 19:23:14 DEBUG : /: >Lookup: node=Сайты/, err=<nil>
2024/07/04 19:23:14 DEBUG : Сайты/: Attr: 
2024/07/04 19:23:14 DEBUG : Сайты/: >Attr: attr=valid=3s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/07/04 19:23:26 DEBUG : 1.dat: Attr: 
2024/07/04 19:23:26 DEBUG : 1.dat: >Attr: a=valid=3s ino=0 size=0 mode=-rw-rw-r--, err=<nil>
2024/07/04 19:23:34 DEBUG : : forgetting directory cache
2024/07/04 19:23:34 DEBUG : Сайты: forgetting directory cache
2024/07/04 19:23:34 DEBUG : Домашние пространства пользователей: forgetting directory cache
2024/07/04 19:23:34 DEBUG : Домашние пространства пользователей: forgetting directory cache
2024/07/04 19:23:34 DEBUG : Сайты: forgetting directory cache
2024/07/04 19:23:47 INFO  : Signal received: interrupt
2024/07/04 19:23:47 ERROR : /mnt/portal/: Failed to unmount: exit status 1: fusermount3: failed to unmount /mnt/portal: Device or resource busy
2024/07/04 19:23:47 DEBUG : vfs cache: cleaner exiting
2024/07/04 19:23:47 INFO  : Exiting...

The problem is that if you open an ms office or libre office document from the RO folder and save it, these files remain in the cache forever

2024/07/05 21:22:41 ERROR : Сайты/-webdav/documentLibrary/Таблица МО.xods: Failed to copy: 403
2024/07/05 21:22:41 ERROR : Сайты/-webdav/documentLibrary/Таблица МО.xods: vfs cache: failed to upload try #21, will retry in 5m0s: vfs cache: failed to transfer file from cache to remote: 403