Hallo zusammen,

ich habe mich für die letzten Beiträge intensiver mit der Collabora-Integration in NextCloud auf dem Raspberry Pi beschäftigt. Über den integrierten Code-Serve funktioniert es mittlerweile - wenngleich das nicht besonders stabil ist und sicherheitstechnisch fragwürdig, wenn da PHP im Hintergrund solche Prozesse startet. Auf X86 Hardware habe ich es vor einiger Zeit zum Laufen gebracht, derzeit auf dem RPI 4 mit Docker (64 Bit DietPi) nicht mehr.

Ursprünglich war geplant, dies in einem weiteren Teil vorzustellen. Da trotz mehrfacher Nachfrage und Neuinstallation auf einem Vanilla-Pi die Ursache bisher nicht gefunden werden konnte, habe ich das Thema vorerst auf Eis gelegt und sammle hier meine bisherigen Erkenntnisse.

Aufbau
Der Pi ist unter dem Hostname dietpi erreichbar. Da Collabora eine eigene (Sub-) Domain fordert, habe ich zusätzlich collabora.dietpi eingerichtet. Diese zeigt ebenfalls auf den gleichen Pi. Als OS wird DietPi 7.9.3 auf Basis von Debian/Raspberry Pi OS 11 eingesetzt mit Docker 20.10.12 und Docker-Compose 1.29.2. NextCloud wird in Version 23.0.0 mit der Collabora Online Erweiterung 5.0.1 verwendet.

Die docker-compose.yml sieht so aus:

Code:
version: "2.4"

services:
  collabora:
    image: collabora/code
    container_name: collabora
      #    mem_limit: 1.5G
    restart: always
    privileged: true

    ports:
      - 9980:9980

    environment:
      #- "TZ=Europe/Berlin"
      #      - extra_params=--o:ssl.enable=false --o:net.proto=IPv4 --o:net.post_allow.host[0]=[0-9+]+\.[0-9]+\.[0-9]+\.[0-9]+ --o:storage.wopi.host=[0-9+]+\.[0-9]+\.[0-9]+\.[0-9]+ --o:server_name=dietpi\.fritz\.box
      - extra_params=--o:ssl.enable=false --o:ssl.termination=false --o:net.proto=IPv4 --o:net.post_allow.host[0]=[0-9+]+\.[0-9]+\.[0-9]+\.[0-9]+ --o:storage.wopi.host=[0-9+]+\.[0-9]+\.[0-9]+\.[0-9]+
      - username=admin
      - password=admin
      - domain=dietpi\\.fritz\\.box
        #      - VIRTUA_HOST=collabora\\.dietpi

    cap_add:
      - MKNOD
Die bereits erfolglos getesteten Sachen sind dort auskommentiert. Wenn ich mit dieser Konfiguration und der Collabora-Erweiterung (dort ist http://dietpi:9980 als Server eingetragen) versuche ein übers Web-UI erstelltes Text- oder Tabellendokument zu öffnen, erscheint im Browser einige Zeit der Ladebalken. Dann der Fehler, das Dokument konnte nicht geladen werden. In der Konsole sieht man dazu einen Timeout:



Im Log vom Collabora-Container mehrere Fehler:

Code:
Ready to accept connections on port 9980.

wsd-00001-00055 2021-12-24 10:39:49.164749 +0000 [ websrv_poll ] ERR  Skipping the token [--co-image-logo=url('/nextcloud/core/img/logo/logo.png?v=0')] since it has more than one '=' pair| wsd/FileServerUtil.cpp:156
wsd-00001-00058 2021-12-24 10:39:49.336660 +0000 [ docbroker_001 ] WRN  Waking up dead poll thread [HttpSynReqPoll], started: false, finished: false| ./net/Socket.hpp:718
wsd-00001-00058 2021-12-24 10:39:52.410114 +0000 [ docbroker_001 ] ERR  #31: Socket read returned -1 (EHOSTUNREACH: No route to host)| ./net/Socket.hpp:1121
wsd-00001-00058 2021-12-24 10:39:52.410393 +0000 [ docbroker_001 ] ERR  #31: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00058 2021-12-24 10:39:52.410528 +0000 [ docbroker_001 ] ERR  #31: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00058 2021-12-24 10:39:52.410816 +0000 [ docbroker_001 ] ERR  WOPI::CheckFileInfo failed for URI [http://dietpi/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an?access_token=GrhmtC2JltqmNURHzjK5dsypgAHhCC79&access_token_ttl=0]: 0 . Headers:        Body: []| wsd/Storage.cpp:690
wsd-00001-00058 2021-12-24 10:39:52.411251 +0000 [ docbroker_001 ] ERR  loading document exception: WOPI::CheckFileInfo failed: | wsd/DocumentBroker.cpp:1913
wsd-00001-00058 2021-12-24 10:39:52.411474 +0000 [ docbroker_001 ] ERR  Failed to add session to [/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an] with URI [http://dietpi/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an?access_token=GrhmtC2JltqmNURHzjK5dsypgAHhCC79&access_token_ttl=0]: WOPI::CheckFileInfo failed: | wsd/DocumentBroker.cpp:1875
wsd-00001-00058 2021-12-24 10:39:52.411661 +0000 [ docbroker_001 ] ERR  Storage error while starting session on /nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an for socket #28. Terminating connection. Error: WOPI::CheckFileInfo failed: | wsd/COOLWSD.cpp:3690
wsd-00001-00058 2021-12-24 10:39:52.412236 +0000 [ docbroker_001 ] WRN  Ignoring attempted read from 28| ./net/Socket.hpp:1095
wsd-00001-00058 2021-12-24 10:39:52.412359 +0000 [ docbroker_001 ] ERR  Invalid or unknown session [05e] to remove.| wsd/DocumentBroker.cpp:1956
wsd-00001-00055 2021-12-24 10:39:52.806499 +0000 [ websrv_poll ] WRN  DocBroker with docKey [/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an] that is marked to be destroyed. Rejecting client request.| wsd/COOLWSD.cpp:2277
wsd-00001-00055 2021-12-24 10:39:52.807090 +0000 [ websrv_poll ] ERR  Error while handling Client WS Request: Failed to create DocBroker with docKey [/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an].| wsd/COOLWSD.cpp:3719
wsd-00001-00055 2021-12-24 10:39:52.807278 +0000 [ websrv_poll ] ERR  #27: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00055 2021-12-24 10:39:52.807414 +0000 [ websrv_poll ] ERR  #27: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00055 2021-12-24 10:39:52.807512 +0000 [ websrv_poll ] WRN  Socket #27 is shutting down but 64 bytes couldn't be flushed and still remain in the output buffer.| ./net/WebSocketHandler.hpp:771
wsd-00001-00055 2021-12-24 10:39:52.807631 +0000 [ websrv_poll ] ERR  #27: attempted to remove: 789 which is > size: 0 clamped to 0| ./net/Socket.hpp:1210
wsd-00001-00055 2021-12-24 10:39:52.807759 +0000 [ websrv_poll ] WRN  Ignoring attempted read from 27| ./net/Socket.hpp:1095
wsd-00001-00055 2021-12-24 10:39:52.807864 +0000 [ websrv_poll ] ERR  #27: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00055 2021-12-24 10:39:53.319400 +0000 [ websrv_poll ] WRN  DocBroker with docKey [/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an] that is marked to be destroyed. Rejecting client request.| wsd/COOLWSD.cpp:2277
wsd-00001-00055 2021-12-24 10:39:53.320202 +0000 [ websrv_poll ] ERR  Error while handling Client WS Request: Failed to create DocBroker with docKey [/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an].| wsd/COOLWSD.cpp:3719
wsd-00001-00055 2021-12-24 10:39:53.320379 +0000 [ websrv_poll ] ERR  #27: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00055 2021-12-24 10:39:53.320514 +0000 [ websrv_poll ] ERR  #27: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00055 2021-12-24 10:39:53.320612 +0000 [ websrv_poll ] WRN  Socket #27 is shutting down but 64 bytes couldn't be flushed and still remain in the output buffer.| ./net/WebSocketHandler.hpp:771
wsd-00001-00055 2021-12-24 10:39:53.321065 +0000 [ websrv_poll ] ERR  #27: attempted to remove: 789 which is > size: 0 clamped to 0| ./net/Socket.hpp:1210
wsd-00001-00055 2021-12-24 10:39:53.321223 +0000 [ websrv_poll ] WRN  Ignoring attempted read from 27| ./net/Socket.hpp:1095
wsd-00001-00055 2021-12-24 10:39:53.321348 +0000 [ websrv_poll ] ERR  #27: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00055 2021-12-24 10:39:55.331313 +0000 [ websrv_poll ] WRN  Prisoner connection disconnected but without valid socket.| wsd/COOLWSD.cpp:2364
wsd-00001-00059 2021-12-24 10:39:55.354149 +0000 [ docbroker_002 ] WRN  Waking up dead poll thread [HttpSynReqPoll], started: false, finished: false| ./net/Socket.hpp:718
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00051-00051 2021-12-24 10:39:55.385848 +0000 [ forkit ] ERR  Failed to unmount [/opt/cool/child-roots/9aNyhXYNxAs7Az3e/tmp]| common/JailUtil.cpp:70
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00051-00051 2021-12-24 10:39:55.432007 +0000 [ forkit ] ERR  Failed to unmount [/opt/cool/child-roots/9aNyhXYNxAs7Az3e/lo]| common/JailUtil.cpp:70
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00051-00051 2021-12-24 10:39:55.478826 +0000 [ forkit ] ERR  Failed to unmount [/opt/cool/child-roots/9aNyhXYNxAs7Az3e]| common/JailUtil.cpp:70
wsd-00001-00059 2021-12-24 10:39:58.426092 +0000 [ docbroker_002 ] ERR  #29: Socket read returned -1 (EHOSTUNREACH: No route to host)| ./net/Socket.hpp:1121
wsd-00001-00059 2021-12-24 10:39:58.426344 +0000 [ docbroker_002 ] ERR  #29: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00059 2021-12-24 10:39:58.426467 +0000 [ docbroker_002 ] ERR  #29: Socket write returned -1 (EPIPE: Broken pipe)| ./net/Socket.hpp:1381
wsd-00001-00059 2021-12-24 10:39:58.426729 +0000 [ docbroker_002 ] ERR  WOPI::CheckFileInfo failed for URI [http://dietpi/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an?access_token=GrhmtC2JltqmNURHzjK5dsypgAHhCC79&access_token_ttl=0&permission=edit]: 0 . Headers:        Body: []| wsd/Storage.cpp:690
wsd-00001-00059 2021-12-24 10:39:58.427134 +0000 [ docbroker_002 ] ERR  loading document exception: WOPI::CheckFileInfo failed: | wsd/DocumentBroker.cpp:1913
wsd-00001-00059 2021-12-24 10:39:58.427337 +0000 [ docbroker_002 ] ERR  Failed to add session to [/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an] with URI [http://dietpi/nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an?access_token=GrhmtC2JltqmNURHzjK5dsypgAHhCC79&access_token_ttl=0&permission=edit]: WOPI::CheckFileInfo failed: | wsd/DocumentBroker.cpp:1875
wsd-00001-00059 2021-12-24 10:39:58.427520 +0000 [ docbroker_002 ] ERR  Storage error while starting session on /nextcloud/index.php/apps/richdocuments/wopi/files/237_ocwpcnpye4an for socket #27. Terminating connection. Error: WOPI::CheckFileInfo failed: | wsd/COOLWSD.cpp:3690
wsd-00001-00059 2021-12-24 10:39:58.428113 +0000 [ docbroker_002 ] WRN  Ignoring attempted read from 27| ./net/Socket.hpp:1095
wsd-00001-00059 2021-12-24 10:39:58.428228 +0000 [ docbroker_002 ] ERR  Invalid or unknown session [06e] to remove.| wsd/DocumentBroker.cpp:1956
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00051-00051 2021-12-24 10:40:00.942115 +0000 [ forkit ] ERR  Failed to unmount [/opt/cool/child-roots/Icy7VU81GTqTdxRf/tmp]| common/JailUtil.cpp:70
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00051-00051 2021-12-24 10:40:00.993169 +0000 [ forkit ] ERR  Failed to unmount [/opt/cool/child-roots/Icy7VU81GTqTdxRf/lo]| common/JailUtil.cpp:70
sh: 1: /usr/bin/coolmount: Operation not permitted
frk-00051-00051 2021-12-24 10:40:01.042009 +0000 [ forkit ] ERR  Failed to unmount [/opt/cool/child-roots/Icy7VU81GTqTdxRf]| common/JailUtil.cpp:70
Sieht aus, als ob er sich versucht zu einem System (Nextcloud?) zu verbinden und das netzwerktechnisch nicht funktioniert. Der NextCloud-Host ist aus dem Container erreichbar. Um auf Nummer Sicher zu gehen, habe ich zusätzlich in /etc/docker/daemon.json meinen DNS-Server eingetragen. Sollte zwar kein DNS-Problem sein, wurde an anderer Stelle empfohlen und mir sind die Lösungswege ausgegangen.
Code:
"dns": ["192.168.0.19"]
Als Installationsweg habe ich es sowohl mit der in DietPi integrierten Version über DietPi-Software versucht, sowie eine händische Installation. Ganz simpel mit Apache2, mod_php und MariaDB. Als dritte Variante auch komplett auf Docker, d.H. sowohl NextCloud als auch MariaDB und Collabora laufen in eigenen Containern:

Code:
version: "2.4"

services:
  nextcloud:
    image: nextcloud:23-apache
      #mem_limit: 2G
    restart: always

    ports:
      - 81:80

    volumes:
      - ./nc-data:/var/www/html

    environment:
      - "TZ=Europe/Berlin"

  mariadb:
    image: mariadb:10.6
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
    mem_limit: 1G
    restart: always

    volumes:
      - ./mariadb-data:/var/lib/mysql

    environment:
      - "MARIADB_ROOT_PASSWORD=admin"
      - "MARIADB_DATABASE=nextcloud"

  collabora:
    image: collabora/code
    container_name: collabora2
      #    mem_limit: 1.5G
    restart: always
      #privileged: true

    ports:
      - 9981:9980

    environment:
      - "TZ=Europe/Berlin"
      - "extra_params=--o:ssl.enable=false"
      - "username=admin"
      - "password=admin"
      - "domain=dietpi"

    cap_add:
      - MKNOD
Zusätzlich Apache2 als Reverse-Proxy davor und entsprechend in NC http://collabora.dietpi ohne Port statt direkt auf 9980 angegeben:
Code:
<VirtualHost *:80>
  ServerName collabora.dietpi
  ProxyPreserveHost On

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

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

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

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

  # Admin Console websocket
  ProxyPass   /lool/adminws ws://127.0.0.1:9980/lool/adminws
  ProxyPass   /cool ws://127.0.0.1:9980/cool

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

#  ProxyPass           / http://127.0.0.1:9980/
 # ProxyPassReverse    / http://127.0.0.1:9980/
</VirtualHost>
Keine der Varianten hat funktioniert. Wenn man den Collabora-Container privilegiert laufen lässt (was nicht in der offiziellen Doku steht, aber u.a. in Tickets von den Entwicklern empfohlen wird), dünnt sich das Log etwas aus. Die Berechtigungsfehler wie "Failed to unmount [/opt/cool/child-roots/Icy7VU81GTqTdxRf]" verschwinden. Die restlichen Meldungen bleiben, auch der "EHOSTUNREACH: No route to host" Fehler.

Ich denke, dort ist das Problem. Der versucht anscheinend, auf die NextCloud zuzugreifen um Infos zum Dokument abzurufen, oder eventuell auch gleich das Dokument selbst. Das schlägt fehl, deswegen wird es mehrmals versucht. Irgendwann läuft der Browser dann in einen Timeout und gibt es auf. Warum der das nicht abrufen kann, ist für mich aber nicht nachvollziehbar.

Man könnte noch die Ubuntu Appliance ausprobieren. Gefällt mir nicht so diese Variante und löst das Docker-Problem wohl auch nicht, weil die das sicherlich nativ installieren. Docker würde ich da schon als bevorzugten Weg sehen, bevor man eine Appliance installiert, wo man anscheinend auch noch zu einem Ubuntu-SSH Account gedrängt wird, nur um sich anmelden zu können. Zumal dafür auch eine Neuinstallation notwendig ist. Mit Docker kann man das auf einem bestehenden System installieren.