What is the problem you are having with rclone?
I am currently trying to modify Rclone so that Bitrix24 webdav can be used as a backend. So far I have made two modifications to the source of 1.61.1 to adapt to Bitrix24 quirks and built a dev version on Ubuntu and on windows:
-
Bitrix24 does not conform to the webdav RFC regarding trailing slashes when moving folders so in /backend/webdav/webdav.go on line 1110 for the dirMove function i changed
"Destination": addSlash(destinationURL.String()),
to
"Destination": destinationURL.String(),
-
Bitrix24 also changes it's behavior by reading the useragent of the webdav client, so in /fs/config.go on line 169 i changed the useragent to windows webdav:
c.UserAgent = "Microsoft-WebDAV-MiniRedir/6.1.7601"
With these modifications everything seems to work correctly and i can mount, change and move files/folders, but there is an issue when saving files.
When any modification is made to a file and saved then temporarily for a few seconds the file modified date is set to Sat Sep 4 12:00:00 AM UTC 1999
After a few seconds it then changes to the correct modified time. This happens on both a windows and linux build.
I suspect this has something to do with the VFS but i can't seem to find the cause. I have tried multiple command line parameters like --refresh-times , --no-modtime , --no-update-modtime, --use-server-modtime and --vfs-fast-fingerprint. None of them fix this specific issue
The same issue shows on a windows build and this causes programs like excel to think that the file was changed when it wasn't, for example :
open a excel file on the mount, make a change, save
-- ok until now, but now the modified date has been set to 1999 --
make a new change and save again, now excel complains that someone else might have changed the file and if i want to save a copy or overwrite, even though only my user has access to this file. This happens even if I wait a few minutes before saving again.
Example from linux: (the date commands are run around less than a second apart:
user@ubuntu:~$ echo sometext > /bitrixmount/user/test/test.txt
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Sat Sep 4 12:00:00 AM UTC 1999
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Sat Sep 4 12:00:00 AM UTC 1999
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Sat Sep 4 12:00:00 AM UTC 1999
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Sat Sep 4 12:00:00 AM UTC 1999
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Sat Sep 4 12:00:00 AM UTC 1999
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Sat Sep 4 12:00:00 AM UTC 1999
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Sat Sep 4 12:00:00 AM UTC 1999
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Sat Sep 4 12:00:00 AM UTC 1999
user@ubuntu:~$ date -r /bitrixmount/user/test/test.txt
Wed Mar 1 11:37:42 AM UTC 2023
Run the command 'rclone version' and share the full output of the command.
rclone v1.61.1-DEV
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-60-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.1
- go/linking: dynamic
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
Self hosted Bitrix24
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
sudo rclone -vv mount buser: /bitrixmount/user --allow-other --uid 1001 --vfs-cache-mode full
The rclone config contents with secrets removed.
[buser]
type = webdav
url = https:[SECRET]
vendor = other
user = [SECRET]
pass = [SECRET]
A log from the command with the -vv
flag
2023/03/01 11:37:28 DEBUG : rclone: Version "v1.61.1-DEV" starting with parameters ["rclone" "-vv" "mount" "user:" "/bitrixmount/user" "--allow-other" "--uid" "1001" "--vfs-cache-mode" "full"]
2023/03/01 11:37:28 DEBUG : Creating backend with remote "user:"
2023/03/01 11:37:28 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/03/01 11:37:28 DEBUG : found headers:
2023/03/01 11:37:28 INFO : webdav root '': poll-interval is not supported by this remote
2023/03/01 11:37:28 DEBUG : vfs cache: root is "/root/.cache/rclone"
2023/03/01 11:37:28 DEBUG : vfs cache: data root is "/root/.cache/rclone/vfs/user"
2023/03/01 11:37:28 DEBUG : vfs cache: metadata root is "/root/.cache/rclone/vfsMeta/user"
2023/03/01 11:37:28 DEBUG : Creating backend with remote "/root/.cache/rclone/vfs/user/"
2023/03/01 11:37:28 DEBUG : fs cache: renaming cache item "/root/.cache/rclone/vfs/user/" to be canonical "/root/.cache/rclone/vfs/user"
2023/03/01 11:37:28 DEBUG : Creating backend with remote "/root/.cache/rclone/vfsMeta/user/"
2023/03/01 11:37:28 DEBUG : fs cache: renaming cache item "/root/.cache/rclone/vfsMeta/user/" to be canonical "/root/.cache/rclone/vfsMeta/user"
2023/03/01 11:37:28 DEBUG : webdav root '': Mounting on "/bitrixmount/user"
2023/03/01 11:37:28 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2023/03/01 11:37:28 DEBUG : : Root:
2023/03/01 11:37:28 DEBUG : : >Root: node=/, err=<nil>
2023/03/01 11:37:36 DEBUG : /: Lookup: name="test"
2023/03/01 11:37:36 DEBUG : /: >Lookup: node=test/, err=<nil>
2023/03/01 11:37:36 DEBUG : test/: Attr:
2023/03/01 11:37:36 DEBUG : test/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2023/03/01 11:37:36 DEBUG : test/: Lookup: name="test.txt"
2023/03/01 11:37:37 DEBUG : test/: >Lookup: node=test/test.txt, err=<nil>
2023/03/01 11:37:37 DEBUG : test/test.txt: Attr:
2023/03/01 11:37:37 DEBUG : test/test.txt: >Attr: a=valid=1s ino=0 size=9 mode=-rw-r--r--, err=<nil>
2023/03/01 11:37:37 DEBUG : test/test.txt: Open: flags=OpenWriteOnly
2023/03/01 11:37:37 DEBUG : test/test.txt: Open: flags=O_WRONLY
2023/03/01 11:37:37 DEBUG : test/test.txt: newRWFileHandle:
2023/03/01 11:37:37 DEBUG : test/test.txt: >newRWFileHandle: err=<nil>
2023/03/01 11:37:37 DEBUG : test/test.txt: >Open: fd=test/test.txt (rw), err=<nil>
2023/03/01 11:37:37 DEBUG : test/test.txt: >Open: fh=&{test/test.txt (rw)}, err=<nil>
2023/03/01 11:37:37 DEBUG : test/test.txt: Setattr: a=Setattr [ID=0xc Node=0x3 Uid=1000 Gid=1000 Pid=117721] size=0 handle=INVALID-0x0 lockowner
2023/03/01 11:37:37 DEBUG : test/test.txt: Truncating 1 file handles
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): openPending:
2023/03/01 11:37:37 DEBUG : test/test.txt: vfs cache: checking remote fingerprint "9" against cached fingerprint ""
2023/03/01 11:37:37 DEBUG : test/test.txt: vfs cache: truncate to size=9
2023/03/01 11:37:37 DEBUG : test: Added virtual directory entry vAddFile: "test.txt"
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): >openPending: err=<nil>
2023/03/01 11:37:37 DEBUG : test/test.txt: vfs cache: truncate to size=0
2023/03/01 11:37:37 DEBUG : test/test.txt: >Setattr: err=<nil>
2023/03/01 11:37:37 DEBUG : test/test.txt: Attr:
2023/03/01 11:37:37 DEBUG : test/test.txt: >Attr: a=valid=1s ino=0 size=0 mode=-rw-r--r--, err=<nil>
2023/03/01 11:37:37 DEBUG : &{test/test.txt (rw)}: Flush:
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): RWFileHandle.Flush
2023/03/01 11:37:37 DEBUG : &{test/test.txt (rw)}: >Flush: err=<nil>
2023/03/01 11:37:37 DEBUG : &{test/test.txt (rw)}: Write: len=9, offset=0
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): _writeAt: size=9, off=0
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): >_writeAt: n=9, err=<nil>
2023/03/01 11:37:37 DEBUG : &{test/test.txt (rw)}: >Write: written=9, err=<nil>
2023/03/01 11:37:37 DEBUG : &{test/test.txt (rw)}: Flush:
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): RWFileHandle.Flush
2023/03/01 11:37:37 DEBUG : &{test/test.txt (rw)}: >Flush: err=<nil>
2023/03/01 11:37:37 DEBUG : &{test/test.txt (rw)}: Release:
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): RWFileHandle.Release
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): close:
2023/03/01 11:37:37 DEBUG : vfs cache: looking for range={Pos:0 Size:9} in [{Pos:0 Size:9}] - present true
2023/03/01 11:37:37 DEBUG : test/test.txt: vfs cache: setting modification time to 2023-03-01 11:37:37.029817898 +0000 UTC m=+8.289212836
2023/03/01 11:37:37 INFO : test/test.txt: vfs cache: queuing for upload in 5s
2023/03/01 11:37:37 DEBUG : test/test.txt(0xc000b02040): >close: err=<nil>
2023/03/01 11:37:37 DEBUG : &{test/test.txt (rw)}: >Release: err=<nil>
2023/03/01 11:37:38 DEBUG : /: Lookup: name="test"
2023/03/01 11:37:38 DEBUG : /: >Lookup: node=test/, err=<nil>
2023/03/01 11:37:38 DEBUG : test/: Attr:
2023/03/01 11:37:38 DEBUG : test/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2023/03/01 11:37:38 DEBUG : test/: Lookup: name="test.txt"
2023/03/01 11:37:38 DEBUG : test/: >Lookup: node=test/test.txt, err=<nil>
2023/03/01 11:37:38 DEBUG : test/test.txt: Attr:
2023/03/01 11:37:38 DEBUG : test/test.txt: >Attr: a=valid=1s ino=0 size=9 mode=-rw-r--r--, err=<nil>
2023/03/01 11:37:39 DEBUG : /: Lookup: name="test"
2023/03/01 11:37:39 DEBUG : /: >Lookup: node=test/, err=<nil>
2023/03/01 11:37:39 DEBUG : test/: Attr:
2023/03/01 11:37:39 DEBUG : test/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2023/03/01 11:37:39 DEBUG : test/: Lookup: name="test.txt"
2023/03/01 11:37:39 DEBUG : test/: >Lookup: node=test/test.txt, err=<nil>
2023/03/01 11:37:39 DEBUG : test/test.txt: Attr:
2023/03/01 11:37:39 DEBUG : test/test.txt: >Attr: a=valid=1s ino=0 size=9 mode=-rw-r--r--, err=<nil>
2023/03/01 11:37:40 DEBUG : : Statfs:
2023/03/01 11:37:40 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2023/03/01 11:37:41 DEBUG : /: Lookup: name="test"
2023/03/01 11:37:41 DEBUG : /: >Lookup: node=test/, err=<nil>
2023/03/01 11:37:41 DEBUG : test/: Attr:
2023/03/01 11:37:41 DEBUG : test/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2023/03/01 11:37:41 DEBUG : test/: Lookup: name="test.txt"
2023/03/01 11:37:41 DEBUG : test/: >Lookup: node=test/test.txt, err=<nil>
2023/03/01 11:37:41 DEBUG : test/test.txt: Attr:
2023/03/01 11:37:41 DEBUG : test/test.txt: >Attr: a=valid=1s ino=0 size=9 mode=-rw-r--r--, err=<nil>
2023/03/01 11:37:42 DEBUG : test/test.txt: vfs cache: starting upload
2023/03/01 11:37:42 DEBUG : /: Lookup: name="test"
2023/03/01 11:37:42 DEBUG : /: >Lookup: node=test/, err=<nil>
2023/03/01 11:37:42 DEBUG : test/: Attr:
2023/03/01 11:37:42 DEBUG : test/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2023/03/01 11:37:42 DEBUG : test/: Lookup: name="test.txt"
2023/03/01 11:37:42 DEBUG : test/: >Lookup: node=test/test.txt, err=<nil>
2023/03/01 11:37:42 DEBUG : test/test.txt: Attr:
2023/03/01 11:37:42 DEBUG : test/test.txt: >Attr: a=valid=1s ino=0 size=9 mode=-rw-r--r--, err=<nil>
2023/03/01 11:37:42 INFO : test/test.txt: Copied (replaced existing)
2023/03/01 11:37:42 DEBUG : test/test.txt: vfs cache: writeback object to VFS layer
2023/03/01 11:37:42 DEBUG : test: Added virtual directory entry vAddFile: "test.txt"
2023/03/01 11:37:42 INFO : test/test.txt: vfs cache: upload succeeded try #1
2023/03/01 11:37:43 DEBUG : /: Lookup: name="test"
2023/03/01 11:37:43 DEBUG : /: >Lookup: node=test/, err=<nil>
2023/03/01 11:37:43 DEBUG : test/: Attr:
2023/03/01 11:37:43 DEBUG : test/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2023/03/01 11:37:43 DEBUG : test/: Lookup: name="test.txt"
2023/03/01 11:37:43 DEBUG : test/: >Lookup: node=test/test.txt, err=<nil>
2023/03/01 11:37:43 DEBUG : test/test.txt: Attr:
2023/03/01 11:37:43 DEBUG : test/test.txt: >Attr: a=valid=1s ino=0 size=9 mode=-rw-r--r--, err=<nil>
2023/03/01 11:37:45 DEBUG : : Statfs:
2023/03/01 11:37:45 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
^C2023/03/01 11:37:49 INFO : Signal received: interrupt
2023/03/01 11:37:49 DEBUG : vfs cache: cleaner exiting
2023/03/01 11:37:49 ERROR : /bitrixmount/user: Unmounted rclone mount
2023/03/01 11:37:49 DEBUG : rclone: Version "v1.61.1-DEV" finishing with parameters ["rclone" "-vv" "mount" "user:" "/bitrixmount/user" "--allow-other" "--uid" "1001" "--vfs-cache-mode" "full"]
2023/03/01 11:37:49 INFO : Exiting...