clerk-sdk-ruby icon indicating copy to clipboard operation
clerk-sdk-ruby copied to clipboard

Faraday::ConnectionFailed (Failed to open TCP connection to api.clerk.dev:443 (execution expired))

Open mu4farooqi opened this issue 1 year ago • 0 comments

I'm not sure if this is a library issue or a Docker issue but https://api.clerk.dev/v1/jwks fails sometimes with the error given in the title. Looks like a DNS issue but if it's then subsequent requests should fail as well. It's also hard to test this because jwks is cached after first request.

Environment: Development

Following are the logs.

| 14:53:55 rails.1 | I, [2024-02-06T14:53:55.847440 #28]  INFO -- request: GET https://api.clerk.dev/v1/jwks
| 14:53:55 rails.1 | I, [2024-02-06T14:53:55.850435 #28]  INFO -- request: User-Agent: "Clerk/3.0.0; Faraday/2.9.0; Ruby/3.3.0"
| 14:53:55 rails.1 | X-Clerk-SDK: "ruby/3.0.0"
| 14:53:55 rails.1 | Authorization: "Bearer [SECRET]"


| 14:54:00 rails.1 |   
| 14:54:00 rails.1 | Faraday::ConnectionFailed (Failed to open TCP connection to api.clerk.dev:443 (execution expired)):

It's also hard to reproduce it. Mostly when I left my docker container with Rails app running overnight and make the first request in the morning, it fails. After that, even if I restart the container multiple times, request goes through without any issue.

mu4farooqi avatar Feb 06 '24 15:02 mu4farooqi