Collabora "connecting" delay for 20 seconds

I canā€™t know why it happens, there maybe many reasons. I think this is a question to LibreOffice forum not here. I had no problem building it on debian-like systems. Maybe these links will be helpful:
https://wiki.documentfoundation.org/Development/BuildingOnLinux
https://wiki.documentfoundation.org/Development/Linux_Build_Dependencies

Hi,

Iā€™m using CODE from the docker image (5.1-1) and NEXTCLOUD (9.52) on a powerful Ubuntu 16.04 server. Everything works fine but I observe also the delay when loading documents.

Since the installation via DOCKER is very comfortable Iā€™m interested in knowing whether the DOCKER or CODE experts have ideas to improve the loading performance. If it helps I can provide more details and logs.

Thanks for the great work!

Maarten

1 Like

Perhaps the issue is solved but not with the official docker imageā€¦ Here on debian 8.5, apache.

Also have this latence to load the document.
Save and use of the document work fine.

I have a Virtual Private Server at OVH, arm 1 core 2,4Ghz 2GO RAM SSD 10Go
Ubuntu 16.04.1 with Apache2 PHP7 MariaDB10.1

Itā€™s a better idea to do this than to use Docker.

I started to compile it but, itā€™s really long.
You need to compile first loolwsd and then loleaflet;

But when i want to compule loolwsd, i have to compile libreoffice beforce (1GB just the source)

Iā€™m sure it worth it, i cross fingers.

I have also compiled everything for the last version, but now we have the next version and i am to lazy to do it again. So i copied collabora online out of the container, and it works:

Create user lool, group lool

copy with: sudo docker cp container-name:path path

collaboraoffice
/opt/collaboraoffice5.1

Libreoffice online
/usr/bin/loolforkit
/usr/bin/loolmap
/usr/bin/loolmount
/usr/bin/looltool
/usr/bin/loolwsd
/usr/bin/loolwsd-systemplate-setup
/etc/loolwsd/
/usr/share/loolwsd/
/usr/share/loolwsd/loleaflet/

poco
/usr/lib/libPocoCrypto.so.42
/usr/lib/libPocoFoundation.so.42
/usr/lib/libPocoJSON.so.42
/usr/lib/libPocoNet.so.42
/usr/lib/libPocoNetSSL.so.42
/usr/lib/libPocoUtil.so.42
/usr/lib/libPocoXML.so.42

set cap:
sudo setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit
sudo setcap cap_sys_admin=ep /usr/bin/loolmount

create new (mkdir, chown -R lool:loolā€¦)
/var/cache/loolwsd/
/opt/lool/child-roots/

create: sudo /usr/bin/loolwsd-systemplate-setup /opt/lool/systemplate /opt/lool/collaboraoffice5.1
/opt/lool/systemplate/
sudo chown -R /opt/lool/systemplate

Install your certificates to /etc/loolwsd/
adapt configuration to your certificates /etc/loolwsd/loolwsd.xml

run: sudo -u lool /usr/bin/loolwsd --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.1 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd

1 Like

hello,

Here is my log when i try this command sudo /usr/bin/loolwsd-systemplate-setup /opt/lool/systemplate /opt/lool/collaboraoffice5.1 :

find: ā€˜lib/ld-ā€™: No such file or directory
find: ā€˜lib64/libcap
ā€™: No such file or directory
find: ā€˜lib/libattr*ā€™: No such file or directory
find: ā€˜lib/libnss_ā€™: No such file or directory
find: ā€˜lib64/libnss_
ā€™: No such file or directory
find: ā€˜var/cache/fontconfigā€™: No such file or directory
find: ā€˜usr/lib/locale/en_US.utf8ā€™: No such file or directory
find: ā€˜usr/lib/locale/locale_archiveā€™: No such file or directory
find: ā€˜usr/lib/libpng*ā€™: No such file or directory
find: ā€˜usr/lib64/libpng*ā€™: No such file or directory
find: ā€˜lib/ld-ā€™: No such file or directory
find: ā€˜lib/libnss_
ā€™: No such file or directory
find: ā€˜lib64/libnss_ā€™: No such file or directory
find: ā€˜lib64/libcap
ā€™: No such file or directory
find: ā€˜lib/libattr*ā€™: No such file or directory
find: ā€˜usr/lib/libpng*ā€™: No such file or directory
find: ā€˜usr/lib64/libpng*ā€™: No such file or directory
find: ā€˜/usr/lib64ā€™: No such file or directory
cpio: /opt/lool/systemplate/lib/x86_64-linux-gnu/libc.so.6 not created: newer or same age version exists
cpio: /opt/lool/systemplate/lib/x86_64-linux-gnu/libdl.so.2 not created: newer or same age version exists
cpio: /opt/lool/systemplate/lib/x86_64-linux-gnu/libgcc_s.so.1 not created: newer or same age version exists
cpio: /opt/lool/systemplate/lib/x86_64-linux-gnu/libm.so.6 not created: newer or same age version exists
cpio: /opt/lool/systemplate/lib/x86_64-linux-gnu/libpthread.so.0 not created: newer or same age version exists
cpio: /opt/lool/systemplate/lib/x86_64-linux-gnu/librt.so.1 not created: newer or same age version exists
cpio: /opt/lool/systemplate/usr/lib/x86_64-linux-gnu/libstdc++.so.6 not created: newer or same age version exists

