Collabora (docker) + NC 14 on Ubuntu 18.04 server (apache) does not load documents

I have a fresh install of NC 14 on Ubuntu 18.04, which works great. It is on my bare domain, i.e. “mydomain.com”, not a subdomain. I installed collabora core on the same server at “subdomain.mydomain.com” according to the following guides: https://www.linuxbabe.com/cloud-storage/integrate-collabora-online-server-nextcloud-ubuntu-16-04 & https://www.kerstner.at/2017/09/setting-up-collabora-code-with-nextcloud-using-apache-reverse-proxy-on-debian-8-jessie/. I have also installed the collabora app w/in my nextcloud instance and am able to create new documents w/o issue. However, when I try to open a document to edit in in the browser I get an endless loading circle or a blank screen. The nextcloud tools at the top still work - I am able to navigate back to my folders, or open another app. However, the body of the page (where I should be editing the doc) remains blank.

I have looked through a number of posts and tried to troubleshoot the issue myself.

First, when I go to the collabora subdomain /hosting/discovery - I get the XML that shows my reverse proxy is working, just like the second tutorial says. So I think that is all good.

However, when I check the docker logs I get the following:
WRN WOPI host did not pass optional access_token_ttl| wsd/FileServer.cpp:611
ERR Cannot get file info from WOPI storage uri…

Followed by a few more timeout errors.

Finally, when I use nslookup from the server to the collabora subdomain it shows it at 127.0.0.53 - when I do the same from within the collabora docker image (looking at my bare domain) it shows it at 8.8.8.8 (google’s name server).

I apologize for my naiveté, this kind of server admin is new to me and I am trying to learn as I go. From what I can see, it feels like there is a DNS issue between my collabora docker image and my Nextcloud instance. I feel like the answer is probably something simple, like an edit to /etc/hosts either on the server or the docker image, or even both. However, I am not finding the answer in my research and I don’t want to just start editing config files in hopes that I stumble upon the answer. Any guidance is greatly appreciated. Thank you for your help!

Well, I found the solution to my problem. I will post what I did here for anyone else that may stumble across this post. So, I did indeed need to add /etc/hosts entries for BOTH my collabora core container AND my ubuntu server running next cloud. Here is how I did it.

ifconfig

Now take the inet address of your main network interface (usually eth0) and create your docker container with the --add-host flag this time (creating an /etc/hosts entry for your server hosting NC). Please note: the “domain=” below should have double backslashes, but the block quotes is removing one for some reason. See the how-to for how I installed collabora code here.

sudo docker run -t -d -p 127.0.0.1:9980:9980 -e ‘domain=nextcloud\.your-domain\.com’ --add-host=nextcloud.your-domain.com:inetAddrFromEarlier --restart always --cap-add MKNOD collabora/code

Now your container will be able to talk to your next cloud. Finally, you need to get the inet for your docker container (mine was named docker0) and add it to your ubuntu’s /etc/hosts

ifconfig

sudo nano /etc/hosts

Add the line “inetAddrOfDocker office.your-domain.com” (or whatever subdomain you assigned for your collabora core).

I hope this helps anyone who was lost like I was!