Android App: Server unavailable

I am using Nextcloud for years now without major trouble. Thanks a lot for the good work.

But recently, my android client app fails to connect to the server, if I am outside my home network. I am not aware of a change in between, though watchtower may have made a minor release update in docker or Google’s play store may have installed a new client version.

My setup is roughly:

  • Home server in my own network
  • Routing to the internet is done via AVM Fritz!Box
  • I have working IPv4 and IPv6 connection to the internet
  • I have dynamic DNS resolving for IPv4 and IPv6
  • Nextcloud is run as a docker image in version 21, I use traefik as a reverse proxy

When I am in my network, the app finds the server and syncs without any trouble. Outside, it does not work (server unavailable) - not on my phone, not on a tablet. In this case, there seems to be nothing in the logs of the Nextcloud image (docker logs), so Nextcloud does not even seem to find the server.

Trying to register a new account leads to the error message, that the server could not be found.

Strange thing is: Nextcloud is reachable via browser in this case. DAVx5 can do calendar and contact syncs as well. It is just Nextcloud app that cannot find the server. Strange.

Some months ago, I did a factory reset of the phone and reinstalled Nextcloud. It worked even outside Wi-Fi then.

Any ideas?

I had a similar problem, in my case it was unreachable as soon as i connected to certain WIFI-networks but accessible from the mobile network and some public or work wifi’s, i also did not see any connection attempts in the logs. It turned out this was a ipv6 issue, meaning the port forwarding was not working properly, when trying to access via an ipv6 address. Maybe try accessing your nextcloud using the public ipv6 address of your router for once, e.g. [your:ipv:6:address:1234]/nextcloud and seen whether this works (alternatively try the test-netconnection function in some windows power-shell). Your problem-description sinds a little different than mine, but it would be an easy try.

Thanks so far @Pillaknuff. Seems this points me into a good direction. For some reason, that I still have to figure out, ipv6 resolution does not seem to be updated. And even if it would, under the right ipv6 address my router box gets in and offers its own login (which so far it hasn’t and is not activated).

Looks like other services prefer the ipv4 stack.

I will investigate further and document into this thread if I find out why all this happens (and did not earlier).

OK, my thought wasn’t correctly. Actually, port forwarding seems to be fine. My Fritzbox uses the server’s ipv6 address correctly by default.

So currently I have a CNAME on a myfritz address, which resolves to the ipv6 address of the target host. Port “forwarding” is configured for both the HTTP and the HTTPS port. When I just made a DNS lookup I get the right ipv6 address of my homeserver’s ethernet interface.

But, If I try to open directly the ipv6 address, there will be an error message even in my browser that this address could not be reached. Again, ipv4 works nicely.

So my next guess would be docker. Does docker work with ipv6? Does it have to be configured seperately?

The cause was indeed a bug in the docker daemon. Version 20.10.2 (default, e.g. in Ubuntu 21.04) didn’t open ipv6 ports. An updated version is now available. Ubuntu also delivers an updated version 20.10.7. After updating, Nextcloud again works with ipv6.