Problem to open LibreOffice files from a mounted remote

I face an issue when opening files with LibreOffice from a mounted remote: When opening a file for the first time, the file is not opened properly. But second time it works fine. (So the workaround is simple, just open the file again.)

This happens in my graphical desktop environment:

  1. From my file manager: Double click on the "office file" in the mounted remote. For example an .docx, .xlsx or .odt file.
  2. LibreOffice application starts and fails to open the file properly. What happens in LibreOffice can differ;
  • The file opens without any message but appears to be empty (no text in a word document), or
  • some information- or error-message(s) which I can pass (like press OK), and then file opens but seems to be empty, or
  • some information- or error-message(s) and when try to pass (like press OK), LibreOffice crashes
  1. I close the file / LibreOffice window
  2. Double click on the file again, and it opens without any problem

The problem seems to be the same or similar for multiple services; at least Dropbox and Onedrive. I have don't have any problem to open local files with LibreOffice.

The information- or error-message i get from LibreOffice depends on type of file, and can differ between different services and also between different machines/desktop environments:

When opening an .xlxs file from a mounted Onedrive I get a dialogue box "Text import", and after "OK", the file opens but seems to be empty. Then it works fine to open the file the second time.

When opening an .xlxs from a mounted Dropbox (on one of my machines) I get interesting messages from LibreOffice:
”The lock file could not be created for exclusive access by LibreOffice, due to missing permission to create a lock file on that file location or lack of free disk space”
Then I click on "Open as Read only" results in error "General input/output error", and LibreOffice sometimes crashes.
Then, when opening the second time I get the same option to open as read only. And now it works to open it as read only, and then I can change to write mode within LibreOffice.

I run Linux Mint 18.3 Cinnamon with LibreOffice 5.1.6.2 on one machine, and Linux Mint 19.3 XFCE with LibreOffice 6.0.7.3 on the other.

I mount like this
$ rclone mount MyRemote: /path/to/MyRemoteDirectory --vfs-cache-mode writes -v
I have also tried vfs-cache-mode full, but that did not solve this problem.

Rclone version 1.50.2

So, do you have any idea what is causing this problem, and how to get around it?

