SSL Handshake Timeout with Supabase Connection

shak33lPRO

7 months ago

Issue Description

I'm experiencing SSL handshake timeout errors when my Streamlit application deployed on Railway.app attempts to connect to Supabase for authentication. This issue does not occur when running the application locally.

Error Message

ERROR:components.auth:Login failed: _ssl.c:989: The handshake operation timed out

Application Stack

  • Frontend: Streamlit

  • Backend/Database: Supabase

  • Deployment: Railway.app

Steps to Reproduce

  1. Deploy Streamlit app to Railway.app

  2. Attempt to log in through the application

  3. Observe intermittent SSL handshake timeout errors

What I've Tried

  1. Increased timeout settings for the Supabase client

  2. Implemented retry logic for login attempts

  3. Verified all environment variables are correctly set in Railway.app

  4. Ensured Supabase project region is appropriate for minimizing latency

Questions

  1. Are there any known issues with outbound SSL connections from Railway.app to Supabase?

  2. Are there any recommended configurations or best practices for connecting to external databases (specifically Supabase) from a Railway.app deployment?

  3. Could there be any network-level restrictions or configurations on Railway.app that might be causing this issue?

  4. Are there any diagnostic tools or logs available on Railway.app that could help identify the root cause of these SSL handshake timeouts?

Additional Information

  • The issue occurs with every login attempt & auth call within app and seriously impacts user experience

  • The application works without issues when run locally

Solved

3 Replies

7 months ago

  1. None that I know of.

  2. Connecting to an external database is already not recommended because you are subjecting yourself to egress fees.

  3. Nope, we do not have any restrictions, or even a way to apply restrictions if we wanted to.

  4. Since that error wouldn't be specific to Railway (It's a generic SSL error) the platform does not provide any tools for it.

All in all, this error would unfortunately be out of our hands, this is something you would want to contact supabase for.


Status changed to Awaiting User Response railway[bot] 7 months ago


shak33lPRO

7 months ago

It's bizarre - The first app has no problems (personal 1-person auth). This one didn't until about a week ago. I am back on the tools for it, will try a few things today and see how far I get.

for "Connecting to an external database is already not recommended because you are subjecting yourself to egress fees." Does railway provide a DB/Auth service as well? I am a bit green to this and appreciate your help.


Status changed to Awaiting Railway Response railway[bot] 7 months ago


7 months ago

We provide Postgres itself, and I'm sure there are some auth templates you can use.


Status changed to Awaiting User Response railway[bot] 7 months ago


Status changed to Solved brody 7 months ago