a month ago
Hi,
I am getting a received direct SSL connection request without ALPN protocol negotiation extension error on my Postgres instance's deploy logs when I try to establish a connection through Lambda.ai's GPU platform. We use Runpod and Lambda to run the same container that establishes this database connection, and we are able to connect to our DB through Runpod but not through Lambda. We have reached out to Lambda's support as well, but we are running the same container on both services without any custom network configuration.
Was wondering if Railway was doing some sort of network request filtering.
Here's some more logs that might be helpful:
2026-01-06 20:26:29.126 UTC [3883] LOG: could not accept SSL connection: EOF detected
2026-01-06 20:26:29.280 UTC [3884] LOG: received direct SSL connection request without ALPN protocol negotiation extension
2026-01-06 20:27:38.247 UTC [27] LOG: checkpoint starting: time
2026-01-06 20:27:38.684 UTC [27] LOG: checkpoint complete: wrote 5 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.403 s, sync=0.007 s, total=0.438 s; sync files=4, longest=0.005 s, average=0.002 s; distance=10 kB, estimate=126 kB; lsn=0/1BACD2E0, redo lsn=0/1BACD288
2026-01-06 20:29:03.229 UTC [3894] LOG: could not accept SSL connection: no application protocol
2026-01-06 20:29:03.539 UTC [3895] LOG: received direct SSL connection request without ALPN protocol negotiation extensionPinned Solution
a month ago
your container is using a postgres 17+ client library that defaults to "direct ssl" mode which needs ALPN support. lambda's network doesn't handle ALPN (but runpod's does, which is why it works there).
one-line fix:
add this environment variable to your lambda.ai container:
PGSSLNEGOTIATION=postgresor set the database URL as : DATABASE_URL="postgresql://user:pass@host:port/db?sslmode=require&sslnegotiation=direct"
5 Replies
a month ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • about 1 month ago
a month ago
try this 2 solutions
a month ago
your container is using a postgres 17+ client library that defaults to "direct ssl" mode which needs ALPN support. lambda's network doesn't handle ALPN (but runpod's does, which is why it works there).
one-line fix:
add this environment variable to your lambda.ai container:
PGSSLNEGOTIATION=postgresor set the database URL as : DATABASE_URL="postgresql://user:pass@host:port/db?sslmode=require&sslnegotiation=direct"
a month ago
hope this help you :)
a month ago
Adding PGSSLNEGOTIATION=postgres didn't work for me. What worked was setting the database URL as DATABASE_URL="postgresql://user:pass@host:port/db?sslmode=require&sslnegotiation=direct" .
zerodaykurt
Adding PGSSLNEGOTIATION=postgres didn't work for me. What worked was setting the database URL as DATABASE_URL="postgresql://user:pass@host:port/db?sslmode=require&sslnegotiation=direct" .
a month ago
that's the solution , happy it works for you
Status changed to Awaiting User Response brody • about 1 month ago
Status changed to Solved brody • about 1 month ago
