Built-In CODE and DNS issues


I am running Nextcloud Hub 7 28.0.1 on a KVM server. Nextcloud is working fine, but I can’t get Nextcloud Office to work. I’ve installed the Built-In CODE app (don’t want to install my own Collabora server just yet), then the Nexcloud Office app. I get the following error:

ConnectException cURL error 28: Operation timed out after 45002 milliseconds with 0 bytes received

Sometimes I am also getting this error:

Failed to fetch the Collabora capabilities endpoint: ClientException Client error: GET (link)/apps/richdocumentscode/proxy.php?req=/hosting/capabilities resulted in a 404 Not Found

I read on a thread titled “Collabra online not able to connect to nextcloud server](Collabra online not able to connect to nextcloud server)” (sorry, can’t post more than 4 links as a new member) that it might be a DNS issue. I also found the following advice in nextcloud admin_manual/office/troubleshooting: “Make sure that the Nextcloud instance is able to reach itself using the same hostname that is used to access through the browser. You might want to add your Nextcloud domain to /etc/hosts to ensure the connectivity if DNS resolution doesn’t work for this: " cloud.yourdomain.com

My question is: How do I make sure that NC is ‘able to reach itself’?

I did also try to edit my etc/hosts file. According to the thread above, it says to remove, but the website says to ADD it! Which is it?

Here’s what my etc/hosts file looks like.

etc/hosts localhost localhost.localdomain
::1 localhost localhost.localdomain
my-ip mydomain.com server1 mydomain.com

I added the last line, and I’ve experimented with commenting out different lines, to no avail. Any help would be appreciated.

In case it helps, this is what Nextcloud system is listing:
Operating System: Linux 3.10.0-1160.71.1.el7.x86_64 x86_64
IPv6: ::1
PHP Version: 8.1.26


hi @hobbit3434 welcome to the forum :handshake:

The error shows DNS resolution fails for whatever reason. your “regular” DNS resolution fails to resolve the public fqdn of the server you need to add the FQDN+IP to /etc/hosts. the hosts file you posted looks good IMHO but the question is if your cloud is using this hosts file (or another one if this is a VM/container). As your system architecture is still unclear for me I can’t recommend you how to solve the issue.

basic troubleshooting would be to run curl https://<cloud.domain>/apps/richdocumentscode/proxy.php?req=/hosting/capabilities from the Nextcloud host/container/VM this is the step how Nextcloud learn the capabilities of the office server.

for general background information about the WOPI protocol and integration you might want to look at Collabora integration guide

Thanks wwe. When I run the curl you suggested, I get this:


Sorry for being such a noob, but what does this tell me?

One more piece of info: when I un-comment the localhost lines in etc/hosts and then re-run the curl you suggested, I get this:

curl: (51) Unable to communicate securely with peer: requested domain name does not match the server’scertificate.

So it seems the issue is with the security certificate. I’m using Sectigo, and my domain is showing as auto validated (green check). But maybe I should switch to Let’s Encrypt? Thanks.

this shows if you have access to the Collabora instance. /hosting/capabilities and expecially /hosting/discovery shows if the system is reachable and correctly reflects external hostname.

in this case you don’t reach the right system. you should point the hosts to the system where the right cert is installed (e.g. reverseproxy)