TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
30.2k stars 2.97k forks source link

NewPipe doesn't fallback to IPv4 when IPv6 fails #11141

Open arkkito opened 1 month ago

arkkito commented 1 month ago

Checklist

Affected version

0.27.0

Steps to reproduce the bug

1 - Open NewPipe 2 - Nothing Loads, a loading circle just keep spinning

Expected behavior

Videos, and feeds load.

Actual behavior

Nothing Loads, a loading circle just keep spinning

Screenshots/Screen recordings

No response

Logs

No response

Affected Android/Custom ROM version

Android 14

Affected device model

Samsung A52

Additional information

NewPipe is working fine on mobile data, when I switch to Wi-Fi nothing works. Videos/Channels/Feeds, just don't load. Official YouTube client works on Wi-Fi, so does YouTube's website. I tried to load sound cloud from NewPipe and got the same behavior. If you need any logs, let me know what logs, and where to get them.

EDIT: I just noticed something. I have no IPv6 connectivity on my Wi-Fi. Meaning I get a IPv6 public address (android grabs 2 with SLAAC), but my ISP is not forwarding any IPv6 packets, they are all dropped. My mobile data network doesn't have IPv6, I suspect this is why I can connect using mobile data and not Wi-Fi.

I am suspecting NewPipe doesn't fall back to IPv4 connection if IPv6 fails? Or does it take a very long time to do it? EDIT: If I disable IPv6 in my router, NewPipe works fine. It seems confirmed NewPipe doesn't change back to IPv4, if IPv6 drops all the packets. I guess this is not the most "normal" situation, but other apps seem to be able to handle it.

opusforlife2 commented 1 month ago

There have been issues in the past mentioning IPv4 vs IPv6. Yours is the first one, I think, that has nothing to do with network switching, but different addresses on the same network.

arkkito commented 1 month ago

I suppose is not expected to have a configured public IPv6, and then have no internet on it, would be the same as having no internet on IPv4. My ISP is still deploying IPv6, is not something that they are officially offering yet. But so far, NewPipe is the only APP that I use that doesn't seem to switch back to IPv4, but I assume there are probably more.

opusforlife2 commented 1 month ago

I wonder if it's a bug in Okhttp.

lf- commented 1 month ago

I have also reproduced this after accidentally leaving DHCPv6 configured on my router with public addresses but no actual connectivity.

arkkito commented 1 month ago

to help reproduce this issue, I think the problem only occurs if the DNS server servers both AA and AAA records. I recently tried in a network behind Fortigate, Android configured IPv6 address, but there was no connectivity over IPv6, but the DNS server didn't serve any AAAA records. NewPipe works good in this scenario. I guess is obvious, if the dns retrieves only A records it will never connect to a IPv6 address, just reporting it for completeness and easiness to reproduce.