Federated Sharing not working: cURL error 28

I try to share a folder with another user/nextcloud. We both have enabled:

  • Allow users on this server to send shares to other servers

  • Allow users on this server to receive shares from other servers

  • Add server automatically once a federated share was created successfully

When I add the user of the other nextcloud in sharing with this syntax:


Nextcloud stops working. Cannot open Apps or Activity … have to restart browser.


Opens the login screen of his Nextcloud. So connection should be working.

After that I try to add his server into “Trusted Nextcloud Servers” in section Federation in Admin panel with this error result:

cURL error 28: Connection timed out after 3000 milliseconds

Any idea??? :worried:

That is often a problem with your DNS server. You can measure the time to see if it is really the nameserver which delays the process:

Is this your own server? You could install your own DNS resolver which is probably faster and caches entries. Unbound is a very small light-weight solution.

Yes. My DNS server is my Fritz/Box. Never had problems here.

$ curl -4 -v --trace-time https://DOMAIN:PORT/nextcloud/

 12:04:55.964641 *   Trying 174.129.145.xxx...
 12:07:03.252478 * connect to 174.129.145.xxx port PORT failed: Connection timed out
 12:07:03.252723 * Failed to connect to DOMAIN port PORT: Connection timed out
 12:07:03.252778 * Closing connection 0
 curl: (7) Failed to connect to DOMAIN port PORT: Connection timed out

My friend successfully shared an folder for my federated NC-user. On his site everything seems okay.

But I don’t receive any shared folder from him …

My friend gets this result. So the error seems to be on my installation:

curl -4 -v --trace-time https://MYDOMAIN
12:15:49.149555 * Rebuilt URL to: https://MYDOMAIN/
12:15:49.210663 *   Trying 87.162.247.xxx...
12:15:49.261871 * Connected to MYDOMAIN (87.162.247.xxx) port 443 (#0)

On my site:

Trying 174.129.145.xxx...
Trying fe80:3::225:90ff:fe19:xxxx...
telnet: Unable to connect to remote host: Invalid argument

Do we need to open his port PORT (8082) somewhere?

It’s not your DNS. In your case the connection cannot be opened. A firewall is very likely the cause of this. So if your friend is behind a router, you need to forward the port of his setup (on his router). Can you open his webinterface on your browser?

Indeed it is his DNS, delivering the wrong IP address.

Yes, I can.

But I think, we found the issue: My NC-server has a DNS problem. It gets always other (wrong) IPs for the domain of my friend. Not so on another client in my network here behind my Fritz!Box.

I’m using the VM from techandme.se.

DNS entries are usually cached for some time. In Ubuntu you can flush the cache:
sudo /etc/init.d/dns-clean
You FritzBox-DNS could cache them as well (and the DNS server your FritzBox gets the entry from).

As a temporary solution (until the DNS is fixed and all caches are cleared, ~1 day), you can edit your /etc/hosts-file and put there:
a.b.c.d your.friend.com
a.b.c.d is the ip address, and your.friend.com the hostname.

Thanks, that works for now. Have to investigate more later … now I go swimming! :blush:

So, I’m the guy at the other side of this test.
While @hustenfrei got it to work with the /etc/hosts workaround and he successfully got my shared folder, I’m unable to see his shared folder. No notification in Nextcloud for me. But I can see the following error in my logfile:

Exception: {“Message”:“HTTP/1.1 401 No ‘Authorization: Basic’ header
found. Either the client didn’t send one, or the server is
[internal function]:
call_user_func_array(Array, Array)\n#2
Sabre\Event\EventEmitter->emit(‘beforeMethod’, Array)\n#3

Searching the web for the error, it seems like a problem with PHP7,.but to my knowledge Nextcloud should work with PHP7.
I successfully added his Server to my trusted Nextcloud-Servers and also I successfully was able to share one of my folders with him.

Any ideas?