Android: Client requests garbage domains

Created on 10 Jul 2020  Â·  17Comments  Â·  Source: nextcloud/android

Steps to reproduce

  1. Use the Android client for some time with a locally served domain name and a self-signed certificate
  2. After some time client begins to request garbage domain names instead of the configured one (affects Nextcloud client as well as DAVx5-Client)
  3. After reconnecting the Wi-Fi the domain requests are back to normal

Expected behaviour

Client should continue using the nextcloud domain name

Actual behaviour

Client starts using domain names like "tasdjfcnor", "ktisqrrnvx" or "rowlfjsxmakxq" (observable via DNS server Pi-Hole)

Can you reproduce this problem on https://try.nextcloud.com?

Since this problem is not really reproducable and sometimes runs well for several days it's not possible to try with a demo instance, because the accounts gets deleted after 60 minutes.

Environment data

Android version:10 QKQ1.190828.002

Device model: Pocophone F1

Stock or customized system: Stock MIUI Global 11.0.8.0 (QEJMIXM)

Nextcloud app version: 3.12.1

Nextcloud server version: 19.0.0

Reverse proxy: none

Logs

Web server error log

no error log available since the server is not reached via the garbage domain names

Nextcloud log (data/nextcloud.log)

no error log available since the server is not reached via the garbage domain names
bug needs infdiscussion stale

Most helpful comment

It tries to connect to the other entries at the top of the screenshot. I have now deinstalled the NC app (and reluctantly brave browser) and will monitor, if the error occurs again with DAVx5 alone.

All 17 comments

The error occured again. Android status bar says "network failure - unable to resolve host "nextcloud.my.domain": no address associated with hostname.
But my DNS-Server doesn't even show a query from my phone. Does the NC app maybe start to use their own DNS server after a certain time and disrespect the DNS settings from DHCP? If I type nextcloud.my.domain into my mobile browser, everything works, so it seems to be a DNS issue with the NC app only.
Can I provide you with additional information?

No, we do not have an own dns server, but only rely on Android.

What is the correct one? And what is the wrong one?
You can anonymize it, just so that I have an idea what the difference is.

So far I only discovered that the DNS requests are not directed to my own DNS server (which is advertised via DHCP to all clients).
As soon as the error occurs again I will inspect the packages issued from my phone and try to find out which DNS server the requests are directed to.

It's complicated. At first there are no dns requests but then the garbage requests show up. I wasn't able to figure out if the client tries to query another dns server right before the garbage requests start, but I tend to doubt it.

I added a screenshot and hope that makes my issue a bit clearer:
garbage_domains

You see the correct request at the bottom of the screen (that was via the mobile browser) and then the garbage requests at the top (via the app).

I ran several tasks in my network today and during that I learned that the error occurs a lot more often under heavy network load or long latency dns answers (due to the server being busy). So maybe the network delay is a starting point for a bug hunt.

What does make you think that this is coming for NC client?
This could also be any other app / website on your phone, or?

I can't tell which app causes the problem, but since this only happens for NC, I wanted to start the search here. As a matter of fact, only NC related services stop working when this error happens: NC client app and DAVx5 sync of addressbooks and calendars.
I don't know how the DAVx5 is related to the NC app. So yeah, maybe it's something else inside the Android system, but why is it only related to the NC domain name?

but why is it only related to the NC domain name?

Where do you see this?

First, because no other app seems to have problems with the internally served dns names. Although I have to admit that the rest of the internal services are used via browser and not an app. And second, I can see no other garbage entries for my phone in the dns log other than the ones when I get the DAVx5 errors.
Are there any debug files that I can generate within the app and provide for further forensics?

If you suspect that it is DavX5, please ask them.
I think I remember that you can have some logs within their app.
A quick search reveils that "no-thanks.invalid" and brave.com seem to be related to the brave browser.

I would suggest that you remove NC app for testing purpose and see if this still occurs.
As this might be indeed related to DavX5 and/or Brave browser, I suspect that it will still happen.

If not, then please re-open the issue and we can try to hunt it down within NC app.

The brave requests have nothing to do with this issue as it already occured before that browser was installed.
And although I might repeat myself, the NC app also stops working (error message: "Server not found") when this error occurs, so it's not related to DAVx5 only.
But thanks for trying to dig into the problem. Not.

And although I might repeat myself, the NC app also stops working (error message: "Server not found")

well, this is new to me. At least the "server not found" thing.

From your screenshot, I see nextcloud……lan which is the correct entry, but which is the wrong domain it tries connect to?
Maybe this helps us…

It tries to connect to the other entries at the top of the screenshot. I have now deinstalled the NC app (and reluctantly brave browser) and will monitor, if the error occurs again with DAVx5 alone.

Well, here I am again.
Without the NC client, the error occured one or two times during the recent days, so we can conclude, that the client is not the cause for the requests.
However, DAVx5 did not complain once about not being able to sync. The changed behavior is significant. Next I will try using NC client but not DAVx5 and see, how that goes.

After less than I day the error is back in full bloom: DAVx5 complaining and NC app stating "server not available". This time without the garbage dns requests, though.
I switched to the F-Droid version of DAVx5 and will see, how that goes.

With the F-Droid version of DAVx5 I've only encountered the error once so far. Don't know if it's worth the hassle of digging into it, then. Seems to be related to DAVx5 in any way, but most of the time, it works now.
If you're interested in a bug hunt please tell me what to provide, or close this bug if you wish.

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tie-fighter picture Tie-fighter  Â·  3Comments

daywalk3r666 picture daywalk3r666  Â·  3Comments

AndyScherzinger picture AndyScherzinger  Â·  3Comments

JSoko picture JSoko  Â·  3Comments

JSoko picture JSoko  Â·  3Comments