Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redroid can't connect public network, but it can connect to host network #701

Open
peilin-liu opened this issue Jun 14, 2024 · 5 comments
Open

Comments

@peilin-liu
Copy link

peilin-liu commented Jun 14, 2024

redroid can't connect public networker, but it can connect to host network

some logs

root@orangepi5pro:# docker exec android_0 sh -c 'ping 172.17.0.1'
PING 172.17.0.1 (172.17.0.1) 56(84) bytes of data.
64 bytes from 172.17.0.1: icmp_seq=1 ttl=64 time=0.132 ms
64 bytes from 172.17.0.1: icmp_seq=2 ttl=64 time=0.117 ms
64 bytes from 172.17.0.1: icmp_seq=3 ttl=64 time=0.191 ms
^C
root@orangepi5pro:
# docker exec android_0 sh -c 'ping 39.156.66.10'
connect: Network is unreachable

root@orangepi5pro:~# adb connect 172.17.0.2:5555
error: device offline

make sure the required kernel modules present

root@orangepi5pro:# grep binder /proc/filesystems
nodev binder
root@orangepi5pro:
# grep ashmem /proc/misc
root@orangepi5pro:~#

It uses memfd to replace ashmem

Collect debug logs

06-14 10:00:13.817 827 2422 D NetworkMonitor/100: PROBE_DNS www.google.com 7ms FAIL in type ADDRCONFIG android.net.DnsResolver$DnsException: android.system.ErrnoException: resNetworkQuery failed: ENONET (Machine is not on the network)
06-14 10:00:13.818 827 2423 D NetworkMonitor/100: PROBE_DNS connectivitycheck.gstatic.com 8ms FAIL in type ADDRCONFIG android.net.DnsResolver$DnsException: android.system.ErrnoException: resNetworkQuery failed: ENONET (Machine is not on the network)
06-14 10:00:13.821 177 2424 I resolv : GetAddrInfoHandler::run: {100 983140 100 983140 1073 1}
06-14 10:00:13.823 827 2422 D NetworkMonitor/100: PROBE_HTTPS https://www.google.com/generate_204 Probe failed with exception java.net.UnknownHostException: Unable to resolve host "www.google.com": No address associated with hostname
06-14 10:00:13.824 177 2425 I resolv : GetAddrInfoHandler::run: {100 983140 100 983140 1073 1}
06-14 10:00:13.826 827 2423 D NetworkMonitor/100: PROBE_HTTP http://connectivitycheck.gstatic.com/generate_204 Probe failed with exception java.net.UnknownHostException: Unable to resolve host "connectivitycheck.gstatic.com": No address associated with hostname
06-14 10:00:13.831 177 2426 I resolv : GetAddrInfoHandler::run: {100 983140 100 983140 1073 1}
06-14 10:00:13.832 827 2421 D NetworkMonitor/100: PROBE_FALLBACK http://play.googleapis.com/generate_204 Probe failed with exception java.net.UnknownHostException: Unable to resolve host "play.googleapis.com": No address associated with hostname
06-14 10:00:13.833 827 2421 D NetworkMonitor/100: isCaptivePortal: isSuccessful()=false isPortal()=false RedirectUrl=null isPartialConnectivity()=false Time=25ms
06-14 10:00:13.835 237 602 D ConnectivityService: [100 ETHERNET] validation failed
06-14 10:00:39.300 177 203 E Netd : Failed to dump IPv4 sockets struct tcp_info: No such file or directory
06-14 10:00:39.300 177 203 E TcpSocketMonitor: Failed to poll TCP socket info: No such file or directory
06-14 10:01:00.007 92 92 D hwcomposer: VSYNC event status:1
06-14 10:01:00.033 92 104 D hwcomposer: hw_composer sent 12 syncs in 119s

root@orangepi5pro:~# curl -fsSL https://raw.githubusercontent.com/remote-android/redroid-doc/master/debug.sh | sudo bash -s -- android_0
Collecting, please wait...
RTNETLINK answers: Operation not supported on transport endpoint
Dump terminated
Error: argument "eth0" is wrong: table id value is invalid

Screenshots**

nothing

other logs

root@orangepi5pro:~# curl -fsSL https://raw.githubusercontent.com/remote-android/redroid-doc/master/debug.sh | sudo bash -s -- android_0
Collecting, please wait...
RTNETLINK answers: Operation not supported on transport endpoint
Dump terminated
Error: argument "eth0" is wrong: table id value is invalid

debug data

redroid-debug.L9nyMPmz.gz

@zhouziyang
Copy link
Member

