Nextcloud 31 + Collabora CODE Docker integration: Office files cannot be opened / WOPI or richdocuments errors

Hello everyone,

I migrated my Nextcloud installation to a new Docker server and am currently trying to integrate Collabora, say, Office, asit is put now. The basic services are running, but opening or generating previews for Office documents fails. Until now, there is no DNS magic happening, so I use plain IPs without https/ssl.

Environment

  • Debian 12
  • Docker / Docker Compose
  • Nextcloud: 31.0.14.1
  • Collabora Online Development Edition:
    • 26.04.2.1
  • MariaDB 11
  • Nextcloud and Collabora are running as separate Docker containers

Nextcloud itself is working correctly:

  • Login works
  • Files are available
  • File synchronization works
  • Upgrade to Nextcloud 31 completed successfully

Collabora container

The Collabora container is running:

curl http://SERVER-IP:8084

returns:

OK

So Collabora starts successfully.

The containers are also able to communicate with each other.


Problem

Opening a DOCX file or generating a preview fails.

The Nextcloud log shows:

Socket connection could not be established or the socket connection was closed unexpectedly. The reverse proxy may be misconfigured. Please contact the administrator. For more information on proxy configuration, please visit https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html

In the logs

fclose(): supplied resource is not a valid stream resource

apps/richdocuments/lib/Service/RemoteService.php line 71

The relevant stack trace:

OCA\Richdocuments\Service\RemoteService->convertFileTo()

OCA\Richdocuments\Preview\Office->getThumbnail()

OC\Preview\Generator

It looks like richdocuments is contacting Collabora, but does not receive a valid response/stream back.


Additional relevant log entries

Collabora is clearly reaching Nextcloud:

userAgent":"COOLWSD HTTP Agent 26.04.2.1"

However, Nextcloud reports:


file_get_contents(
/var/www/html/data/appdata_*/richdocuments/systemconfig/xcu/documentView.xcu
)

Failed to open stream:
No such file or directory

So Collabora can access Nextcloud, but some richdocuments configuration files seem to be missing.


richdocuments configuration

Installed app:

richdocuments 8.8.1

Configuration was initialized using:

occ richdocuments:activate-config

The WOPI server was detected.

Current settings include:

disable_certificate_verification => yes
enabled => yes
public_wopi_url => Collabora address
wopi_allowlist => 0.0.0.0/0 (to exclude this as an error)

Thanks for any help and I’d happily provide more information!

Best Tom