I got the same messages, but the systemplate folder was filled with content. So it was no problem for me.

OKay, so something is missing :
/usr/bin/lool doesnā€™t existā€¦

How this file is created ? does somethingā€™s missing in your HOW TO ?

Sorry, i have typed the wrong name in my description, you have to run /usr/bin/loolwsd

Thanks.

Now iā€™m missing Poco library for lunching Lool. Should i install it with apt-get or from source ?

Install it from source. And you do need the full Version.

http://pocoproject.org/releases/poco-1.7.4/poco-1.7.4-all.tar.gz

Most comfortable is to configure it with an install path and then do make install. Cause the library location shouldnt change.

https://raw.githubusercontent.com/pocoproject/poco/poco-1.7.4/README

These are the bulding instructions for poco.

I would also suggest to proceed the same way with loolwsd. Install path /usr. When I am back at home I will Upload the content of my loolwsd.xml file and the service file for systemd.

I have added the poco files to the copy description

poco
/usr/lib/libPocoCrypto.so.42
/usr/lib/libPocoFoundation.so.42
/usr/lib/libPocoJSON.so.42
/usr/lib/libPocoNet.so.42
/usr/lib/libPocoNetSSL.so.42
/usr/lib/libPocoUtil.so.42
/usr/lib/libPocoXML.so.42

Alright some news :

I ve got made the cp for Poco Library

Now i stop the lool docker and start the lool server.

After changing the server name in the admin panel, and putting the good cert from letsencrypt here is the error when i try to open a file :

[ client_req_hdl ] Preprocessing file: /usr//loleaflet/dist/loleaflet.html
[client_req_hdl ] FileServerR
equestHandler: File not found: /usr//loleaflet/dist/loleafl
et.html

There is an error in the file path : /usr//loleaflet
It should be /usr/share/loolwsd/loleaflet ?

Where is the file i have to modify ?
Is it in loolwsd.xml ?

Thank you for your help

EDIT :
So just open loolwsd.xml
Search for the line about loleaflet folder and configure it at follow : /usr/share/loolwsd (do not put / after loolwsd)

And then it works !!!
No 20 seconds to wait, UTF8 working no problems with Ć© Ć  etcā€¦

Great.

Hello everyone ,
I see the solution docker like me has a slow 20s. I have a VM with the docker and therefore nextcloud. I see that you have succeeded in exiting collaborated, can t we have a summary in tutorial to like you?
How itā€™ll work after when update if we stop the docker?

thank you

This is for the initial problem with the docker image (where the 20 second Problem remains with certain setups?)

# docker logs IMAGE_NAME_OR_NUMBER output for 20 seconds as following:

