Collabora Office Docker with Nextcloud (bare metal install) - Document loading failed with office document

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / ā€œas availableā€ basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.6
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.4 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.58 (Ubuntu)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Apache/2.4.58 (Ubuntu)
  • PHP version (e.g, 8.3):
    • 8.3.6
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • A few days ago
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare Metal/Archive
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

My setup involves a Collabora Office docker connected to a bare metal install of Nextcloud. Collabora Office seemed to stopped loading office files (.ods, etc.) one day when I was optimizing UFW rules. Even after reinstating the same rules as before and reloading the firewall and restarting the server, Collabora continues to fail to load the documents. This leads me to suspect it’s been broken for some time.

I see the green checkmark in Admin settings > Office, but whenever I try to load a document I get this error:

Document loading failed

Failed to load Nextcloud Office - please try again later

I scoured the forums and old posts and tried every suggestion, including adding ,0.0.0.0/0 to the WOPI hosts, but so far nothing fixed my problem. The lack of logs on both Nextcloud and Collabora’s sides make it extremely hard to debug. The logs in the browser indicate it finds the file and tries to load it at the URL, but somewhere along the way it fails with a 404 somehow.

Steps to replicate it (hint: details matter!):

  1. Try to access a file on Nextcloud.

  2. Fail to load document.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

Could not find "Copy raw" nor anything useful in the Nextcloud logs.

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

File info for /Documents/File.ods fetched 
Object { filename: "/Documents/File.ods", basename: "File.ods", lastmod: "Sun, 15 Mar 2026 14:27:13 GMT", size: 28560, type: 3, etag: "1fa9e5fe5a3384abebeca6fdf0baa3d1", mime: "application/vnd.oasis.opendocument.spreadsheet", tags: "", getcontentlength: 28560, getcontenttype: "application/vnd.oasis.opendocument.spreadsheet", … }
Viewer.vue:668:1
​
<prototype>: Object { … }
index.mjs:45:17
07:42:11.095 Feature Policy: Skipping unsupported feature name ā€œclipboard-readā€. vue.runtime.esm.js:7399:12
07:42:11.095 Feature Policy: Skipping unsupported feature name ā€œclipboard-writeā€. vue.runtime.esm.js:7399:12
07:42:11.103 Feature Policy: Skipping unsupported feature name ā€œclipboard-readā€. vue.runtime.esm.js:6331:16
07:42:11.103 Feature Policy: Skipping unsupported feature name ā€œclipboard-writeā€. vue.runtime.esm.js:6331:16
07:42:11.333 [getWopiUrl] https://nextcloud.tdd-dev.com/index.php/apps/richdocuments/wopi/files/21959_ocwvgtoha1a7 url.js:28:10
07:42:11.355 POST
https://nextcloud.tdd-dev.com/browser/4610258811/cool.html?WOPISrc=https://nextcloud.tdd-dev.com/index.php/apps/richdocuments/wopi/files/21959_ocwvgtoha1a7&lang=en&closebutton=1&revisionhistory=1
[HTTP/1.1 404 Not Found 180ms]

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "127.0.0.1",
            "tdd-dev.com",
            "nextcloud.tdd-dev.com",
            "office.tdd-dev.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "32.0.6.1",
        "overwrite.cli.url": "https:\/\/nextcloud.tdd-dev.com",
        "overwriteprotocol": "https",
        "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": 0,
        "reference_opengraph": false,
        "enable_previews": false,
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "maintenance_window_start": 1,
        "app_install_overwrite": [
            "forms",
            "files_markdown"
        ],
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

Apps

The output of occ app:list (if possible).

Enabled:
  - app_api: 32.0.0
  - bruteforcesettings: 5.0.0
  - cloud_federation_api: 1.16.0
  - comments: 1.22.0
  - contactsinteraction: 1.13.1
  - dav: 1.34.2
  - federatedfilesharing: 1.22.0
  - federation: 1.22.0
  - files: 2.4.0
  - files_downloadlimit: 5.0.0-dev.0
  - files_pdfviewer: 5.0.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.1
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - firstrunwizard: 5.0.0
  - forms: 5.2.5
  - logreader: 5.0.0
  - lookup_server_connector: 1.20.0
  - nextcloud_announcements: 4.0.0
  - notifications: 5.0.0
  - oauth2: 1.20.0
  - password_policy: 4.0.0
  - photos: 5.0.0
  - polls: 8.6.3
  - privacy: 4.0.0
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - related_resources: 3.0.0
  - richdocuments: 9.0.5
  - serverinfo: 4.0.0
  - settings: 1.15.1
  - support: 4.0.0
  - systemtags: 1.22.0
  - text: 6.0.1
  - theming: 2.7.0
  - twofactor_backupcodes: 1.21.0
  - twofactor_totp: 14.0.0
  - updatenotification: 1.22.0
  - viewer: 5.0.0
  - webhook_listeners: 1.3.0
  - workflowengine: 2.14.0
Disabled:
  - activity: 5.0.0 (installed 2.21.1)
  - admin_audit: 1.22.0
  - circles: 32.0.0 (installed 25.0.0)
  - dashboard: 7.12.0 (installed 7.9.0)
  - encryption: 2.20.0
  - files_external: 1.24.1
  - files_markdown: 2.4.1 (installed 2.4.1)
  - recommendations: 5.0.0 (installed 1.0.0)
  - sharebymail: 1.22.0 (installed 1.14.0)
  - survey_client: 4.0.0 (installed 1.9.0)
  - suspicious_login: 10.0.0
  - twofactor_nextcloud_notification: 6.0.0
  - user_ldap: 1.23.0
  - user_status: 1.12.0 (installed 1.1.1)
  - weather_status: 1.12.0 (installed 1.1.0)

Here is my Apache config:

<VirtualHost *:80>
        ServerName office.tdd-dev.com

        ErrorLog ${APACHE_LOG_DIR}/collabora.error.log
        CustomLog ${APACHE_LOG_DIR}/collabora.access.log combined

</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName office.tdd-dev.com

        ErrorLog ${APACHE_LOG_DIR}/collabora.error.log
        CustomLog ${APACHE_LOG_DIR}/collabora.access.log combined

        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile **redacted**
        SSLCertificateKeyFile **redacted**

        ########################################
        # Reverse proxy for Collabora Online   #
        ########################################

        AllowEncodedSlashes NoDecode
        SSLProxyEngine On
        ProxyPreserveHost On

        Options -Indexes

        # cert is issued for collaboraonline.example.com and we proxy to localhost
        SSLProxyVerify None
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off

        # static html, js, images, etc. served from coolwsd
        # browser is the client part of Collabora Online
        ProxyPass           /browser https://127.0.0.1:9980/browser retry=0
        ProxyPassReverse    /browser https://127.0.0.1:9980/browser

        # WOPI discovery URL
        ProxyPass           /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0
        ProxyPassReverse    /hosting/discovery https://127.0.0.1:9980/hosting/discovery

        # Capabilities
        ProxyPass           /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities retry=0
        ProxyPassReverse    /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities

        # Main websocket
        ProxyPassMatch      "/cool/(.*)/ws$"      wss://127.0.0.1:9980/cool/$1/ws nocanon

        # Admin Console websocket
        ProxyPass           /cool/adminws wss://127.0.0.1:9980/cool/adminws

        # Download as, Fullscreen presentation and Image upload operations
        ProxyPass           /cool https://127.0.0.1:9980/cool
        ProxyPassReverse    /cool https://127.0.0.1:9980/cool

</VirtualHost>
</IfModule>

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

From you description chances are high one of the systems can not reach the other..
Please review the Collabora integration guide and report the troubleshooting steps.

Thanks for your reply. I followed the troubleshooting guide and ran into no issues. Here are the results.

# curl https://office.tdd-dev.com/hosting/discovery
<wopi-discovery>
    <net-zone name="external-https">

        <!-- Writer documents -->
        <app favIconUrl="https://office.tdd-dev.com/browser/4610258811/images/x-office-document.svg" name="writer">
...

* Nextcloud can reach the Collabora container


# (Inside Collabora container) curl https://nextcloud.tdd-dev.com/status.php
{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"32.0.6.1","versionstring":"32.0.6","edition":"","productname":"Nextcloud","extendedSupport":false}

* Collabora can reach Nextcloud

# occ app:enable richdocuments
richdocuments already enabled

* richdocuments is enabled

# occ config:app:get richdocuments wopi_url
https://office.tdd-dev.com/

* richdocuments URL is correct

# occ richdocuments:activate-config

āœ“ Reset callback url autodetect
Checking configuration
šŸ›ˆ Configured WOPI URL: https://office.tdd-dev.com
šŸ›ˆ Configured public WOPI URL: https://office.tdd-dev.com
šŸ›ˆ Configured callback URL: 

āœ“ Fetched /hosting/discovery endpoint
āœ“ Valid mimetype response
āœ“ Valid capabilities entry
āœ“ Fetched /hosting/capabilities endpoint
āœ“ Detected WOPI server: Collabora Online Development Edition 25.04.9.4

Collabora URL (used for Nextcloud to contact the Collabora server):
  https://office.tdd-dev.com
Collabora public URL (used in the browser to open Collabora):
  https://office.tdd-dev.com
Callback URL (used by Collabora to connect back to Nextcloud):
  autodetected (will use the same URL as your user for browsing Nextcloud)

Everything looks fine according to the steps, yet it’s still not working. Sometimes the error message switches between ā€œDocument loading failedā€ and:

Failed to establish socket connection or socket connection closed unexpectedly. The reverse proxy might be misconfigured, please contact the administrator. For more info on proxy configuration please checkout https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html

I have posted my Apache config above, using values suggested from the official Collabora documentation. Do you have suggestions on how to proceed?

I’m running out of ideas if you pass all checks still doesn’t work. the error

indicates some connection issue. I have no idea which one but there must be something (wild guessing: multihomed system, changing DNS, firewall killing connections). There was similar issue shortly CODE integrated server - documents not loading the user solved the problem with a hosts record

as your server is partly bare metal maybe communication out/into the container is going some strange path?

systematic troubleshooting

I would continue digging into the logs to see where it happens. as you see in edit file using WOPI protocol there is quite a lot communication between the systems

  • activate reverse proxy and NC webserver access log, increase the log level of CODE, Nextcloud to debug and reproduce the issue
  • track every request from the browser to Nextcloud, to CODE
CODE logging
services:
  collabora:
    image: collabora/code:${CODE_VERSION}
    environment:
      - extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning

This is a wildcard, but may be worth a try installing the package in the collabora host.

sudo apt install fontconfig glibc-source

Its a wild guess, but I’ve seen pigs fly :smiley:

Thank you both. I dug into it and I’m seeing a 500 proxy error on the browser, but I’m unsure how to fix it. I’m using the settings provided with Collabora’s documentation.

By the way, where can I find logs for Collabora? The host machine is hardly filling anything out in the logs I set in the Apache config. I can’t find anything in the container either.

Sadly this didn’t work either :frowning: I appreciate the suggestion!