Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal: unable to access <link> getaddrinfo() thread failed to start

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?

like image 398
Tanishq Vyas Avatar asked Jan 25 '20 17:01

Tanishq Vyas


4 Answers

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.

like image 191
Flavio Aparecido Ribeiro Avatar answered Nov 19 '22 04:11

Flavio Aparecido Ribeiro


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
like image 42
Jannes Van Ussel Avatar answered Nov 19 '22 03:11

Jannes Van Ussel


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.

like image 3
Mike Avatar answered Nov 19 '22 04:11

Mike


$ 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 !!

like image 1
fanqie Avatar answered Nov 19 '22 02:11

fanqie