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

Dail TCP Lookup Connection Error #1138

Closed
mskian opened this issue May 20, 2019 · 12 comments
Closed

Dail TCP Lookup Connection Error #1138

mskian opened this issue May 20, 2019 · 12 comments

Comments

@mskian
Copy link

mskian commented May 20, 2019

I am running a CLI based on Golang
While trying to connect any URLs I got this Below Error

Error: Get https://google.com/version: dial tcp: lookup google.com on [::1]:53: read udp [::1]:48773->[::1]:53: read: connection refused
@ghost
Copy link

ghost commented May 20, 2019

Is your program compiled with GOOS=android ?
Golang programs compiled for target "linux" will have problems with DNS resolver and should be recompiled for Android in order to be usable in Termux.

@mskian
Copy link
Author

mskian commented May 20, 2019

DNS Resolver is 8.8.8.8
CLI I am Installing - https://github.com/gotify/cli
Worked on Ubuntu system but not in Termux

@ghost
Copy link

ghost commented May 20, 2019

DNS Resolver is 8.8.8.8

This not a DNS resolver !
DNS resolver is part of code that handles DNS queries. Typically handled via CGO calls to C library: GNU libc on Linux and Bionic on Android. They are incompatible.

Note that static linking of the executable does not have any effect. Resolver from GNU libc always used via dlopen(). That is why it works in Ubuntu but not in Termux.

@mskian
Copy link
Author

mskian commented May 20, 2019

@xeffyr Any Solution for this?

@ghost
Copy link

ghost commented May 20, 2019

If CGO was disabled at build time, binary will look for file /etc/resolv.conf. In such case you should be able to run binary with termux-chroot from package proot (package resolv-conf may be needed too).

@ghost ghost closed this as completed May 20, 2019
@ghost
Copy link

ghost commented May 20, 2019

Perhaps it may be easier to recompile it on device. Do:

pkg install golang
go get github.com/gotify/cli

Binary "cli" will be available at ~/go/bin.

Other workarounds are not exist: either use binary in environment it was compiled for or recompile binary for Termux.

@mskian
Copy link
Author

mskian commented May 20, 2019

termux-chroot
Connects the URL Successfully

but got this below error (Using Binary file arm64)

user: Current not Implemented on linux/arm64

@ghost
Copy link

ghost commented May 20, 2019

Current not Implemented on linux/arm64

Try to use a binary compiled specially for Termux/android: gotify-cli.gz (arm64).

@mskian
Copy link
Author

mskian commented May 21, 2019

Thanks let me try and Update

@mskian
Copy link
Author

mskian commented May 21, 2019

Thanks a lot, it's working

@mskian
Copy link
Author

mskian commented May 21, 2019

Perhaps it may be easier to recompile it on device. Do:

pkg install golang
go get github.com/gotify/cli

Binary "cli" will be available at ~/go/bin.

Other workarounds are not exist: either use binary in environment it was compiled for or recompile binary for Termux.

Follow this step working

@mvolfik
Copy link

mvolfik commented Aug 14, 2021

Hello, I'm trying to compile netlify/netlify-credential-helper, which doesn't provide a binary for Android. By modifying makefile I managed to build for os=android arch=arm64 and re-enable CG0, so I stopped getting errors on resolve, but now I'm getting the error &{0 } (*models.Error) is not supported by the TextConsumer, can be resolved by supporting TextUnmarshaler interface. I'm not a Go programmer - anyone has an idea what this could mean and if it's fixable? Should I create a new issue (and if so, here or in their repo?)? Thanks a lot!


EDIT: Nevermind, it seems that this error was caused by error in their code, which got triggered by me not being logged in with netlify cli. All works now 🎉

@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants