Nextcloud Office not able to open any files, even using demo Collabora server

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.5
  • Operating system and version (e.g., Ubuntu 24.04):
    • Truenas Scale 25.04 (based on Debian 12)
  • Web server and version (e.g, Apache 2.4.25):
    • Unsure
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx proxy manager v2.12.3
  • PHP version (e.g, 8.3):
    • *8.3.21
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • On first setting up nextcloud
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker container on Truenas Scale
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • Yes, cloudflare proxy

Summary of the issue you are facing:

Opening any files with Office fails with the error message

Document loading failed

Failed to load Nextcloud Office - please try again later

even when using a demo Collabora server

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

  1. Install Nextcloud via docker
  2. Install office app in nextcloud
  3. Go to Administration Settings > Office and select any demo collabora server
  4. Create an odt file
  5. Trying to open the file results in the error message above.

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.

ConnectException cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://demo.sa.collaboraonline.com/cool/convert-to/png
Failed to convert preview: cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://demo.sa.collaboraonline.com/cool/convert-to/png 

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.

Failed to load ‘https://drive.example.com/core/preview?fileId=23&x=128&y=128&mimeFallback=true&v=943ead&a=0’. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘Error: no-response :: [{"url":"https://drive.example.com/core/preview?fileId=23&x=128&y=128&mimeFallback=true&v=943ead&a=0","error":{}}]’.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://demo.eu.collaboraonline.com/controller/routeToken?Uri=wss%3A%2F%2Fdemo.sa.collaboraonline.com%2Fcool%2Fhttps%253A%252F%252Fdrive.jesserizzo.com%252Findex.php%252Fapps%252Frichdocuments%252Fwopi%252Ffiles%252F798_ocm798gmj17t%253Faccess_token%253DQeWpK2KcGREX3FlXYXN9zJCnsAvS5w5t%2526access_token_ttl%253D0%2Fws%3FWOPISrc%3Dhttps%253A%252F%252Fdrive.jesserizzo.com%252Findex.php%252Fapps%252Frichdocuments%252Fwopi%252Ffiles%252F798_ocm798gmj17t%26compat%3D%2Fws&TimeZone=America/Los_Angeles. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
Document loading failed due to timeout: Please check for failing network requests

Web server / Reverse Proxy

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

NA

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": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "upgrade.disable-web": true,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "31.0.5.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "127.0.0.1",
            "192.168.1.194",
            "drive.example.com",
            "localhost",
            "nextcloud",
            "truenas.local"
        ]
    }
}

Apps

Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - richdocuments: 8.6.5
  - richdocumentscode: 24.4.1303
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - files_external: 1.23.0
  - photos: 4.0.0-dev.1 (installed 4.0.0-dev.1)
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0

I ended up just using Portainer to set up the AIO version instead of using the Truenas app version. It’s working fine now. I’m not sure if I did something wrong, or if the Truenas version is just broken or what.