kit-00066-04 00:32:30.088271 [ kit_queue_0005 ] Session 0005 is loading. 0 views loaded. kit-00066-04 00:32:30.088300 [ kit_queue_0005 ] Loading new document from URI: [file:///user/docs/66/my-doc.docx] for session [0005]. kit-00066-04 00:32:30.088314 [ kit_queue_0005 ] Calling lokit::documentLoad. wsd-00020-15 00:32:30.334252 [ wsd_queue_0005 ] ToClient-0005 Recv: status wsd-00020-15 00:32:30.334964 [ wsd_queue_0005 ] ToClient-0005: handling [status]. wsd-00020-15 00:32:30.334998 [ wsd_queue_0005 ] Could not open /var/cache/loolwsd/4/f/b/03beec80a94b068f9e6407ab0a4b802567751/status.txt wsd-00020-15 00:32:30.335015 [ wsd_queue_0005 ] ToClient-0005 -> ToPrisoner-0005: status wsd-00020-15 00:32:30.335034 [ wsd_queue_0005 ] ToPrisoner-0005 Send: 6 bytes wsd-00020-15 00:32:30.335118 [ wsd_queue_0005 ] ToClient-0005 Recv: partpagerectangles wsd-00020-15 00:32:30.335140 [ wsd_queue_0005 ] ToClient-0005: handling [partpagerectangles]. wsd-00020-15 00:32:30.335161 [ wsd_queue_0005 ] Could not open /var/cache/loolwsd/4/f/b/03beec80a94b068f9e6407ab0a4b802567751/partpagerectangles.txt wsd-00020-15 00:32:30.335175 [ wsd_queue_0005 ] ToClient-0005 -> ToPrisoner-0005: partpagerectangles wsd-00020-15 00:32:30.335191 [ wsd_queue_0005 ] ToPrisoner-0005 Send: 18 bytes wsd-00020-00 00:32:30.599320 [ loolwsd ] Nothing to autosave [my.nextcloud.net/index.php/apps/richdocuments/wopi/files/169]. wsd-00020-10 00:32:32.802173 [ loolwsd ] Total memory used: 305284 wsd-00020-10 00:32:47.822702 [ loolwsd ] Total memory used: 305356 kit-00066-04 00:32:50.157427 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_START []. kit-00066-04 00:32:50.166889 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [4]. kit-00066-04 00:32:50.169376 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [8]. kit-00066-04 00:32:50.169482 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [12]. kit-00066-04 00:32:50.172691 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [16]. kit-00066-04 00:32:50.172765 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [20]. kit-00066-04 00:32:50.172832 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [24]. kit-00066-04 00:32:50.172909 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [28]. kit-00066-04 00:32:50.172980 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [32]. kit-00066-04 00:32:50.173107 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [36]. kit-00066-04 00:32:50.176601 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [40]. kit-00066-04 00:32:50.176696 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [44]. kit-00066-04 00:32:50.179868 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [48]. kit-00066-04 00:32:50.183275 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [52]. kit-00066-04 00:32:50.183384 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [56]. kit-00066-04 00:32:50.185098 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [60]. kit-00066-04 00:32:50.185290 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [64]. kit-00066-04 00:32:50.185369 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [68]. kit-00066-04 00:32:50.185573 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [72]. kit-00066-04 00:32:50.185664 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [76]. kit-00066-04 00:32:50.185756 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [80]. kit-00066-04 00:32:50.185827 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [84]. kit-00066-04 00:32:50.185897 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [88]. kit-00066-04 00:32:50.185966 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [92]. kit-00066-04 00:32:50.186045 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [96]. kit-00066-04 00:32:50.186114 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_SET_VALUE [100]. kit-00066-04 00:32:50.186838 [ kit_queue_0005 ] Document::DocumentCallback STATUS_INDICATOR_FINISH []. kit-00066-04 00:32:50.318518 [ kit_queue_0005 ] Returned lokit::documentLoad. kit-00066-04 00:32:50.348326 [ kit_queue_0005 ] Sending status after load.

So I see two cache, ā€˜could not openā€™ problems before a 15 sec. pause.
Someone?

Maybe you should enter into your docker image :

docker exec -i -t CONTENER_ID /bin/bash

then go into the folder : /var/cache/loolwsd and see the permissions with ls -ll

Maybe there is a permission problem.

Iā€™m gonna make a tutorial for extracting files from docker in order to have it working smoothly.

Thank you for the idea! But I think the permissions are alright?
-rw-r--r-- 1 lool lool 43 Aug 22 12:55 partpagerectangles.txt -rw-r--r-- 1 lool lool 61 Aug 22 12:55 status.txt

A second view on a second log - I thought maybe itā€™s not the two files, but rather something about the memory allocation? But perhaps the two are related tooā€¦
First log:
wsd-00020-00 00:32:30.599320 [ loolwsd ] Nothing to autosave [my.nc.net/index.php/apps/richdocuments/wopi/files/169]. wsd-00020-10 00:32:32.802173 [ loolwsd ] Total memory used: 305284 wsd-00020-10 00:32:47.822702 [ loolwsd ] Total memory used: 305356 kit-00066-04 00:32:50.157427 [ kit_queue_0005 ] Document::DocumentCallback ...
Second:
kit-00062-04 03:22:46.818813 [ kit_queue_0007 ] Calling lokit::documentLoad. wsd-00020-02 03:22:47.065459 [ prison_ws_0007 ] Message to admin console: adddoc 62 mydoc.docx 0007 128620 wsd-00020-02 03:22:47.065626 [ prison_ws_0007 ] SocketProcessor starting. wsd-00020-10 03:22:51.580593 [ loolwsd ] Total memory used: 304944 wsd-00020-00 03:23:01.598173 [ loolwsd ] Nothing to autosave [my.nc.net/index.php/apps/richdocuments/wopi/files/178]. wsd-00020-10 03:23:06.597875 [ loolwsd ] Total memory used: 305016 kit-00062-04 03:23:06.893370 [ kit_queue_0007 ] Document::DocumentCallback STATUS_INDICATOR_START [].

I donā€™t have a seperate memory setup for docker and the debian system is running in a VM.

// After investigating a little into this, is this a debian/ubuntu-like issue? I donā€™t think it is possible to enable kernel memory on these systems right now. The end of # docker info:
WARNING: No kernel memory limit support and this is relevant for:?
SocketProcessor starting. //

This doesnā€™t seem to matterā€¦ anyway, a fedora24 docker installation having this 20 seconds too. The log looks pretty much the same too.

I changed the permissions of /var/cache/loolwsd to 777, but that didnā€™t change to better, it broke the saving mechanism, I think.

Is it possible that the two documents are just not yet created and thus canā€™t be opened at the time?

hi all. OP here. iā€™ve been doing some further investigation and iā€™ve found the source of the 20 second delay. ironically it was, as I initially suspected, a DNS lookup.

by performing a tcpdump on the docker0 interface using the original (first) collabora docker image I could see a whole pile of DNS lookup requests directed to 192.168.65.1. this isnā€™t an IP that has anything to do with my infrastructure or anything to do with my docker setup.

when I updated to the most recent collabora docker image, this has now changed to direct to 192.168.100.1. again, not an IP address thatā€™s related to me.

09:35:30.230560 IP 172.17.0.1.59310 > 192.168.100.1.53: 57049+ A? fca10b4e59a4.site. (35)
09:35:35.235168 IP 172.17.0.1.59310 > 192.168.100.1.53: 57049+ A? fca10b4e59a4.site. (35)

when I first saw this I jumped into the collabora image and searched for references to 192.168.65.1. I repeated this for the current docker image and found this:

/opt/lool/systemplate/etc/resolv.conf:
# Generated by NetworkManager
search site
nameserver 192.168.100.1

i tried to change this, but the edit didnā€™t seem to apply. iā€™m suspecting this file is automatically generated when the docker image launches.

at the moment iā€™m trying to see if there is anything in docker i can reconfigure to accommodate for this. i know that in docker 1.10 and above there is a DNS proxy feature and I wonder if there is somehow I can setup docker to receive the DNS requests and proxy them across.

iā€™m still not sure where the 192.168.100.1 IP address is generated from, and I also donā€™t know why this IP changed from the first image 192.168.65.1. interestingly enough if I google for docker and either of these two IP addresses I find quite a few users with similar setups. i havenā€™t built anything in docker and I donā€™t know if any of this originates from an introductory guide or similar.

if the person who is responsible for creating this docker image is available to comment and perhaps provide any information about how the docker daemon is launched on their system with any specific networking options this might greatly assist. it would also be of great interest if either of the two above IP addresses mean anything to the original builders infrastructure.

iā€™ll post up more information if I discover anything that I can change in docker land that changes this functionality.

cheers, wizdude.

ugly hack #1

iptables -t nat -I PREROUTING -d 192.168.100.1 -p udp --dport 53 -j DNAT --to-destination (your nameserver ip)

eg:
iptables -t nat -I PREROUTING -d 192.168.100.1 -p udp --dport 53 -j DNAT --to-destination 192.168.25.11

bang. documents come up right away.

this is a horrible solution to the problem. the DNS requests are essentially failing, but failing very quickly rather than timing out.

iā€™m trying to work on getting the docker embedded DNS proxy working. I suspect iā€™ll need to change the IP of the docker bridge to 192.168.100.1 in order to get this working as intended. this will probably work for people (such as myself) that have spun up a VM solely for the purpose of running collabora, but would not be a solution for those running on an existing docker host.

iā€™m still unsure how the collabora container is meant to have its DNS configured, but that might be something for the creator of it to answer.

1 Like