When I type: git push origin master
Error :
fatal: unable to access 'https://github.com/<github-username>/<repository-name>.git/': getaddrinfo() thread failed to start
What do I do?
I had the same problem, I tried several solutions until I found out that in my case it was the firewall. Mine was the "Free Firewall", I noticed that even authorizing the software and connections it was still not possible to have a connection to the remote repository. I disabled it and it didn't solve it, only when I uninstalled it that the problem was solved and I was able to use Git normally.
Same issue on my machine (git version 2.28.0.windows.1). The problem seems to be related to DNS resolution of HTTP-requests:
This was my original remote url:
git remote set-url origin http://<FQDN>:<http_port>/<repository>.git
With the same result as in the question:
$ git pull
fatal: unable to access 'http://<FQDN>:<http_port>/<repository>.git/': getaddrinfo() thread failed to start
When changing the URL to the resolved IP:
$ ahost <FQDN>
<FQDN> <IP>
$ git remote set-url origin http://<IP>:<http_port>/<repository>.git
Git connects without issue:
$ git pull
Already up to date.
Also, when using SSH instead of HTTP there is no issue with the resolution:
$ git remote set-url origin ssh://<username>@<FQDN>:<ssh_port>/<repository>.git
$ git pull
Already up to date.
Curl also doesn't work in my MINGW64 environment:
$ ahost www.google.com
www.google.com 172.217.2.100
$ adig www.google.com
id: 64322
flags: qr rd ra
opcode: QUERY
rcode: NOERROR
Questions:
www.google.com . A
Answers:
www.google.com . 49 A 172.217.2.100
NS records:
Additional records:
$ curl www.google.com -v
* getaddrinfo() thread failed to start
* Couldn't resolve host 'www.google.com'
* Closing connection 0
curl: (6) getaddrinfo() thread failed to start
If you have any antivirus or firewall installed into the system, either turn off the git access or uninstall completely and restart. I faced the same issue and uninstalled the firewall. It worked just fine.
$ git remote set-url origin http://<IP>:<http_port>/<repository>.git
or
$ git remote set-url origin ssh://<username>@<FQDN>:<ssh_port>/<repository>.git
My problem is solved using above the way !!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With