CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.88k stars 710 forks source link

Cannot connect from multiple WOPI hosts #5332

Closed lukasmu closed 2 years ago

lukasmu commented 2 years ago

Describe the bug It seems that only one WOPI host can be used at a time.

To Reproduce

  1. The /etc/coolwsd/coolwsd.xml file contains the following:
    <wopi allow="true" desc="Allow/deny wopi storage.">
    <max_file_size desc="Maximum document size in bytes to load. 0 for unlimited." type="uint">0</max_file_size>
    <locking desc="Locking settings">
        <refresh default="900" desc="How frequently we should re-acquire a lock with the storage server, in seconds (default 15 mins) or 0 for no refresh" type="int">900</refresh>
    </locking>
    <alias_groups desc="default mode is 'first' it allows only the first host when groups are not defined. set mode to 'groups' and define group to allow multiple host and its aliases" mode="groups">
        <group>
            <host allow="true">host1.example.org</host>
        </group>
        <group>
            <host allow="true">host2.example.org</host>
        </group>
    </alias_groups>
    </wopi>
  2. You open a document from host1.example.org. This works.
  3. Then you open a document from host2.example.org. This does not work.

Expected behavior Opening documents from both hosts should work.

Actual behavior Only documents from a single host can be opened.

In the error log you see something like this:

ERR  Only allowed host is: host1.example.org, To use multiple host/aliases check alias_groups tag in configuration| wsd/HostUtil.cpp:220
ERR  No acceptable WOPI hosts found matching the target host [host2.example.org] in config.| wsd/Storage.cpp:263
ERR  loading document exception: No acceptable WOPI hosts found matching the target host [host2.example.org] in config.| wsd/DocumentBroker.cpp:2263
ERR  Failed to add session to [https://host2.example.org:443/index.php/apps/richdocuments/wopi/files/7127_oc4965xvrise] with URI [https://host2.example.org/index.php/apps/richdocuments/wopi/files/7127_oc496
ERR  Unauthorized Request while starting session on https://host2.example.org:443/index.php/apps/richdocuments/wopi/files/7127_oc4965xvrise for socket #30. Terminating connection. Error: No acceptable WOPI hosts found mat
ERR  #30: Socket write returned -1 (EPIPE: Broken pipe)| net/Socket.hpp:1431
ERR  Invalid or unknown session [008] to remove.| wsd/DocumentBroker.cpp:2308

The order in which steps 2 & 3 are executed matters: Only documents from the first host that connects to the Collabora server can be opened (if after restarting the coolwsd service you connect to Collabora server from host2.example.org first, then this works, but you cannot connect from host1.example.org).

Details

joergmschulz commented 2 years ago

see here https://help.nextcloud.com/t/important-changes-that-seem-to-affect-cool-docker-versions-from-v21-11-3-6-on-multiple-domains-setup/137867/2?u=wwe and follow the links

lukasmu commented 2 years ago

The issue apparently was that I did not specify scheme and port in the hosts section of the /etc/coolwsd/coolwsd.xml file. It should look like:

<group>
        <host allow="true">https://host1.example.org:443</host>
</group>
<group>
        <host allow="true">https://host2.example.org:443</host>
</group>

Then it works as it should