Opening file from Samba share results in Document in Use

Bug #1875717 reported by Leó Kolbeinsson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libreoffice (Ubuntu)
New
Low
Unassigned

Bug Description

This bug is related to bug # 1430531.

I am running Lubuntu version 20.04 with all updates installed
The Libre Office version :
Version: 6.4.2.2
Build ID: 1:6.4.2-0ubuntu3
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: qt5;
Locale: en-GB (en_GB.UTF-8); UI-Language: en-US
Calc: threaded

1. connect to share on local network with PCManFM-Qt File Manager
2. click on file TEST_Samba.odt
3. The Libre Office splash/Logo screen appears for a split second and the nothing happens and the file is not opened.
4. I then right-click on file and select "open with Libre Office Writer
5. Document in Use" window appears with text:

   Document file 'TEST_Samba.odt' is locked for editing by:

   Unknown User

   Open document read-only or open a copy of the document for editing.

   Open Read-Only Open Copy Cancel

Screen shot attached..

Expected results:
   The "TEST_Samba.odt" files is opened in read-write mode, user can edit it.

Actual results:
   User can't edit original document (see 3-5 above)

I have tested this on several boxes running Lubuntu 20.04 with the exact same results.
I have also tested this on SparkyLinux LxQT version 5.11 with the same results.
Ubuntu Gnome as well as MS Windows/Office have no problems opening/editing and/or saving this file back to the Samba share.

Global Samba config is "default"
 Usershare config is:

$ cat /var/lib/samba/usershares/sameign2
#VERSION 2
path=/home/kbeins/Sameign2
comment=
usershare_acl=S-1-1-0:F
guest_ok=n
sharename=Sameign2

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: libreoffice (not installed)
ProcVersionSignature: Ubuntu 5.4.0-26.30-generic 5.4.30
Uname: Linux 5.4.0-26-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: LXQt
Date: Tue Apr 28 17:51:14 2020
InstallationDate: Installed on 2020-04-28 (0 days ago)
InstallationMedia: Lubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
SourcePackage: libreoffice
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Leó Kolbeinsson (leok) wrote :
Revision history for this message
Leó Kolbeinsson (leok) wrote :

Following up on my original report here are the entries from my syslog on the client requesting to open the file and when that fails requesting to open a copy which succeeds -- again this only happens in Libre Office and all other apps open/edit/save as normal.

See attached file syslog_OL.txt

Changed in libreoffice (Ubuntu):
importance: Undecided → Critical
importance: Critical → Low
Revision history for this message
Leó Kolbeinsson (leok) wrote :

This is unchanged in LibreOffice version 6.4.3.2 Build ID 1:6.4.3-0ubuntu0.20.04.1
on Lubuntu 20.04. - again this only happens in Libre Office and all other apps open/edit/save as normal.

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1875717

tags: added: iso-testing
Revision history for this message
Leó Kolbeinsson (leok) wrote :

This is unchanged in LibreOffice version 7.0.3.1 tested in dailys 12.12.2020 for Lubuntu and Xubuntu Hirsute

http://cdimage.ubuntu.com/lubuntu/daily-live/20201212/hirsute-desktop-amd64.iso

http://cdimage.ubuntu.com/xubuntu/daily-live/20201212/hirsute-desktop-amd64.iso

Tested on 2 machines : Acer [Aspire] E3-111-P60S and Lenovo M72e i3-2120T with exactly the same results.

As noted in my earlier comment # 2 this only happens in Libre Office and all other apps open/edit/save as normal.

Revision history for this message
Leó Kolbeinsson (leok) wrote :

I made a change to the original description as at the time I only saw this on the QT desktops. After running tests on other flavors I see that this is not the case. see comment # 5

description: updated
Leó Kolbeinsson (leok)
description: updated
Revision history for this message
Leó Kolbeinsson (leok) wrote :

Tested on Ubuntu and Ubuntu Mate Hirsute daily builds 13.12.2020 and could not reproduce the issue.

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

@Leó your steps to reproduce require using pcmanfm-qt, the default file manager for Lubuntu. In testing on other desktop environments (including Qt-based ones like KDE which uses Dolphin for the default file manager), did you indeed use pcmanfm-qt or did you use the default file manager?

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

Also, have you checked other flavors besides Lubuntu, Xubuntu, Ubuntu and Ubuntu Mate?

Revision history for this message
Leó Kolbeinsson (leok) wrote :

@Walter (wxl)

Sorry for the confusion - yes originally I used pcmanfm-qt as at that time the bug occurred only in Lubuntu - in all other flavors I have used their default file managers.

The bug was also present in Xubuntu Hirsute daily build 20201212.

I was unable to reproduce the bug in Ubuntu Hirsute and Ubuntu Mate Hirsute.
I intend to test Kubuntu and Ubuntu Budgie today.

Revision history for this message
Leó Kolbeinsson (leok) wrote :

This occurred while testing Xubuntu Hirsute daily http://cdimage.ubuntu.com/xubuntu/daily-live/20201214/hirsute-desktop-amd64.iso

I used thunar the default file manager to open a file on a Samba share in Libre Office writer.

 Document in Use" window appears with text:

   Document file 'xxx.odt' is locked for editing by:

   Unknown User

   Open document read-only or open a copy of the document for editing.

   Open Read-Only Open Copy Cancel

Attached is the syslog file - see entries for 7:09 and 7:20

Revision history for this message
Leó Kolbeinsson (leok) wrote :

As a follow up I tested another machine running Xubuntu Hirsute and again received the "Document in use" error .
My test results are here:

http://iso.qa.ubuntu.com/qatracker/milestones/419/builds/224141/testcases/1300/results/

I then tested Ubuntu Budgie and was unable to reproduce the error.
Also tested Kubuntu Groovy 20.10 and no error opening Samba files.

So far this has then only occurred on Lubuntu and Xubuntu.

Again I will reiterate that this only occurs with LibreOffice documents on the Samba share - all other applications used to open file i,e featherpad,mousepad open as normal and use the same password to access the share.

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

I wonder…

 1. if you use pcmanfm-qt or thunar in any of the flavors, does it fail?
 2. if you use one of the other file managers (say, nautilus or caja) in Lubuntu or Xubuntu, does it succeed?

Revision history for this message
Leó Kolbeinsson (leok) wrote :

@Walter (wxl)

Good questions ...
I have been running tests with other file managers in Lubuntu with no success ..will also test pcmanfm-qt and thunar in one or two oth the other flavors. Will report back with more details when I finish.

Revision history for this message
Leó Kolbeinsson (leok) wrote :

Further testing results:

1. Ubuntu Mate Hirsute daily build 20201215 test machine Dell Inspiron 3521
   a. Caja default file manager - opens files with no errors
   b. thunar and PCManFM-QT open files as "locked for editing..”

2. Lubuntu Hirsute daily build 20201214 test machine Lenovo x230I
    a. thunar and PCManFM-QT open files as "locked for editing..”
    b. Dolphin – opens files with no errors
c. Caja and Nautilus fail to open files at all with no error messages but an unreadable flash on screen

 3. Xubuntu Hirsute daily build 20201214 test machine Acer Aspire E3-111
     a. thunar and PCManFM-QT open files as "locked for editing..”
     b. Caja and Nautilus - open files with no errors

  4. Ubuntu Hirsute daily build 20201215 test machine Dell Inspiron 3521
      a. Only tested the default file manager (Files) – opens files with no errors

  5. Kubuntu Groovy release 20.10 test machine Acer Aspire E3-111 *
       a. Dolphin - opens files with no errors
       b. thunar and PCManFM-QT open files as "locked for editing..”

* Kubuntu was tested with the Groovy release 20.10 as there are problems installing 21.04 Hirsute which is another matter altogether

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

So clearly the problem here is with Thunar and PCManFM-Qt, at least something about how they handle the Samba connection that makes LibreOffice (and only LibreOffice, apparently) unhappy.

So I have three thoughts:

 1. Connect to the Samba share manually. This way we're not relying on the logic in the file manager to do the mounting. Assuming this works correctly for all file managers, then we can safely put the blame on the file managers themselves even though there must be something about LibreOffice that makes it particular. https://help.ubuntu.com/community/Samba/SambaClientGuide#Connecting_using_CIFS

 2. Run the file manager on the command line and see if it spits anything out. I know with PCManFM-Qt, it also handles desktop management, so there's a daemon running. You can find that and kill it and then run `pcmanfm-qt --profile=lxqt 2>&1`. I'm less intimately familiar with Thunar so I'll leave it as an exercise to the reader to figure that out. :)

Revision history for this message
Leó Kolbeinsson (leok) wrote :

@wxl Walter

Ran some tests again today.

1.Connected to the Samba share manually and no problem mounting etc. Opened the share directly from LibreOffice Writer and the file came up as "read only" but this time no dialog box.

2. Proceeded onto your second suggestion - and got the same result - file opened in "read only " mode and no dialog box. Of interest is that if the share is mounted by PCManFM-Qt or thunar the file opens with the dialog box as in the original report.

3. Did not test thunar. :)

Revision history for this message
Leó Kolbeinsson (leok) wrote :

@wxl Walter

Again I retested and had acloser look at your suggestion nr2 -

After input: pcmanfm-qt --profile=lxqt 2>&1

I received the following messages when connecting to the Samba share and opening a file :

isPrimaryInstance
Icon theme "elementary" not found.
shortcut is dir: smb://storhofdi.local:445/
operation finished: 0x0
delete MountOperation
file monitor cannot be created: Operation not supported
ask password
operation finished: 0x0
delete MountOperation
file monitor cannot be created: Operation not supported
file monitor cannot be created: Operation not supported
file monitor cannot be created: Operation not supported
file monitor cannot be created: Operation not supported
javaldx: Could not find a Java Runtime Environment!
Please ensure that a JVM and the package libreoffice-java-common
is installed.
If it is already installed then try removing ~/.config/libreoffice/4/user/config/javasettings_Linux_*.xml
Warning: failed to read path from javaldx
Icon theme "elementary" not found.

Any suggestions?

Revision history for this message
Leó Kolbeinsson (leok) wrote :

Digging a bit deeper - checked out the release notes and known bugs at Libre Office and found this bit of info:

Check the link below comments on Linux
https://wiki.documentfoundation.org/ReleaseNotes/7.0#Configuration_changes

And known bugs -
https://bugs.documentfoundation.org/show_bug.cgi?id=115747

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

I'm not entirely surprised at the read only thing (see https://ask.libreoffice.org/en/question/3827/doc-files-open-as-read-only/) though I'm a little surprised about the inconsistent behavior that under some file managers that happens and under others, it doesn't. That's not really relevant here, but may be worth some investigating.

My past experience tells me that the dialog about the file being locked for editing comes up when someone using the share has the file open and someone else tries to open it. Another possibility is if someone has it open and then their system/LibreOffice crashes. I haven't investigated this but I suspect a lock file is being used to indicate whether or not it's being used.

The output from PCManFM-Qt is actually quite useful. Those "file monitor cannot be created" warnings originate from some SMB-specific code. It would be interesting to compare this to what Thunar is doing, so if you could test it, that would be great.

As always, thank you, Leó!

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

I think you meant to link to the section about platform compatibility on Linux and how file:/// links are no longer silently treated as smb:/// links:
https://wiki.documentfoundation.org/ReleaseNotes/7.0#Linux

I am pretty sure that's a non-issue in PCManFM-Qt.

Revision history for this message
Leó Kolbeinsson (leok) wrote :

@wxl Walter,

While testing Ubuntu 21.04 on the RASP PI4 I decided to install the Lubuntu desktop and then tried PCManFM-QT and then the opening of the Samba share files worked fine with no error messages.
I then played around with a few PC boxes and got the same results after installing the Lubuntu desktop on the Ubuntu build.

Ref your comments in #20 re file locks I agree - but in this case I am running a private LAN with no other users so the locked file is an incorrect message i.e these files are not in use by anyone - so either LibreOffice or PCManFM-QT are sending the wrong message to each other.. will do some further testing and comparisons with other file managers -

Revision history for this message
niknah (hankin0) wrote :

When I run
libreoffice /run/user/.../gvfs/....

The file is locked.

This works...
libreoffice smb://...

In other file managers you can set the X-GIO-NoFuse=true option in the .desktop files to force the smb: url, but pcmanfm doesn't do anything with this option.

To fix for pcmanfm, use this attached opener instead, it converts normal file paths to gio (ie. smb://...). In pcmanfm, right click on the file and pick "Custom command" -> pcmanfm_open_libreoffice %u

You can change the existing opener in /usr/share/applications/libreoffice*.desktop

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.