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

Can't login: getting 'cURL error 6: name lookup timed out' #268

Closed
camilodelvasto opened this issue Jan 14, 2017 · 9 comments
Closed

Can't login: getting 'cURL error 6: name lookup timed out' #268

camilodelvasto opened this issue Jan 14, 2017 · 9 comments

Comments

@camilodelvasto
Copy link

camilodelvasto commented Jan 14, 2017

Hey,

I was using the service and it was working fine, but then I started getting this error:

Notice: Trying to get property of non-object in /Users/camilodelvasto/Documents/nolte/proposal/wp-content/plugins/auth0/lib/WP_Auth0_LoginManager.php on line 294

THe auth0 log error shows:

WP_Auth0_Api_Client::get_token	http_request_failed	cURL error 6: name lookup timed out

and it doesn't allow me to log in or signup users. What can I do to fix it? Is it something related to my environment? Thanks for any help!

@camilodelvasto camilodelvasto changed the title Can't login Can't login: getting 'cURL error 6: name lookup timed out' Jan 14, 2017
@glena
Copy link
Contributor

glena commented Jan 14, 2017

Looks like it is related to your environment.

If you have SSH access in that server, try running curl -v https://your_account_name.auth0.com/testall (replace your_account_name by your account name). It should answer with an ok.

Also, you can check by accessing to the admin (if you add ?wle to the url it will show you the wordpress login form). Then go to the plugin configuration and under the basic tab, check if the domain is the correct one.

@camilodelvasto
Copy link
Author

Thanks @glena - I'm getting OK on the test, but I'm also seeing something different, perhaps it's related.

When I update the settings, I keep getting an admin notice saying The client id or secret is not valid. - I've checked the settings from my app and that hasn't changed. I've copied them several times and I just get the same notice. Any ideas? Thanks.

@camilodelvasto
Copy link
Author

Indeed it was related. I just rotated the secret and now I'm able to log in. Why did this happen?

@camilodelvasto
Copy link
Author

After not seeing this error in a while, I'm getting it again... I didn't change anything in the config, and the log shows the same:

WP_Auth0_Api_Client::get_token	http_request_failed	cURL error 6: name lookup timed out

I checked out the auth0 plugin settings and got the same upon save:

The client id or secret is not valid.

Is this related to the wp plugin? Or is it something with the auth0 service?

I'm baffled....

@glena
Copy link
Contributor

glena commented Jan 26, 2017

the cURL error 6: name lookup timed out looks like there is a timeout during the DNS lookup.

The The client id or secret is not valid. happens when the call to auth0 fails. can you add a var_dump($response);exit; before this line?
I would like to see the response.
https://github.com/auth0/wp-auth0/blob/master/lib/admin/WP_Auth0_Admin_Basic.php#L207

Also, can you check if the client_id and domain configured are the correct one?

There is no reason for auth0 to change the client configuration nor the plugin unless there is something on your site changing the configuration (for example, your deploy process restoring the database or something)

@camilodelvasto
Copy link
Author

@glena this is what I'm getting from the var_dump($response):

bool(false)

I double-checked the client configuration for the plugin, it all seems correct.... what could be the cause of it? Or better, what else can I do? Thanks a lot for your help @glena

@glena
Copy link
Contributor

glena commented Jan 26, 2017

so this is checking this: ( 200 !== (int) $response['response']['code'] ). Since $response === false, this is returning null $response['response']['code'] and this casting (int) $response['response']['code'] is returning 0 which is !== 200 (thank you very much PHP).

Do you see any row in the error log (the plugin error log) related to this? You should fine one with the WP_Auth0_Api_Client::get_token section. https://github.com/auth0/wp-auth0/blob/master/lib/WP_Auth0_Api_Client.php#L114

@camilodelvasto
Copy link
Author

The weird thing is that I stopped seeing the error altogether.... could it be something with my connection? As soon as I changed the location, the error dissapeared.

@glena
Copy link
Contributor

glena commented Jan 27, 2017

As I told you, that seems an issue during DNS lookup (unless there is something screwing with the plugin configuration so the domain is an invalid one in that moment). It could be your ISP, the router (or network infra in general), something wrong in the host (configuratoin, something conflicting with the network layer...). that is really weird.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
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

3 participants