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

cURL error 6: Could not resolve host: www.googleapis.com #1184

Closed
irasmaster opened this issue Mar 22, 2017 · 16 comments
Closed

cURL error 6: Could not resolve host: www.googleapis.com #1184

irasmaster opened this issue Mar 22, 2017 · 16 comments
Assignees

Comments

@irasmaster
Copy link

I get such exception trying to authenticate in Google-API:

GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: www.googleapis.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186
Stack trace:
#0 ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 ../vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 ../vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 ../vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 ../vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(72): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#6 ../vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#7 ../vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(68): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#8 ../vendor/guzzlehttp/guzzle/src/Middleware.php(57): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#9 ../vendor/guzzlehttp/guzzle/src/HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#10 ../vendor/guzzlehttp/guzzle/src/Client.php(275): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#11 ../vendor/guzzlehttp/guzzle/src/Client.php(96): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#12 ../vendor/guzzlehttp/guzzle/src/Client.php(104): GuzzleHttp\Client->sendAsync(Object(GuzzleHttp\Psr7\Request), Array)
#13 ../vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php(34): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request), Array)
#14 ../vendor/google/auth/src/OAuth2.php(492): Google\Auth\HttpHandler\Guzzle6HttpHandler->__invoke(Object(GuzzleHttp\Psr7\Request))
#15 ../vendor/google/apiclient/src/Google/Client.php(190): Google\Auth\OAuth2->fetchAuthToken(Object(Google\Auth\HttpHandler\Guzzle6HttpHandler))

@irasmaster
Copy link
Author

Resolved :)

@omarllorens
Copy link

@irasmaster Can you explain how did you fixed this error, please?

@go-yaro
Copy link

go-yaro commented Apr 20, 2017

@irasmaster i have a same error with you. can you talk more about the solution? thx

@irasmaster
Copy link
Author

@omarllorens @go-yaro In my case, it was a server problem. Puppet updated libc, after what apt should restart dependant services, including php-fpm, but it didn't. So solution was the script to restart PHP after every package update.

@omarllorens
Copy link

Thank you @irasmaster !

@go-yaro
Copy link

go-yaro commented Apr 25, 2017

@ianbarber it works for me. thank you.

@Paratron
Copy link

Paratron commented Jan 4, 2018

I had the same error today developing locally in a vagrant box.
Turns out the vagrant box had network issues after my machine went once to hibernate and back up. I restarted the vagrant instance end everything works fine again!

@masjoey
Copy link

masjoey commented Feb 22, 2018

just restart your server from whm

@ashley7
Copy link

ashley7 commented Dec 13, 2018

Just restart your server

@jrosell
Copy link

jrosell commented Jan 9, 2019

Just restart your server

You are right. Some system packages were updated but their related services were not restarted

@Simprosys-InfoMedia
Copy link

Hello, We are also getting Same Daily at the same time. So can you someone please help me how to resolver this permanently?

@ashley7
Copy link

ashley7 commented Feb 23, 2019

When I was on localhost, Some requests would return that error and sometimes they would pass and return results, but since I went live, I have never seen them, even the speeds increased

@Meenu-Jain
Copy link

I also restarted my server and it worked

@vicdecode
Copy link

Sometimes this happens when the nameservers for google are not set in your /etc/resolv.conf file. You can fix it by doing this: https://stackoverflow.com/questions/24967855/curl-6-could-not-resolve-host-google-com-name-or-service-not-known

@rdundon
Copy link

rdundon commented Dec 3, 2020

At the risk of being redundant, restarting also works when encountering this error in a docker instance.

@bfsim
Copy link

bfsim commented Jun 17, 2022

Had the same issue today. It was a VPN issue. Once ExpressVPN was disconnected: worked again!

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