Login handler failed. CAUSE: Discovery requests failing for https://stattracker.uk.auth0.com

Hello,
I just deployed my NextJS application to an aws ECS cluster running in EC2. I created a production tenant and created all my keys for my environment. But I get this error -

Login handler failed. CAUSE: Discovery requests failing for https://stattracker.uk.auth0.com, outgoing request timed out after 5000ms

I have done some googling but can’t seem to see anything about this?

Any help would be great!

Hi @bradley.plater1

Welcome to the Auth0 Community!

Thank you for posting your question. First of all, can you check that the URL is set correctly? Assuming your configuration is set correctly, I would verify the network accessibility on the AWS ECS cluster. Do you use network policies or security groups that might restrict outbound HTTPS traffic? Can you manually check from the ECS environment if you can reach the Auth0 Discovery endpoint?

Thanks
Dawid

hi @dawid.matuszczyk I just checked my EC2 config and I am using a security group to manage the inbound and outbound traffic.
I have enabled all traffic inbound on port 80 and port 443. For both Ipv4 and Ipv6
and I have enabled all traffic outbound on all ports and protocols.

I can’t seem to ssh onto my ec2 instance so not able to verify the connection manually. But my SG rules indicate that it should be able to access

@dawid.matuszczyk just updated my EC2 config to allow ssh. Connected via SSH and pinged stattracker.uk.auth0.com and that was perfectly fine with 0% packet loss. My ec2 instance currently connects via http. Would creating a certificate and connecting via https possibly alleviate this issue?

@dawid.matuszczyk another update, I have updated my load balancer to have a certificate for my site making it https. I am still getting the same error. Any help would be greatly appreciated. Not sure what else to check or do.

Hi @bradley.plater1

Thank you for the update, let me talk with the team to get more help, and I will come back to you as soon as I have more questions or answers. Thank you for being so patient!

Dawid

1 Like

Hi @bradley.plater1

Thank you for your patience! The error you encountered is thrown from here nextjs-auth0/src/auth0-session/client/node-client.ts at 951a24864c61eec98702f91eb7784555d54916da · auth0/nextjs-auth0 · GitHub

can you check for me two things:

  1. Can you curl https://stattracker.uk.auth0.com/.well-known/openid-configuration from the EC2 instance
  2. Whether you have set AUTH0_ISSUER_BASE_URL correctly in the environment variables (likely in .env.local)

Thanks
Dawid

Hi @dawid.matuszczyk

Thanks for the response! The 2 things you wanted me to check:

from the host machine I was able to do both of them and there were no issues. However when running the same commands from the container it doesn’t work. It seems that my container doesn’t have internet access and as such can’t call out to your discovery endpoint.

I am using awsvpc networking mode in docker on a public subnet through some quick research it looks like it should be on a private subnet using a NAT gateway.

When I get some time, I am going to attempt to configure my networking as such and hopefully that will resolve the issue. I will update here once it either worked or didn’t.

Thanks for the help and hopefully my next update will be positive! :slight_smile:

Hi @dawid.matuszczyk

Looks like my issue was with my container and now that I have fixed my network settings I am able to get the auth pages loading. I am having another issue with signing up but because I believe it to be separate I am going to raise a separate issue for that!

Thanks for your help!

Hi @bradley.plater1

I’m glad that you made things work. Can you share more details about the issue and how you fixed it if that’s not a problem?

Thank you!

Dawid

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.