termux-pacman/glibc-packages

[Bug]: DNS and general networking problems

Closed this issue · 6 comments

Problem description

Networking and in general, any application that needs to make a network requests hangs/fail.

Ex: curl google.com
-> DNS cannot be resolved.

Ex: pip
-> Install any package, it does not seem to work, and just hangs.

Ex: openssl
-> openssl s_client hangs

I have looked at #196 [hosts and resolv.conf file exists on my system, it still fails], and #6 [tried everything, still does not work].

The packages installed [using apt after installing glibc-repo] were glibc-runner, openssl-glibc, python-pip-glibc, libcurl-glibc and none of their static libs.

I am wondering if this is a bug or something with my machine setup.

System information

termux-info:

Termux Variables:
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=19333
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirror.mwt.me/termux/main stable main
# x11-repo (sources.list.d/x11.list)
deb https://mirror.mwt.me/termux/x11 x11 main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# glibc-repo (sources.list.d/glibc.list)
deb https://packages-cf.termux.dev/apt/termux-glibc/ glibc stable
Updatable packages:
libltdl/stable 2.4.7-4 aarch64 [upgradable from: 2.4.7-2]
libtool/stable 2.4.7-4 aarch64 [upgradable from: 2.4.7-2]
termux-tools version:
1.42.1
Android version:
14
Kernel build information:
Linux localhost 5.10.168-android12-9-27940245-abX800XXS6CXB4 #1 SMP PREEMPT Mon Feb 19 10:59:21 UTC 2024 aarch64 GNU/Linux
Device manufacturer:
samsung
Device model:
SM-X800
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=
Installed termux plugins:
com.termux.x11 versionCode:14

Run the following command to make sure that you have all the files to work with the Internet:

ls -l /data/data/com.termux/files/usr/glibc/etc/hosts
ls -l /data/data/com.termux/files/usr/glibc/etc/resolv.conf
ls -l /data/data/com.termux/files/usr/glibc/etc/ssl/cert.pem
llrwxrwxrwx 1 u0_a370 u0_a370 57 May 18 04:26 /data/data/com.termux/files/usr/glibc/etc/hosts -> /data/data/com.termux/files/usr/etc/hosts
lrwxrwxrwx 1 u0_a370 u0_a370 47 May 18 04:07 /data/data/com.termux/files/usr/glibc/etc/resolv.conf -> /data/data/com.termux/files/usr/etc/resolv.conf
lrwxrwxrwx 1 u0_a370 u0_a370 29 Apr 25 15:44 /data/data/com.termux/files/usr/glibc/etc/ssl/cert.pem -> ../ca-certificates/cacert.pem

They all seem to be symlinked to system files, and system's curl, pip, and internet seem to work just fine.

Run the following command and then upload the glibc-runner-debug-strace-*.log file:

grun -d 4 -n curl google.com

I didn't find anything in the log that could indicate an error. Please make sure you have the following file installed by the resolv-conf package:

/data/data/com.termux/files/usr/etc/resolv.conf

Ok, so I checked my resolv.conf file, and it seems the problem was the down DNS servers listed. I forgot that updating the DNS on Android does not update the resolv.conf file on Termux.

After changing the DNS servers to the correct, updated IPs, it seemed to work.

However, I do wonder why Termux (mine and a docker Termux I was testing) in standard environment was working with non-functional resolv.conf servers but the glibc environment failed, though this may be for a different topic/issue.