Log, from the moment I open the file:
2020/01/19 19:54:08 DEBUG : /: Lookup: name="Files"
2020/01/19 19:54:08 DEBUG : /: >Lookup: node=Files/, err=
2020/01/19 19:54:08 DEBUG : Files/: Attr:
2020/01/19 19:54:08 DEBUG : Files/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2020/01/19 19:54:08 DEBUG : /: Lookup: name="Files"
2020/01/19 19:54:08 DEBUG : /: >Lookup: node=Files/, err=
2020/01/19 19:54:08 DEBUG : Files/: Attr:
2020/01/19 19:54:08 DEBUG : Files/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2020/01/19 19:54:08 DEBUG : Files/: Lookup: name="TestfileToOpen.xlsx"
2020/01/19 19:54:08 DEBUG : Files/: >Lookup: node=Files/TestfileToOpen.xlsx, err=
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: Attr:
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: >Attr: a=valid=1s ino=0 size=4697 mode=-rw-rw-r--, err=
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: Open: flags=OpenReadWrite
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: Open: flags=O_RDWR
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: >Open: fd=Files/TestfileToOpen.xlsx (rw), err=
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: >Open: fh=&{Files/TestfileToOpen.xlsx (rw)}, err=
2020/01/19 19:54:08 DEBUG : &{Files/TestfileToOpen.xlsx (rw)}: Read: len=8192, offset=0
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: Need to transfer - File not found at Destination
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: DropboxHash = 4e6432d4f2bd5fcf6eef0282c97c603195436f66ce5656e091efb225854c05d2 OK
2020/01/19 19:54:08 INFO : Files/TestfileToOpen.xlsx: Copied (new)
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx(0xc000a1cae0): Opening cached copy with flags=O_RDWR
2020/01/19 19:54:08 DEBUG : &{Files/TestfileToOpen.xlsx (rw)}: >Read: read=4697, err=
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: Attr:
2020/01/19 19:54:08 DEBUG : Files/TestfileToOpen.xlsx: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-r--, err=
2020/01/19 19:54:08 DEBUG : Files/: Lookup: name=".~lock.TestfileToOpen.xlsx#"
2020/01/19 19:54:08 DEBUG : Files/: >Lookup: node=, err=no such file or directory
2020/01/19 19:54:08 DEBUG : Files/: Lookup: name=".~lock.TestfileToOpen.xlsx#"
2020/01/19 19:54:08 DEBUG : Files/: >Lookup: node=, err=no such file or directory
2020/01/19 19:54:08 DEBUG : Files/: Create: name=".~lock.TestfileToOpen.xlsx#"
2020/01/19 19:54:08 DEBUG : Files/.~lock.TestfileToOpen.xlsx#: Open: flags=O_RDWR|O_CREATE|O_EXCL
2020/01/19 19:54:08 DEBUG : Files/.~lock.TestfileToOpen.xlsx#(0xc000a41680): Opening cached copy with flags=O_RDWR|O_CREATE|O_EXCL
2020/01/19 19:54:08 DEBUG : Files/.~lock.TestfileToOpen.xlsx#: >Open: fd=Files/.~lock.TestfileToOpen.xlsx# (rw), err=
2020/01/19 19:54:08 DEBUG : Files/: >Create: node=Files/.~lock.TestfileToOpen.xlsx#, handle=&{Files/.~lock.TestfileToOpen.xlsx# (rw)}, err=
2020/01/19 19:54:08 DEBUG : Files/.~lock.TestfileToOpen.xlsx#: Attr:
2020/01/19 19:54:08 DEBUG : Files/.~lock.TestfileToOpen.xlsx#: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-r--, err=
2020/01/19 19:54:08 DEBUG : &{Files/.~lock.TestfileToOpen.xlsx# (rw)}: Read: len=4096, offset=0
2020/01/19 19:54:08 DEBUG : &{Files/.~lock.TestfileToOpen.xlsx# (rw)}: >Read: read=0, err=
2020/01/19 19:54:08 DEBUG : &{Files/.~lock.TestfileToOpen.xlsx# (rw)}: Write: len=87, offset=0
2020/01/19 19:54:08 DEBUG : &{Files/.~lock.TestfileToOpen.xlsx# (rw)}: >Write: written=87, err=
2020/01/19 19:54:08 DEBUG : &{Files/.~lock.TestfileToOpen.xlsx# (rw)}: Flush:
2020/01/19 19:54:08 DEBUG : Files/.~lock.TestfileToOpen.xlsx#: Need to transfer - File not found at Destination
2020/01/19 19:54:09 ERROR : Files/.~lock.TestfileToOpen.xlsx#: Failed to copy: upload failed: path/disallowed_name/..
2020/01/19 19:54:09 ERROR : Files/.~lock.TestfileToOpen.xlsx#(0xc000a41680): failed to transfer file from cache to remote: upload failed: path/disallowed_name/..
2020/01/19 19:54:09 ERROR : Files/.~lock.TestfileToOpen.xlsx#(0xc000a41680): RWFileHandle.Flush error: failed to transfer file from cache to remote: upload failed: path/disallowed_name/..
2020/01/19 19:54:09 DEBUG : &{Files/.~lock.TestfileToOpen.xlsx# (rw)}: >Flush: err=failed to transfer file from cache to remote: upload failed: path/disallowed_name/..
2020/01/19 19:54:09 DEBUG : &{Files/.~lock.TestfileToOpen.xlsx# (rw)}: Release:
2020/01/19 19:54:09 DEBUG : /: Lookup: name="Files"
2020/01/19 19:54:09 DEBUG : /: >Lookup: node=Files/, err=
2020/01/19 19:54:09 DEBUG : Files/: Attr:
2020/01/19 19:54:09 DEBUG : Files/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2020/01/19 19:54:09 DEBUG : Files/.~lock.TestfileToOpen.xlsx#(0xc000a41680): RWFileHandle.Release closing
2020/01/19 19:54:09 DEBUG : Files/.~lock.TestfileToOpen.xlsx#(0xc000a41680): close:
2020/01/19 19:54:09 DEBUG : File.delWriter couldn't find handle
2020/01/19 19:54:09 DEBUG : Files/.~lock.TestfileToOpen.xlsx#: Need to transfer - File not found at Destination
2020/01/19 19:54:09 DEBUG : /: Lookup: name="Files"
2020/01/19 19:54:09 DEBUG : /: >Lookup: node=Files/, err=
2020/01/19 19:54:09 DEBUG : Files/: Attr:
2020/01/19 19:54:09 DEBUG : Files/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2020/01/19 19:54:09 DEBUG : Files/: Lookup: name=".~lock.TestfileToOpen.xlsx#"
2020/01/19 19:54:09 DEBUG : Files/: >Lookup: node=Files/.~lock.TestfileToOpen.xlsx#, err=
2020/01/19 19:54:09 DEBUG : Files/.~lock.TestfileToOpen.xlsx#: Attr:
2020/01/19 19:54:09 DEBUG : Files/.~lock.TestfileToOpen.xlsx#: >Attr: a=valid=1s ino=0 size=87 mode=-rw-rw-r--, err=
2020/01/19 19:54:09 ERROR : Files/.~lock.TestfileToOpen.xlsx#: Failed to copy: upload failed: path/disallowed_name/.
2020/01/19 19:54:09 ERROR : Files/.~lock.TestfileToOpen.xlsx#(0xc000a41680): failed to transfer file from cache to remote: upload failed: path/disallowed_name/.
2020/01/19 19:54:09 DEBUG : Files/.~lock.TestfileToOpen.xlsx#(0xc000a41680): >close: err=failed to transfer file from cache to remote: upload failed: path/disallowed_name/.
2020/01/19 19:54:09 ERROR : Files/.~lock.TestfileToOpen.xlsx#(0xc000a41680): RWFileHandle.Release error: failed to transfer file from cache to remote: upload failed: path/disallowed_name/.
2020/01/19 19:54:09 DEBUG : &{Files/.~lock.TestfileToOpen.xlsx# (rw)}: >Release: err=failed to transfer file from cache to remote: upload failed: path/disallowed_name/.

1 Like

Could you run your tests again with the latest beta? There have been lots of changes to the mount code since 1.50 and I think some of these issues may be fixed - thanks.

I tested with rclone v1.50.2-178-g7125cb10-beta
Now files don't seem empty when opened, but I see other issues:
Onedrive:
The file opens okay. But when save changes i get a message that the file has been changed on disk.
Dropbox:
I get the same message "”The lock file could not be created.." every time opening a file. I can open as read-only and switch to edit mode, and it works to save changes.

Are there work in progress in this area? Should I wait for next beta/release before I test?
I can provide detailed error descriptions and logs from v1.50.2-178-g7125cb10-beta there is a need for it.
Thanks

I tried to replicate this myself with Ubuntu 19.10.

I found onedrive + libreoffice calc worked perfectly loading and saving xlsx files.

I see the same problem as you with dropbox. The problem is here

2020/01/22 13:38:45 DEBUG : .~lock.test.xlsx#: Need to transfer - File not found at Destination
2020/01/22 13:38:46 ERROR : .~lock.test.xlsx#: Failed to copy: upload failed: path/disallowed_name/..

Reading the docs it looks like this name should be allowed

A bit of experimentation reveals it is the combination of .~ at the start of the name dropbox doesn't like.

Much further down that doc I see

When some applications (such as Microsoft Word, Excel, or PowerPoint) open a file, they will often save a temporary file in the same directory and name it in one of the following ways:

  • Name begins with ~$ (a tilde and dollar sign) or .~ (a period and tilde)
  • Name begins with a tilde and ends in .tmp, such as ~myfile.tmp

Dropbox doesn’t sync these temporary files on any operating system.

So dropbox is delibarately blocking those temporary file names.

This could be worked around with the encoding framework, though currently it isn't clever enough to detect pairs of characters which need encoding.

There is an encoding rule to encode leading periods which would fix the problem - you could try that.

You'd do this with

  --dropbox-encoding "Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot,LeftPeriod"

That can also go in the config as

encoding = Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot,LeftPeriod

You'll need the beta to use the flag or config rule.

I tested again with rclone v1.50.2-178-g7125cb10-beta:

DROPBOX
Mounted like this: rclone mount DropboxHOME: /home/lennart/DropboxHOME --vfs-cache-mode writes --dropbox-encoding "Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot,LeftPeriod" -vv

Test result: Now LibreOffice Calc freezes and crashes when I open an .ods or.xlsx file. It does not happen every time I open such file but it is unstable. I don't have any problem with LibreOffice for local files.

ONEDRIVE
I did the following observation for a plain text file:

  1. Open file: OK
  2. Make a change and Save: Time Modified displayed in my File manager is set to the time when the remote was mounted with Rclone(!)
  3. Continue to edit the file and Save: I get warning message "The file /path/to/file.txt changed on disk. Do you want to reload the file?"
  4. Reload: Same content of the file is displayed
    Then when I refresh the directory in file manager, the displayed Time Modified is changed to the time I actually changed the file.

This was tested on:
Distro: Linux Mint 19.3 Tricia base: Ubuntu 18.04 bionic
Desktop: Xfce 4.14.1 tk: Gtk 3.22.30 wm: xfwm4 dm: LightDM
LibreOffice Version: 6.0.7.3
Text editor: Xed 2.4.2
File manager: Thunar 1.8.9

I've tested both the dropbox and the onedrive and they are working fine for me now on

Ubuntu 19.10
Desktop: XFCE 4.14
Libre Office: 6.3.4

I think the major difference there is Libre Office. Libreoffice shouldn't crash - that is a bug in libreoffice... Can you try a newer version?

I've the LibreOffice 6.3.4.2.0+ on fc31 xfce, having same problem with the TS. If I copy the file out of the folder and directly edit it, the libre won't crash. This seems only happen for both powerpoint/impress and calc, although not often on impress, but sometimes happen.

I'm using onedrive for testing this.

EDIT :
Anyway something strange happen, if I already have opened libreOffice calc and open the ods/xls file, the libreoffice won't crash, it will still be open and running. Hmm..

Confirmed with rclone-1.51.0.008.gfe6f4135.beta-1.x86_64

If libreoffice crashes then you should probably report a bug with them. Rclone shouldn't be able to make libreoffice crash!

It try to write file like you specify before. I guess, like temp docx or such.

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