Page 1 of 1

unexpected change of versions and owner using WebDAV

PostPosted:Sun Apr 21, 2013 11:08 am
by Discta
I have installed OpenKM 6.2.3 (Community Edition) on my local Linux server.

I have set up user "discta" (role CEO) to perform document management using LibreOffice on a Ubuntu client.

I have mounted the WebDAV drive localy:
Code: Select all
sudo mount.davfs "http://192.168.1.25:8080/OpenKM/webdav" ~/okmdav
On my local client, I use the same user as I have set up on the server.

When I view the files and folders in ~/okmdav, they are all user root:root with only read access to others

I can view the files and folders using Nautilus and bash

To get write access to the folders and files I change owner from root to user:
Code: Select all
sudo chown -R discta:discta okmdav/
When I work on files with LibreOffice I experience some unclear behaviour with the versioning and file ownership

0. I can set up new documents in ~/okmdav and edit them as usual in LibreOffice. The file names all show up in OpenKM web client (Firefox 20.0)
1. I can generate different versions of a document, using the "version function" of LibreOffice and I can work with LibreOffice versions as usual: I can select the version (1, 2, 3,... , current) which I want to open. But in OpenKM web client, there is not history mentioned.
2a. After I have viewed a file using the webclient of OpenKM I only see the initial version, but not the current version or any other versions.
2b. After I have viewed a file using the webclient of OpenKM, everytime the owner changes from discta:discta to root:root. This makes it impossible to continue working in the same document in LibreOffice (no write access anymore). When I change back the user to discta:discta, the modified versions are lost, only the initial version is left.

In 1. I open the files via path ~/okmdav/

3. I also can open/save a document using the path http://192.168.1.25:8080/OpenKM/webdav directly in LibreOffice. Again the file names all show up in OpenKM web client (Firefox 20.0)
But everytime I just save the document, it generates an new version in OpenKM. So 5 times saving -> version 1.0 bot 1.5 in OpenKM.
Comment in OpenKM says: "Modified from WebDAV"

When I open this document path http://192.168.1.25:8080/OpenKM/webdav directly in LibreOffice, I can not select any other version than "current". But the "current version" is the current(latest) version.

3b. When I generate a "version" in LibreOffice, it is the same like normal saving (new minor version, same comment, only "current" version available to open)

4. After I have viewed a version in OpenKM webclient the owner in bash changed back to root but editing like 3. is still possible:
Code: Select all
-rw-rw-r-- 1 discta:discta 11883 Apr 21 10:27 document_01_B.odt
-rw-r--r-- 1 discta:discta  9687 Apr 21 10:32 document_01_C.odt
-rw-r--r-- 1 root   root   15191 Apr 21 12:20 document_01_D.odt <- this one just modified
Now my questions:

- What do I have to do, to work "the right way" with documents on my local machine using LibreOffice AND webDAV of OpenKM?
- Is it possible to control the change of version (when it occurs, minor/major version, comment) when editing a document?

Thanks for your support and kind regards

Discta

Re: unexpected change of versions and owner using WebDAV

PostPosted:Mon Apr 22, 2013 11:28 am
by pavila
OpenKM will generate a new document version every time it is saved using WebDAV. In LibreOffice you can select if you want to increase the minor or major version? Please attach an screenshot of this dialog.

Re: unexpected change of versions and owner using WebDAV

PostPosted:Wed Apr 24, 2013 8:05 pm
by Discta
pavila wrote:OpenKM will generate a new document version every time it is saved using WebDAV.
Yes I can confirm. This behaviour is reproducible
In LibreOffice you can select if you want to increase the minor or major version?
No, sorry, for my bad explanation. The version function of LibreOffice seems to work only when I save it the "normal" way (e. g. on my local drive) but not with WebDAV

So I identify three different stiles to work with OpenKM:

1. Download a document via WebClient (Firefox) and save/edit it locally. When editing is finished, I check it in again. Finally I have to delete the local copy to avoid duplicates

2. Open a document via OpenOffice/LibreOffice using WebDAV function of OpenOffice/LibreOffice (http://192.168.1.25:8080/OpenKM/webdav/ ... nal/dicta/).

3. Mount the WebDAV to a local folder (sudo mount.davfs "http://localhost:8080/OpenKM/repository/default" ~/okmdav). Then I edit a document via ~/okmdav

Still I experience different behaviour:

1. Check out and Check in and locally editing always possible. Editing symbol set at document. Duplicates of local and server documents (when not deleted after check in) critical.
2. Sometimes saving fails with "internal server error" and Openoffice crashes.
3. Change of owner to root during working brakes write access.

Is there something wrong with my server configuration? I receive tons of messages from server.
What should I do to achieve a stable working environment?

Thanks for some more hints

Discta

Re: unexpected change of versions and owner using WebDAV

PostPosted:Thu Apr 25, 2013 6:46 am
by dejanfc
You should first make sure that davfs can mount the webdav share as user by default, without doing chown on folders. Add the entry to /etc/fstab

http://dms:8080/OpenKM/webdav /home/username/webdav davfs noauto,user,rw 0 0

And then in user's home dir, look for ./davfs2/davfs2.conf

There you'll find a if_match_bug 1 line, uncomment it. Do umount/mount. After that, try to reproduce the behavior you're experiencing.

solved Re: unexpected change of versions and owner using Web

PostPosted:Thu Apr 25, 2013 8:12 pm
by Discta
Thanks, that helped.

I modified /etc/fstab as indicated.
Code: Select all
http://192.168.1.25:8080/OpenKM/webdav /home/discta/webdav davfs noauto,user,rw 0 0
I also modified /davfs2/davfs2.conf
I uncommented if_match_bug and changed value 0 to 1.

I also had to add the user to davfs2 group
Code: Select all
sudo usermod -aG davfs2 discta
I also found some information to set the SUID-Bit for mount.davfs (I do not know if this is really necessary).
Code: Select all
sudo dpkg-reconfigure davfs2 
I created a mounting point
Code: Select all
mkdir ~/webdav
Then I mounted the WebDAV folder using
Code: Select all
mount ~/webdav
Now I have access to all documents as expected. They are all owned by user discta and I can open them with write access.
Editing and saving works, OpenKM generates a new version only when I close the document.
I can view the history in webclient and it all makes sense.

Thanks for solving my issue this helped a lot :D
Kind regards

Discta

Re: unexpected change of versions and owner using WebDAV

PostPosted:Fri Apr 26, 2013 1:57 pm
by dejanfc
Glad you got it working :). Could you not mount the share as user without first adding the user to davfs2 group? It's been a while since I've done this procedure, hence why I didn't mention it in my previous post - I forgot about it :(.