[OnePlus 5 Questions & Answers] svartalf_info:
Hi!

My phone (OnePlus 5, OxygenOS 10.0.0 A5000_23_200601) is not able to connect to any of Google services with my home WiFi enabled: no push notifications (because Firebase is unreachable), Google Photos is not able to upload files, Gmail can't access mail and so on.

Errors usually look like this (courtesy of adb logcat *:W):

Please note that I redacted Google domain below a bit, because my newly created account is not allowed to post external links even if they are located inside of the code blocks.

11-19 08:22:06.391 22618 24103 E DG : FSC error [CONTEXT service_id=25 ]
11-19 08:22:06.391 22618 24103 E DG : java.net.SocketTimeoutException: failed to connect to www-dot-googleapis-dot-com/172.217.20.106 (port 443) from /192.168.1.212 (port 49231) after 30000ms
11-19 08:22:06.391 22618 24103 E DG : at libcore.io.IoBridge.connectErrno(IoBridge.java:191)
11-19 08:22:06.391 22618 24103 E DG : at libcore.io.IoBridge.connect(IoBridge.java:135)
11-19 08:22:06.391 22618 24103 E DG : at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:142)
11-19 08:22:06.391 22618 24103 E DG : at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
11-19 08:22:06.391 22618 24103 E DG : at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
11-19 08:22:06.391 22618 24103 E DG : at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
11-19 08:22:06.391 22618 24103 E DG : at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
11-19 08:22:06.391 22618 24103 E DG : at java.net.Socket.connect(Socket.java:621)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.Platform.connectSocket(Platform.java:182)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:145)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
11-19 08:22:06.391 22618 24103 E DG : at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
11-19 08:22:06.391 22618 24103 E DG : at wju.f(:com.google.android.gms@204217037@20.42.17 (120400-342117392):6)
11-19 08:22:06.391 22618 24103 E DG : at wju.b(:com.google.android.gms@204217037@20.42.17 (120400-342117392):1)
11-19 08:22:06.391 22618 24103 E DG : at wll.c(:com.google.android.gms@204217037@20.42.17 (120400-342117392):1)
11-19 08:22:06.391 22618 24103 E DG : at wll.b(:com.google.android.gms@204217037@20.42.17 (120400-342117392):0)
11-19 08:22:06.391 22618 24103 E DG : at com.google.android.gms.droidguard.DroidGuardChimeraService.c(:com.google.android.gms@204217037@20.42.17 (120400-342117392):30)
11-19 08:22:06.391 22618 24103 E DG : at com.google.android.gms.droidguard.DroidGuardChimeraService.a(:com.google.android.gms@204217037@20.42.17 (120400-342117392):4)
11-19 08:22:06.391 22618 24103 E DG : at com.google.android.gms.framework.tracing.wrapper.TracingIntentService.onHandleIntent(:com.google.android.gms@204217037@20.42.17 (120400-342117392):1)
11-19 08:22:06.391 22618 24103 E DG : at cua.handleMessage(:com.google.android.gms@204217037@20.42.17 (120400-342117392):0)
11-19 08:22:06.391 22618 24103 E DG : at android.os.Handler.dispatchMessage(Handler.java:107)
11-19 08:22:06.391 22618 24103 E DG : at android.os.Looper.loop(Looper.java:214)
11-19 08:22:06.391 22618 24103 E DG : at android.os.HandlerThread.run(HandlerThread.java:67)

11-19 08:32:45.929 27736 28293 W GetToken: [GetToken]GetToken failed with status code: NetworkError
11-19 08:32:45.930 27736 28293 W GLSActivity:
11-19 08:32:45.930 27736 28293 W GLSActivity: java.io.IOException: NetworkError
11-19 08:32:45.930 27736 28293 W GLSActivity: at gcu.getAuthToken(:com.google.android.gms@204217037@20.42.17 (120400-342117392):26)
11-19 08:32:45.930 27736 28293 W GLSActivity: at android.accounts.AbstractAccountAuthenticator$Transport.getAuthToken(AbstractAccountAuthenticator.java:246)
11-19 08:32:45.930 27736 28293 W GLSActivity: at android.accounts.IAccountAuthenticator$Stub.onTransact(IAccountAuthenticator.java:282)
11-19 08:32:45.930 27736 28293 W GLSActivity: at android.os.Binder.transact(Binder.java:925)
11-19 08:32:45.930 27736 28293 W GLSActivity: at cvi.onTransact(:com.google.android.gms@204217037@20.42.17 (120400-342117392):2)
11-19 08:32:45.930 27736 28293 W GLSActivity: at android.os.Binder.transact(Binder.java:925)
11-19 08:32:45.930 27736 28293 W GLSActivity: at aavk.onTransact(:com.google.android.gms@204217037@20.42.17 (120400-342117392):17)
11-19 08:32:45.930 27736 28293 W GLSActivity: at android.os.Binder.execTransactInternal(Binder.java:1032)
11-19 08:32:45.930 27736 28293 W GLSActivity: at android.os.Binder.execTransact(Binder.java:1005)
11-19 08:32:45.951 22717 12770 E PlayCommon: [15900] fsg.i: Failed to get auth token: java.io.IOException: NetworkError
11-19 08:32:45.951 22717 12770 W PlayCommon: [15900] fsg.d: Deferring log upload because couldn't retrieve auth token