There are many network probe failures. Did the default DNS server (8.8.8.8) accessible?

@peilin-liu
Copy link
Author

peilin-liu commented Jun 15, 2024

There are many network probe failures. Did the default DNS server (8.8.8.8) accessible?

I forgot to mention that Docker uses cgroup v2.

ping 8.8.8.8. It works well on the host。

root@orangepi5pro:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=12.8 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=17.0 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=55 time=20.0 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=55 time=18.4 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=55 time=20.0 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 12.779/17.619/19.973/2.664 ms

root@orangepi5pro:~# telnet 8.8.8.8 53
Trying 8.8.8.8...
Connected to 8.8.8.8.
Escape character is '^]'.
‘^]
telnet> ls
?Invalid command
telnet>

@peilin-liu
Copy link
Author

There are many network probe failures. Did the default DNS server (8.8.8.8) accessible?

Some potentially useful information:

2ce46b870a06:/ # logcat | grep -A 20 'iptables' | head -n 20
06-14 18:05:37.534 177 844 E IptablesRestoreController: iptables error:
06-14 18:05:37.534 177 844 E IptablesRestoreController: ------- COMMAND -------
06-14 18:05:37.534 177 844 E IptablesRestoreController: *filter
06-14 18:05:37.534 177 844 E IptablesRestoreController: -nvx -L tetherctrl_counters
06-14 18:05:37.534 177 844 E IptablesRestoreController: COMMIT
06-14 18:05:37.534 177 844 E IptablesRestoreController: ------- ERROR -------
06-14 18:05:37.534 177 844 E IptablesRestoreController: iptables-restore v1.8.7 (legacy): iptables-restore: unable to initialize table 'filter'
06-14 18:05:37.534 177 844 E IptablesRestoreController:
06-14 18:05:37.534 177 844 E IptablesRestoreController: Error occurred at line: 1
06-14 18:05:37.534 177 844 E IptablesRestoreController: Try `iptables-restore -h' or 'iptables-restore --help' for more information.
06-14 18:05:37.534 177 844 E IptablesRestoreController: ----------------------

@peilin-liu peilin-liu changed the title redroid can't connect public networker, but it can connect to host network redroid can't connect public network, but it can connect to host network Jun 16, 2024
@zhouziyang
Copy link
Member

zhouziyang commented Jun 25, 2024

From logcat.txt, something wrong with networking.

06-14 09:43:09.285   177  1037 W resolv  : Validating DnsTlsServer 8.8.8.8 with mark 0xf0064                                
06-14 09:43:09.285   237   311 D CompatibilityChangeReporter: Compat change id reported: 161252188; UID 10066; state: DISABL
06-14 09:43:09.285   177  1037 W resolv  : Socket failed to connect: Network is unreachable                                 
06-14 09:43:09.285   177  1037 W resolv  : TCP Handshake failed: 101                                                        
06-14 09:43:09.285   177  1037 W resolv  : query failed                                                                     
06-14 09:43:09.285   177  1037 W resolv  : validateDnsTlsServer returned 0 for 8.8.8.8                                      
06-14 09:43:09.285   177  1037 W resolv  : Validation failed                                                                
...
06-14 09:43:13.311   827  1821 D NetworkMonitor/100: PROBE_HTTP http://connectivitycheck.gstatic.com/ge
to resolve host "connectivitycheck.gstatic.com": No address associated with hostname                   
06-14 09:43:13.311   827  1820 D NetworkMonitor/100: PROBE_HTTPS https://www.google.com/generate_204 Pr
st "www.google.com": No address associated with hostname                                               
06-14 09:43:13.313   237   760 D CompatibilityChangeReporter: Compat change id reported: 229362273; UID
06-14 09:43:13.314   177  1824 I resolv  : GetAddrInfoHandler::run: {100 983140 100 983140 1073 1}     
06-14 09:43:13.314  1686  1761 I BinaryDictionaryFileDumper: reinitializeClientRecordInDictionaryConten
06-14 09:43:13.315   827  1819 D NetworkMonitor/100: PROBE_FALLBACK http://play.googleapis.com/generate
olve host "play.googleapis.com": No address associated with hostname                                   
06-14 09:43:13.316   827  1819 D NetworkMonitor/100: isCaptivePortal: isSuccessful()=false isPortal()=f
06-14 09:43:13.316   237   602 D ConnectivityService: [100 ETHERNET] validation failed                 

and route table for eth0 is empty (check network.txt).

@peilin-liu
Copy link
Author

DnsTlsServer

The possible reason is that it is necessary to incorporate some Android kernel code to support iptables quota2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants