NextCloud (packages) with Collabora Office Docker - Document Loading Failed

Nextcloud version (eg, 26.0.1): 25.0.9
Operating system and version (eg, Ubuntu 22.04): Ubuntu 20.04.6 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 8.1): v7.4.3-4ubuntu2.19
Database (sqlite or MariaDB or Postgres) mariadb Ver 15.1 Distrib 10.3.38-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Docker (compose) :heavy_check_mark: (for Collabora)
Snap
Is this the first time you’ve seen this error? yes

The issue you are facing:

  • Steps to replicate it:
  1. Click on an empty Test.odt file in my NextCloud.
  2. See it attempting to load the document.
  3. Receive an error message: Document loading failed. Failed to load Nextcloud Office - please try again later
  • The output of your Nextcloud log in Admin > Logging:
Nothing since loading the document.
  • The output of your config.php file in /path/to/nextcloud**
    (use https://.../settings/admin/support which auto-removes identifying information!):
{
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "127.0.0.1",
        "tdd-dev.com",
        "www.tdd-dev.com",
        "office.tdd-dev.com"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "25.0.9.2",
    "overwrite.cli.url": "https:\/\/www.tdd-dev.com\/nextcloud",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "theme": "",
    "loglevel": 2,
    "preview_max_x": 2048,
    "preview_max_y": 2048
}
  • for Docker/Podman list environment variables ( run “docker inspect {container name}”)**
[
    {
        "Id": "sha256:82805ced0ab84aba1a6a529adc054039a344a95b0e2a0963e72532ac3774970d",
        "RepoTags": [
            "collabora/code:latest"
        ],
        "RepoDigests": [
            "collabora/code@sha256:bed84146cb7c8ef52242f0ec3b2946fab7eb9ecf232943037cec50642652cf7f"
        ],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2023-07-25T17:13:31.525150727+01:00",
        "Container": "",
        "ContainerConfig": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": null,
            "Cmd": null,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "DockerVersion": "",
        "Author": "Andras Timar <andras.timar@collabora.com>",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "100",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "9980/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LC_CTYPE=C.UTF-8"
            ],
            "Cmd": [
                "/start-collabora-online.sh"
            ],
            "ArgsEscaped": true,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 1353817537,
        "VirtualSize": 1353817537,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/a3bb7fa708d084f2d1fc8b2d120f456def3cadef7eaae2430f2c24a5fd90bf51/diff:/var/lib/docker/overlay2/62431ff6250295fda6c12055a59a439028959f5b2e3b3bb6047eb4fb9302ed67/diff:/var/lib/docker/overlay2/018d0a5454fd3d439bb2457153c64a57776b6dd69760c99d0df1e1117f50be0d/diff",
                "MergedDir": "/var/lib/docker/overlay2/99ad2973b27e4521550f85d859600ae7cd04bf39dfdbaae33e8daebd609985cf/merged",
                "UpperDir": "/var/lib/docker/overlay2/99ad2973b27e4521550f85d859600ae7cd04bf39dfdbaae33e8daebd609985cf/diff",
                "WorkDir": "/var/lib/docker/overlay2/99ad2973b27e4521550f85d859600ae7cd04bf39dfdbaae33e8daebd609985cf/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:34f03f266053c9ba13b3987460528e84beaa23b6415fc1b84d2beabbbab80516",
                "sha256:f0d882a6a5051f53ff9ae49477699030a8fffb5d2fa76752781d7e6911beb2d9",
                "sha256:4243af411027f3c7d019c80efc374ecdcd8056d999abb09d833f132460cb6e1a",
                "sha256:bde71a1c750720e7e443f764c6af9831de523c37574fdf096054c1bcfd658838"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

  • The output of your Apache/nginx/system log in /var/log/____:
  • For Docker/Podman post STDOUT of the container (run docker logs {container name})

Docker

 WOPI hosts found matching the target host [www.tdd-dev.com] in config| wsd/DocumentBroker.cpp:2573
wsd-00001-00196 2023-08-06 17:50:05.348096 +0000 [ docbroker_011 ] ERR  Unauthorized Request while starting session on https%3A%2F%2Fwww.tdd-dev.com%3A443%2Fnextcloud%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F16189_ocwvgtoha1a7 for socket #24. Terminating connection. Error: No acceptable WOPI hosts found matching the target host [www.tdd-dev.com] in config| wsd/COOLWSD.cpp:5047
wsd-00001-00196 2023-08-06 17:50:05.351059 +0000 [ docbroker_011 ] ERR  #24: Error while handling poll at 1 in docbroker_011: #24 (write): unknown. BIO error: 167772367, rc: -1: error:0A0000CF:SSL routines::protocol is shutdown:
C0163CD1D27F0000:error:0A0000CF:SSL routines:ssl_write_internal:protocol is shutdown:ssl/ssl_lib.c:2034:
| net/Socket.cpp:464
wsd-00001-00196 2023-08-06 17:50:05.354646 +0000 [ docbroker_011 ] ERR  #19: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1122
wsd-00001-00196 2023-08-06 17:50:05.354895 +0000 [ docbroker_011 ] WRN  #19: Unassociated Kit (195) disconnected unexpectedly| wsd/COOLWSD.cpp:3497
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00031-00031 2023-08-06 17:50:05.485509 +0000 [ forkit ] WRN  The systemplate directory [/opt/cool/systemplate] is read-only, and at least [/opt/cool/systemplate//etc/hosts] is out-of-date. Will have to copy sysTemplate to jails. To restore optimal performance, make sure the files in [/opt/cool/systemplate/etc] are up-to-date.| common/JailUtil.cpp:524
wsd-00001-00204 2023-08-06 17:50:05.918940 +0000 [ docbroker_012 ] ERR  No acceptable WOPI hosts found matching the target host [www.tdd-dev.com] in config| wsd/Storage.cpp:291
wsd-00001-00204 2023-08-06 17:50:05.919618 +0000 [ docbroker_012 ] ERR  loading document exception: No acceptable WOPI hosts found matching the target host [www.tdd-dev.com] in config| wsd/DocumentBroker.cpp:2611
wsd-00001-00204 2023-08-06 17:50:05.919968 +0000 [ docbroker_012 ] ERR  Failed to add session to [https%3A%2F%2Fwww.tdd-dev.com%3A443%2Fnextcloud%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F16189_ocwvgtoha1a7] with URI [https://www.tdd-dev.com/nextcloud/index.php/apps/richdocuments/wopi/files/16189_ocwvgtoha1a7?access_token=hfs7UfZ4LwDTOjqCzi2XkaigIzEQv5t3&access_token_ttl=1691380203000&permission=edit]: No acceptable WOPI hosts found matching the target host [www.tdd-dev.com] in config| wsd/DocumentBroker.cpp:2573
wsd-00001-00204 2023-08-06 17:50:05.920260 +0000 [ docbroker_012 ] ERR  Unauthorized Request while starting session on https%3A%2F%2Fwww.tdd-dev.com%3A443%2Fnextcloud%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F16189_ocwvgtoha1a7 for socket #24. Terminating connection. Error: No acceptable WOPI hosts found matching the target host [www.tdd-dev.com] in config| wsd/COOLWSD.cpp:5047
wsd-00001-00204 2023-08-06 17:50:05.924685 +0000 [ docbroker_012 ] ERR  #24: Error while handling poll at 1 in docbroker_012: #24 (write): unknown. BIO error: 167772367, rc: -1: error:0A0000CF:SSL routines::protocol is shutdown:
C0163CD1D27F0000:error:0A0000CF:SSL routines:ssl_write_internal:protocol is shutdown:ssl/ssl_lib.c:2034:
| net/Socket.cpp:464
wsd-00001-00204 2023-08-06 17:50:05.930163 +0000 [ docbroker_012 ] ERR  #18: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1122
wsd-00001-00204 2023-08-06 17:50:05.930527 +0000 [ docbroker_012 ] WRN  #18: Unassociated Kit (203) disconnected unexpectedly| wsd/COOLWSD.cpp:3497
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00031-00031 2023-08-06 17:50:06.062486 +0000 [ forkit ] WRN  The systemplate directory [/opt/cool/systemplate] is read-only, and at least [/opt/cool/systemplate//etc/hosts] is out-of-date. Will have to copy sysTemplate to jails. To restore optimal performance, make sure the files in [/opt/cool/systemplate/etc] are up-to-date.| common/JailUtil.cpp:524
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
wsd-00001-00036 2023-08-06 17:50:30.004599 +0000 [ websrv_poll ] WRN  convert-to: Requesting address is denied: 93.95.227.219| wsd/COOLWSD.cpp:3827
wsd-00001-00036 2023-08-06 17:51:00.016399 +0000 [ websrv_poll ] WRN  convert-to: Requesting address is denied: 93.95.227.219| wsd/COOLWSD.cpp:3827
wsd-00001-00036 2023-08-06 17:51:29.276088 +0000 [ websrv_poll ] WRN  convert-to: Requesting address is denied: 93.95.227.219| wsd/COOLWSD.cpp:3827
wsd-00001-00036 2023-08-06 17:51:30.175350 +0000 [ websrv_poll ] WRN  convert-to: Requesting address is denied: 93.95.227.219| wsd/COOLWSD.cpp:3827
wsd-00001-00036 2023-08-06 17:51:30.393028 +0000 [ websrv_poll ] WRN  convert-to: Requesting address is denied: 93.95.227.219| wsd/COOLWSD.cpp:3827

  • errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors.
None

Some more context:

  • NextCloud was installed via the archive. It’s been upgraded over several versions starting from NC 21.
  • I followed this guide for running Collabora Office in Docker. I have my own subdomain for the office suite, and NextCloud shows the green checkmark saying “Collabora Online server is reachable.”
  • I followed every step here. Everything looks all good - the admin panel is reachable and NC is discoverable from the Collabora docker and vice versa.
  • My VM has 2 GB of RAM.

Hi Kimimaru, according to your testing it “should be OK”.

In your logs I see this

it looks like CODE doesn’t accept Nextcloud server. (and I don’t see aliasgroupconfigured on your CODE container)

Look at this threads, likely it’s the same issue:

Hi @wwe,

Thanks for your reply. I have set aliasgroup1 to the subdomain and have used double quotes, but it still is not working. Should the aliasgroup be the NC domain or the Collabora Office subdomain?

More logs from docker:

 WOPI hosts found matching the target host [www.tdd-dev.com] in config| wsd/DocumentBroker.cpp:2573
wsd-00001-00072 2023-08-06 20:46:05.455488 +0000 [ docbroker_006 ] ERR  Unauthorized Request while starting session on https%3A%2F%2Fwww.tdd-dev.com%3A443%2Fnextcloud%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F16189_ocwvgtoha1a7 for socket #24. Terminating connection. Error: No acceptable WOPI hosts found matching the target host [www.tdd-dev.com] in config| wsd/COOLWSD.cpp:5047
wsd-00001-00072 2023-08-06 20:46:05.462031 +0000 [ docbroker_006 ] ERR  #24: Error while handling poll at 1 in docbroker_006: #24 (write): unknown. BIO error: 167772367, rc: -1: error:0A0000CF:SSL routines::protocol is shutdown:
C0E67F0BB97F0000:error:0A0000CF:SSL routines:ssl_write_internal:protocol is shutdown:ssl/ssl_lib.c:2034:
| net/Socket.cpp:464
wsd-00001-00072 2023-08-06 20:46:05.464062 +0000 [ docbroker_006 ] ERR  #18: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1122
wsd-00001-00072 2023-08-06 20:46:05.464351 +0000 [ docbroker_006 ] WRN  #18: Unassociated Kit (71) disconnected unexpectedly| wsd/COOLWSD.cpp:3497
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00031-00031 2023-08-06 20:46:05.594398 +0000 [ forkit ] WRN  The systemplate directory [/opt/cool/systemplate] is read-only, and at least [/opt/cool/systemplate//etc/hosts] is out-of-date. Will have to copy sysTemplate to jails. To restore optimal performance, make sure the files in [/opt/cool/systemplate/etc] are up-to-date.| common/JailUtil.cpp:524
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
wsd-00001-00036 2023-08-06 20:46:16.818003 +0000 [ websrv_poll ] WRN  convert-to: Requesting address is denied: 93.95.227.219| wsd/COOLWSD.cpp:3827

What should the WOPI host be? I’ve read the documentation but I’m still very confused what I should be allowing. Should it only be the NC server? The IP address of the VPS? If I leave it empty, it still fails to load the document.

see the second reference above. I’m not sure double quote are required in the new implementation…
you have to add your Nextcloud URL there… looks in you case it is www.tdd-dev.com (wondering about'www. prefix but technically nothing wrong with it)

Did you update the option for “Allow list for WOPI requests” in the Nextcloud settings? It may help to add the IP network of Docker here if you run CODE behind a reverse proxy.

Thanks everyone; I got it working!! It turns out I was specifying the docker container’s aliasgroup1 with the URL it was hosted instead of the base domain alone (Ex. instead of “https://example.com/nextcloud” just “example.com”).

Then I followed @awelzel’s advice and obtained the Docker container’s IP address with:
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id and added it to the WOPI request list. Then it all worked and it’s running smoothly!

1 Like