Vim freezes when editing files in a rclone mounted directory

What is the problem you are having with rclone?

Trying to use vim to edit files that have been mounted with rclone using the command rclone --vfs-cache-mode full mount onedrive: ~/OneDrive &. If I use vim's "view" command, which implies read-only, there is no problem. But editing a file normally with vim usually causes vim to open but hang before any part of the file is even displayed. Sometimes it does load, however, but upon writing with :w, then it hangs and doesn't ever complete the save.

I've suspected that swap files (vim's *.swp files) might be part of the issue, as these files are created when you open a file. Using the command vim -n disables the creation of swap files, and sure enough, this guarantees that opening the file is always successful, but then when I attempt to save I hit the same issue, and vim freezes. My ideal solution to the problem would involve keeping the use of swap files, as these can be helpful in case of the application hanging, but I believe there are options in vim to create them in alternative directories if need be.

I'll also say that, although rare, I have had things work just fine, if only for one or two saves, even with swap file creation enabled. Then everything froze soon after... At a lose, and hoping there is just a setting in rclone I could alter.

What is your rclone version (output from rclone version)

rclone v1.45

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

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

Linux 5.0.0-21-generic Ubuntu x86_64

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

OneDrive

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

rclone --vfs-cache-mode full mount onedrive: ~/OneDrive &
vim file.txt

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

This seems to be the relevant bit, but I can include more if need be.

2019/07/29 23:16:57 DEBUG : /: Lookup: name="Notes"
2019/07/29 23:16:57 DEBUG : /: >Lookup: node=Notes/, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/: Attr: 
2019/07/29 23:16:57 DEBUG : Notes/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2019/07/29 23:16:57 DEBUG : /: Lookup: name="Notes"
2019/07/29 23:16:57 DEBUG : /: >Lookup: node=Notes/, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/: Attr: 
2019/07/29 23:16:57 DEBUG : Notes/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/: Lookup: name="todo.txt"
2019/07/29 23:16:57 DEBUG : Notes/: >Lookup: node=Notes/todo.txt, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/todo.txt: Attr: 
2019/07/29 23:16:57 DEBUG : Notes/todo.txt: >Attr: a=valid=1s ino=0 size=12990 mode=-rw-r--r--, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/todo.txt: Open: flags=OpenReadOnly
2019/07/29 23:16:57 DEBUG : Notes/todo.txt: Open: flags=O_RDONLY
2019/07/29 23:16:57 DEBUG : Notes/todo.txt: >Open: fd=Notes/todo.txt (rw), err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/todo.txt: >Open: fh=&{Notes/todo.txt (rw)}, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/: Lookup: name=".todo.txt.swp"
2019/07/29 23:16:57 DEBUG : Notes/: >Lookup: node=<nil>, err=no such file or directory
2019/07/29 23:16:57 DEBUG : Notes/: Lookup: name=".todo.txt.swp"
2019/07/29 23:16:57 DEBUG : Notes/: >Lookup: node=<nil>, err=no such file or directory
2019/07/29 23:16:57 DEBUG : Notes/: Create: name=".todo.txt.swp"
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp: Open: flags=O_RDWR|O_CREATE|O_EXCL
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp(0xc4203205a0): Opened existing cached copy with flags=O_RDWR|O_CREATE|O_EXCL
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp: >Open: fd=Notes/.todo.txt.swp (rw), err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/: >Create: node=Notes/.todo.txt.swp, handle=&{Notes/.todo.txt.swp (rw)}, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp: Attr: 
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp: >Attr: a=valid=1s ino=0 size=0 mode=-rw-r--r--, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/: Lookup: name=".todo.txt.swx"
2019/07/29 23:16:57 DEBUG : Notes/: >Lookup: node=Notes/.todo.txt.swx, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx: Attr: 
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx: >Attr: a=valid=1s ino=0 size=0 mode=-rw-r--r--, err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx: Open: flags=OpenReadOnly
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx: Open: flags=O_RDONLY
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx: >Open: fd=Notes/.todo.txt.swx (rw), err=<nil>
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx: >Open: fh=&{Notes/.todo.txt.swx (rw)}, err=<nil>
2019/07/29 23:16:57 DEBUG : &{Notes/.todo.txt.swx (rw)}: Flush: 
2019/07/29 23:16:57 DEBUG : &{Notes/.todo.txt.swx (rw)}: >Flush: err=<nil>
2019/07/29 23:16:57 DEBUG : &{Notes/.todo.txt.swx (rw)}: Release: 
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx(0xc420320660): RWFileHandle.Release closing
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx(0xc420320660): close: 
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swx(0xc420320660): >close: err=<nil>
2019/07/29 23:16:57 DEBUG : &{Notes/.todo.txt.swp (rw)}: Flush: 
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp(0xc4203205a0): RWFileHandle.Flush ignoring flush on unwritten handle
2019/07/29 23:16:57 DEBUG : &{Notes/.todo.txt.swp (rw)}: >Flush: err=<nil>
2019/07/29 23:16:57 DEBUG : &{Notes/.todo.txt.swx (rw)}: >Release: err=<nil>
2019/07/29 23:16:57 DEBUG : &{Notes/.todo.txt.swp (rw)}: Release: 
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp(0xc4203205a0): RWFileHandle.Release closing
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp(0xc4203205a0): close: 
2019/07/29 23:16:57 DEBUG : Notes/.todo.txt.swp(0xc4203205a0): not modified so not transferring
2019/07/29 23:16:57 DEBUG : Notes/: Remove: name=".todo.txt.swp"

1.45 is fairly old... Can you try the latest release?

Ah yes, well that fixes it! Should have checked that... Classic out-of-date Ubuntu repos.

Thanks for the quick reply. Cheers!

1 Like

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