Kolab + Collabora?

Milan Petrovic petrovic.milan at gmail.com
Fri Sep 27 03:04:19 CEST 2019


I have found that the following URL is being the issue for the document
opening process (office* is Collabora's subdomain, and mail* Kolab's):

https://office.mydomain.com/lool/https://mail.mydomain.com/chwala/api/wopi/files/w-OEA7dCZ70b5mV7XW?access_token=AuopF7kr4dCWXfECOcQ6j7yVt5&access_token_ttl=1569548237000&permission=edit/ws?WOPISrc=https://mail.mydomain.com/chwala/api/wopi/files/w-OEA7dCZ70b5mV7XW&compat=/ws

Collabora's log is like this:

Sep 27 02:30:40 mail.mydomain.com loolwsd[7108]: wsd-07108-11171 2019-09-27
00:30:40.149310 [ docbroker_012 ] ERR  WOPI::CheckFileInfo failed with 404
Not Found| wsd/Storage.cpp:495
Sep 27 02:30:40 mail.mydomain.com loolwsd[7108]: wsd-07108-11171 2019-09-27
00:30:40.149447 [ docbroker_012 ] ERR  loading document exception:
WOPI::CheckFileInfo failed| wsd/DocumentBroker.cpp:1158
Sep 27 02:30:40 mail.mydomain.com loolwsd[7108]: wsd-07108-11171 2019-09-27
00:30:40.149471 [ docbroker_012 ] ERR  Failed to add session to
[/chwala/api/wopi/files/w-OEA7dCZ70b5mV7XW] with URI [
https://mail.mydomain.com/chwala/api/wopi/files/w-OEA7dCZ70b5mV7XW?access_token=qj9F61I8tA7PRPmsd0Vi5gIGTj&access_token_ttl=1569555038000&permission=edit]:
WOPI::CheckFileInfo failed| wsd/DocumentBroker.cpp:1120
Sep 27 02:30:40 mail.mydomain.com loolwsd[7108]: wsd-07108-11171 2019-09-27
00:30:40.226632 [ docbroker_012 ] WRN  Child session [0145] not found to
forward message: load url=
https://mail.mydomain.com/chwala/api/wopi/files/w-OEA7dCZ70b5mV7XW?access_token=qj9F61I8tA7PRPmsd0Vi5gIGTj&access_token_ttl=1569555038000&permission=edit
readonly=0 lang=en-US| wsd/DocumentBroker.cpp:1770
Sep 27 02:30:40 mail.mydomain.com loolwsd[7108]: wsd-07108-11171 2019-09-27
00:30:40.236437 [ docbroker_012 ] ERR  Invalid or unknown session [0145] to
remove.| wsd/DocumentBroker.cpp:1194
Sep 27 02:30:41 mail.mydomain.com loolwsd[7108]: wsd-07108-07114 2019-09-27
00:30:41.150687 [ prisoner_poll ] WRN  Prisoner connection disconnected but
without valid socket.| wsd/LOOLWSD.cpp:1799
Sep 27 02:30:41 mail.mydomain.com loolwsd[7108]: kit-11079-07115 2019-09-27
00:30:41.150798 [ loolkit ] WRN  Kit connection lost without exit arriving
from wsd. Setting TerminationFlag| kit/Kit.cpp:2241

So, Collabora cannot get back the document that should be opened.

How to make sure this is done correctly?

My Chwala related config in nginx looks like this:

    ##
    ## Chwala
    ##
    #location /chwala/api {
    #    rewrite ^/chwala/api/wopi/(.*)$
/chwala/api/index.php?wopi=1&method=$1 break;
    #    }

    location /chwala {
        index index.php;
        alias /usr/share/chwala/public_html;
        try_files $uri $uri/ @chwala-api;

        client_max_body_size 100M; # set maximum upload size

        # enable php
        location ~ .php$ {
            include fastcgi_params;
            fastcgi_param HTTPS on;
            fastcgi_pass
unix:/var/run/php-fpm/mail.ifi-experience.com_chwala.sock;
            fastcgi_param SCRIPT_FILENAME $request_filename;
            # Without this, PHPSESSION is replaced by webadmin-api
X-Session-Token
            fastcgi_param PHP_VALUE "session.auto_start=0
                session.use_cookies=0";
            fastcgi_pass_header X-Session-Token;
        }
    }
    location @chwala-api {
        rewrite ^/api/wopi/(.*)$ /api/index.php?wopi=1&method=$1 break;
        rewrite ^/api/document/(.*)$ /api/index.php?method=document&id=$1
break;
    }

And my roundcube config is like this now:

   // WOPI/Office service URL. Enables use of collaborative editor
supporting WOPI.
    // Note: this URL should be accessible from Chwala host and Roundcube
host as well.
    $config['fileapi_wopi_office'] = 'https://office.ifi-experience.com/';

    // Kolab WOPI service URL. Enables use of collaborative editor
supporting WOPI.
    // Note: this URL should be accessible from Chwala host and Office host
as well.
    $config['fileapi_wopi_service'] = '
https://mail.ifi-experience.com/chwala/api/';

    $config['kolab_files_url'] = '/chwala/';
    $config['file_api_url'] = '/chwala/api/';

Any help or hint appreciated!

On Thu, Sep 26, 2019 at 2:34 PM Milan Petrovic <petrovic.milan at gmail.com>
wrote:

> Alexander, thanks a lot for the help!
>
> I have found that I had the wrong $config['fileapi_wopi_office'] set. I
> don't need the /hosting/discovery at the end of the URL. just the
> Collabora's host name.
>
> Now the editor opens (although, it looks like from the Manticore times),
> but theerror is thrown that the file cannot be found ("Failed to read
> document from storage"). So, I guess my Chwala settings should be somehow
> updated.
>
> I have put the rewrite rule (I'm using nginx, all of the Kolab is on the
> same subdomain, Collabora uses another, both are on the same host):
> '''
>     location /chwala {
>         index index.php;
>         alias /usr/share/chwala/public_html;
>
>         client_max_body_size 100M; # set maximum upload size
>
>         # enable php
>         location ~ .php$ {
>             include fastcgi_params;
>             fastcgi_param HTTPS on;
>             fastcgi_pass
> unix:/var/run/php-fpm/mail.mydomain.com_chwala.sock;
>             fastcgi_param SCRIPT_FILENAME $request_filename;
>             # Without this, PHPSESSION is replaced by webadmin-api
> X-Session-Token
>             fastcgi_param PHP_VALUE "session.auto_start=0
>                 session.use_cookies=0";
>             fastcgi_pass_header X-Session-Token;
>         }
>         location /chwala/api {
>             rewrite ^/chwala/api/wopi/(.*)$
> /chwala/api/index.php?wopi=1&method=$1 break;
>         }
>     }
> '''
> loolwsd service throws the following:
>
> Sep 26 14:25:23 mail.mydomain.com loolwsd[4957]: wsd-04957-09382
> 2019-09-26 12:25:23.157369 [ docbroker_019 ] ERR  WOPI::CheckFileInfo
> failed with 500 Internal Server Error| wsd/Storage.cpp:495
> Sep 26 14:25:23 mail.mydomain.com loolwsd[4957]: wsd-04957-09382
> 2019-09-26 12:25:23.158112 [ docbroker_019 ] ERR  loading document
> exception: WOPI::CheckFileInfo failed| wsd/DocumentBroker.cpp:1158
> Sep 26 14:25:23 mail.mydomain.com loolwsd[4957]: wsd-04957-09382
> 2019-09-26 12:25:23.158135 [ docbroker_019 ] ERR  Failed to add session to
> [/chwala/api/wopi/files/w-OEA7dCZ70b5mV7XW] with URI [
> https://mail.mydomain.com/chwala/api/wopi/files/w-OEA7dCZ70b5mV7XW?access_token=HCMTvTP7oh3xXOrLpeyvwslKSR&access_token_ttl=1569511521000&permission=edit]:
> WOPI::CheckFileInfo failed| wsd/DocumentBroker.cpp:1120
> Sep 26 14:25:23 mail.mydomain.com loolwsd[4957]: wsd-04957-09382
> 2019-09-26 12:25:23.270254 [ docbroker_019 ] WRN  Child session [01b0] not
> found to forward message: load url=
> https://mail.mydomain.com/chwala/api/wopi/files/w-OEA7dCZ70b5mV7XW?access_token=HCMTvTP7oh3xXOrLpeyvwslKSR&access_token_ttl=1569511521000&permission=edit
> readonly=0 lang=en-US| wsd/DocumentBroker.cpp:1770
> Sep 26 14:25:23 mail.mydomain.com loolwsd[4957]: wsd-04957-09382
> 2019-09-26 12:25:23.289352 [ docbroker_019 ] ERR  Invalid or unknown
> session [01b0] to remove.| wsd/DocumentBroker.cpp:1194
> Sep 26 14:25:24 mail.mydomain.com loolwsd[4957]: wsd-04957-04963
> 2019-09-26 12:25:24.159340 [ prisoner_poll ] WRN  Prisoner connection
> disconnected but without valid socket.| wsd/LOOLWSD.cpp:1799
> Sep 26 14:25:24 mail.mydomain.com loolwsd[4957]: kit-09330-04964
> 2019-09-26 12:25:24.159425 [ loolkit ] WRN  Kit connection lost without
> exit arriving from wsd. Setting TerminationFlag| kit/Kit.cpp:2241
>
> Also, my "fileapi_wopi_service" and "file_api_url" are the same, not sure
> if that should be the case:
>
>     $config['fileapi_wopi_service'] = '
> https://mail.ifi-experience.com/chwala/api';
>
>     $config['file_api_url'] = 'https://mail.ifi-experience.com/chwala/api
> ';
>
>
>
> On Thu, Sep 26, 2019 at 7:40 AM Aleksander Machniak <machniak at kolabsys.com>
> wrote:
>
>> On 9/25/19 1:01 PM, Milan Petrovic wrote:
>> > Anyone?
>> > Any hint?
>>
>> In recent Kolab you don't need kolab-wopi, it has been replaced by code
>> built into chwala.
>>
>> I never used CODE, but I work with collabora official (partner) packages.
>>
>> 1. You have to configure chwala to talk to collabora
>>
>> // WOPI/Office service URL. Enables use of collaborative editor
>> supporting WOPI.
>> // Note: this URL should be accessible from Chwala host and Roundcube
>> host as well.
>> $config['fileapi_wopi_office'] = null;
>>
>> You need also this rule in http server:
>>
>> RewriteRule ^api/wopi/(.*)$ api/index.php?wopi=1&method=$1 [L,QSA]
>>
>> 2. You have to configure collabora to allow Chwala host.
>>
>> That's it. Note that Roundcube (kolab_files plugin) is talking to chwala.
>> Chwala is
>> talking to Collabora. Collabora is talking to Chwala. User browser is
>> talking to
>> Roundcube, Chwala and Collabora.
>>
>> That's why it is important to carefully setup DNS so hostnames are
>> resolvable properly on
>> server as well as on client-side. Also, be carefull with ssl certificates
>> and
>> cross-domain, etc. Look for errors on server (Roundcube, Chwala,
>> Collabora), but also in
>> the web browser console.
>>
>> Also note that some chwala capabilities are cached in session, so you
>> sometimes have to
>> re-login in Roundcube to notice changes. You may also unset
>> $config['fileapi_cache'] while
>> debugging.
>>
>> --
>> Aleksander Machniak
>> Senior Software Engineer
>> Kolab Systems AG: https://kolabsystems.com
>> PGP: 19359DC1
>> _______________________________________________
>> users mailing list
>> users at lists.kolab.org
>> https://lists.kolab.org/mailman/listinfo/users
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kolab.org/pipermail/users/attachments/20190927/309a1b26/attachment.html>


More information about the users mailing list