11-19 08:37:42.728 28076 28923 W ConnectionTracker: Exception thrown while unbinding
11-19 08:37:42.728 28076 28923 W ConnectionTracker: java.lang.IllegalArgumentException: Service not registered: lp@8d02cb9
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1766)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at android.app.ContextImpl.unbindService(ContextImpl.java:1810)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at android.content.ContextWrapper.unbindService(ContextWrapper.java:741)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204217081@20.42.17 (120400-0):1)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204217081@20.42.17 (120400-0):2)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at lq.D(:com.google.android.gms.dynamite_measurementdynamite@204217081@20.42.17 (120400-0):10)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at lc.a(:com.google.android.gms.dynamite_measurementdynamite@204217081@20.42.17 (120400-0):2)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at ee.run(:com.google.android.gms.dynamite_measurementdynamite@204217081@20.42.17 (120400-0):3)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
11-19 08:37:42.728 28076 28923 W ConnectionTracker: at ix.run(:com.google.android.gms.dynamite_measurementdynamite@204217081@20.42.17 (120400-0):6)

Yet, I can reach these addresses with adb shell (also tested via Termux):

$ adb shell

OnePlus5:/ $ ping www-dot-googleapis-dot-com
PING www-dot-googleapis-dot-com (216.58.214.10) 56(84) bytes of data.
64 bytes from lhr26s05-in-f10.1e100.net (216.58.214.10): icmp_seq=1 ttl=118 time=5.57 ms
64 bytes from lhr26s05-in-f10.1e100.net (216.58.214.10): icmp_seq=2 ttl=118 time=23.9 ms

OnePlus5:/ $ ping 172.217.20.106
PING 172.217.20.106 (172.217.20.106) 56(84) bytes of data.
64 bytes from 172.217.20.106: icmp_seq=1 ttl=117 time=24.4 ms
64 bytes from 172.217.20.106: icmp_seq=2 ttl=117 time=22.6 ms

OnePlus5:/ $ ip route
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.212

Other thing that can be spotted often in logs is this thing, but I'm not sure if it is related:

11-19 08:31:32.481 693 27728 E getaddrinfo: android_getaddrinfofornetcontext: explore_numeric: ai_family=10 ai_socktype=1 ai_protocol=6
11-19 08:31:32.481 693 27728 E getaddrinfo: explore_numeric_scope
11-19 08:31:32.481 693 27728 E getaddrinfo: explore_numeric_scopehostname: s
11-19 08:31:32.481 693 27728 E getaddrinfo: explore_numeric_scopecp is NULL
11-19 08:31:32.481 693 27728 E getaddrinfo: android_getaddrinfofornetcontext: explore_numeric: ai_family=2 ai_socktype=1 ai_protocol=6
11-19 08:31:32.481 693 27728 E getaddrinfo: explore_numeric_scope
11-19 08:31:32.481 693 27728 E getaddrinfo: explore_numeric_scopehostname: s
11-19 08:31:32.481 693 27728 E getaddrinfo: explore_numeric_scopescoped does not exist
11-19 08:31:32.481 693 27728 E getaddrinfo: android_getaddrinfofornetcontext: explore_fqdn(): ai_family=0 ai_socktype=1 ai_protocol=6
11-19 08:31:32.482 693 27728 E getaddrinfo: res_queryN: (1, 1)
11-19 08:31:32.482 693 27728 E res_send: res_nsend
11-19 08:31:32.482 693 27728 E res_send: res_nsend: Querying server (# 1) address = 192.168.1.11
11-19 08:31:32.482 693 27728 E res_send: res_nsend: using send_dg
11-19 08:31:32.482 693 27728 E res_send: send_dg: new DG socket
11-19 08:31:32.482 693 27728 E res_send: get_timeout: using timeout of 5000 msec
11-19 08:31:32.483 693 27728 E res_send: retrying_poll: 46 retrying_poll
11-19 08:31:32.529 693 27728 E res_send: retrying_poll: 46 retrying_poll returning 1
11-19 08:31:32.529 693 27728 E res_send: res_nsend: using send_dg
11-19 08:31:32.529 693 27728 E res_send: res_nsend: got answer:
11-19 08:31:32.530 693 27728 E ResolverController: No valid NAT64 prefix (480, <unspecified>/0)

I have two suspects here, but I have no idea how exactly they can affect Android:

1. I have local Unbound DNS resolver instance for caching DNS responses and blocking bad domains. Yet, www-dot-googleapis-dot-com (once again, domain redacted) can be resolved via adb shell

2. I have two routers installed, ISP router is connected to the last mile and my router is connected to the first one. Unfortunately, I can't set ISP router into the bridge mode, maybe I need to set up some port forwarding in case if Google knocks back for some reasons?

Does anyone have any ideas what is the problem here?