3

I have this error message:

Failed to load Collabora Online - please try again later

at the top-right corner of the self hosted nextcloud website when I try to open the file

Welcome to Nextcloud Hub.docx

In Nextcloud that is running as a docker container.

Welcome to Nextcloud Hub.docx is located in Files > Documents as an example file.

screenshot

I am using the official image of nextcloud:19-apache
that I started this way:

#!/bin/sh

set -e;
set -f;

docker run -d \
--name nextcloud \
-p 8080:80 \
-v /tmp/nextcloud/var/www/html:/var/www/html \
-v /tmp/nextcloud/var/lib/mysql:/var/lib/mysql \
-v /tmp/nextcloud/var/lib/postgresql/data:/var/lib/postgresql/data \
nextcloud:19-apache

sleep 3;

firefox "http://localhost:8080"

exit 0;

And I check logs this way:

docker logs nextcloud

There are no errors/warnings besides this one entry:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message

Clicking in nextcloud web Settings > apps shows that both apps required for Collabora are installed:

enter image description here

However there is no status of them if they are running as they should or not.

The status of all of the running container:

NETWORK ID          NAME                DRIVER              SCOPE
88efc7e2489f        bridge              bridge              local
b75e841984e3        host                host                local
efff0416acdb        none                null                local


-------------------------------------------------------------

CONTAINER ID  IMAGE                CREATED              STATUS   IP                  PORTS                                            NAMES
58c7069e0a4d  nextcloud:19-apache  2020-09-21T13:59:53  running  bridge:172.17.0.2   map[80/tcp:[map[HostIp:0.0.0.0 HostPort:8080]]]  /nextcloud

How to make Collabora working and open that document docx? (there is no problem when opening *.pdf or *.md files, edit them and have saved with a revision history)

Jimmix
  • 5,644
  • 6
  • 44
  • 71
  • AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message This is not bad and normal if you are not working with a real domain. So only local. I will write you a Docker-Compose File this evening which makes more sense somehow. – Gregor Wedlich Oct 01 '20 at 12:23

1 Answers1

6

So I took a look at this. I have always used Nextcloud only by Docker-Compose, Traefik or Nginx and the Colabora Server as extra Server.

  1. For Collabora to work, the Apache server must listen inside on port 9980. For it to do so you would have to put the Apache Config revise (ProxyPass). See on Part2 in the Documentation Link

  2. I cannot recommend the local Collabora Server because it is often crashes. But that's not the point here.

  3. I wouldn't do it that way at all, but rather use docker-compose to assemble the service.

I have implemented a local installation of Nextcloud with Collabora via the Traefik Proxy. You don't have to worry about the webserver redirecting to the right port because Traefik takes care of that.

Docker-Compose Example

If you have any questions, just ask!

In my example I use Local Domains that resolve to the Docker IP. Just edit the Hosts file. But you know that for sure...

192.168.x.x collabora.local.com 192.168.x.x nextcloud.local.com

Install Docker-Compose if you do not already have it.

Create Networt "web": $ docker network create web

Create Docker-Compose file: $ touch docker-compose.yml

Add:

version: "3.3"

volumes:
  db:
  nextcloud:

services:
  traefik:
    image: "traefik:v2.3"
    container_name: "traefik"
    restart: always
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/etc/localtime:/etc/localtime:ro"
    networks:
      - web
      - internal

  nextcloud:
    image: "nextcloud:19-apache"
    container_name: "nextcloud-app"
    restart: unless-stopped
    depends_on:
      - traefik
      - db
    volumes:
      - "nextcloud:/var/www/html"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.nextcloud-app.entrypoints=web"
      - "traefik.http.routers.nextcloud-app.rule=Host(`nextcloud.local.com`)"
    networks:
      - web
      - internal

  collabora:
    image: "collabora/code"
    container_name: collabora-app
    restart: unless-stopped
    expose:
      - "9980"
    environment:
      - domain=nextcloud.local.com
      - extra_params=--o:ssl.enable=false
      - username=admin
      - password=admin
    cap_add:
      - MKNOD
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.collabora.entrypoints=web"
      - "traefik.http.routers.collabora.rule=Host(`collabora.local.com`)"
      - "traefik.http.services.collabora.loadbalancer.server.port=9980"
    networks:
      - web

  db:
    image: mariadb:latest
    container_name: nextcloud-db
    restart: always
    environment:
      - MYSQL_HOSTNAME=maria_db
      - MYSQL_ROOT_PASSWORD=Secure_Root_Password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=Secure_Password
    ports:
      - "3306:3306"
    volumes:
      - "db:/var/lib/mysql"
    networks:
      - internal
    labels:
      - "traefik.enable=false"

networks:
  web:
    external: true
  internal:
    external: false

start: docker-compose up

start as deamon: docker-compose up -d

stop: docker-compose down

Gregor Wedlich
  • 654
  • 6
  • 14
  • Can you share an example docker compose file you use for running the Nextcloud with Collabora? I am not bound to use Apache at all. I've just taken the Apache image because I thought I would be the fastest to get the Nextcloud with Collabora running but since there are problems with it it would make no difference to me if I used Apache or ie Nginx – Jimmix Oct 01 '20 at 19:09
  • thank you for sharing the docker-compose.yml I have problem when running `docker-compose config` - the error I see: `ERROR: The Compose file './docker-compose.yml' is invalid because: services.nextcloud.depends_on contains an invalid type, it should be an array` I am using `docker-compose version 1.17.1, build unknown` – Jimmix Oct 03 '20 at 22:25
  • Sorry Docker-Compose Version dont support condition. Please change to `depends_on: - traefik - db` And maybe you do an update from time to time Current is version 1.27.4 – Gregor Wedlich Oct 04 '20 at 00:17
  • do you know why this docker-compose file creates `docker_internal` network instead of `internal`. I don't have any problem with creating `internal` named network with `docker network create --internal internal` but docker-compose creates `docker_internal` the other funny thing is that `docker-compose up` complains when there is no `web` network but creates by itself that `docker_internal` network and removes it with `docker-compose down` so why it treats `web` network differently? – Jimmix Oct 06 '20 at 21:57
  • I have a problem with the current docker-compose.yml you provided as an example. At the machine the docker is running the nextcloud application is available under the network `web:172.xxx` but not from any other machine at the same local network 192.xxx but the traefik dashboard webpage at 8080 is available from the hosting machine and all the other machines at the same 192.xxx network. That's exactly the opposite state I would like to have. I would like the nextcloud app be available from the host and all ohters and treafik dashboard only from host. Do you have any advice? – Jimmix Oct 06 '20 at 22:38
  • Change you the hosts on the other clients to `SERVER_IP nextcloud.local.com` and flush dns. – Gregor Wedlich Oct 07 '20 at 06:23
  • The other thing I see is that accessing `localhost:8080` i get webpage with text `404 page not found` and no `Server` header (I would expect header `Server: Apache`) so my guess is that traefik does not forwad this request to the Apache server of the Nextcloud app - could I be right? – Jimmix Oct 07 '20 at 15:16
  • If you want your traefik to redirect to port 8080 you have to tell him so. For this purpose you use a loadbalancer service. ex.: `- "traefik.http.services.watch-port-80.loadbalancer.server.port=8080"` in the nextcloud section. – Gregor Wedlich Oct 07 '20 at 16:34
  • Actually I would like it to forward to the Nextcloud app that is under `172.xxx.xxx.xxx:80` do you know what rule I would need to put to traefik? – Jimmix Oct 07 '20 at 16:38
  • `- "traefik.http.services.watch-port-80.loadbalancer.server.port=80"` – Gregor Wedlich Oct 07 '20 at 16:42
  • It should be enough to specify the server IP not the internal Docker IP... – Gregor Wedlich Oct 07 '20 at 16:43
  • But the traffic only knows what to do if you address it with the domain you have specified. You can't choose localhost, 172 or whatever you have to specify the host in the browser it is also specified here `app.rule=Host(YOUR-HOST)` – Gregor Wedlich Oct 07 '20 at 16:45