Skip to content

[11.x] Refine error messages for detecting lost connections (Debian bookworm compatibility)#54111

Merged
taylorotwell merged 1 commit into
laravel:11.xfrom
mfn:mfn/rds-proxy-caused-by-v2-l11
Jan 9, 2025
Merged

[11.x] Refine error messages for detecting lost connections (Debian bookworm compatibility)#54111
taylorotwell merged 1 commit into
laravel:11.xfrom
mfn:mfn/rds-proxy-caused-by-v2-l11

Conversation

@mfn

@mfn mfn commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

Summary

Same as #53794 , which was for L10, but this time for L11 (I thought there was some kind of L10 -> L11 merge, but alas, there isn't)

Paraphrasing from the other PR:

Last year I added those two via #47398 Please see details and reasoning there, it still applies; TL;DR:

Ever since I moved from AWS Aurora to using AWS RDS Proxy, which
(similar to pgbouncer) is essential to not overload the primary database
with connection, I sporadically see these messages. This affects
scheduled tasks, worker, HTTP requests; it's across the whole board.

What I didn't knew back then was that the order/format of those messages very much dependent on the underlying libraries (libpq and or libssl presumably) and once we started to upgrade from Debian bullseye to bookworm, they changed and now are randomly interrupting our service again.

The new (complete) messages look like this:

SQLSTATE[08006] [7] connection to server at "…" (…), port 5… failed: SSL error: sslv3 alert unexpected message (Connection: main, SQL: …

That is, it still contains "SSL error: sslv3 alert unexpected message" but there's now connection specific information after the SQLSTATE prefix.

Since lost connection detection is based on exact string matching and not regex, we're just removing the magic numbers in front and still keep backwards compatibility.

Notes

Please accept this this PR against Laravel 10.x because we're still using and it requires the fix there (we're in the progress moving to L11, but it still takes time).

Thanks!

…ookworm compatibility)

Same as laravel#53794 , which was for
L10, but this time for L11
@taylorotwell taylorotwell merged commit f7bee97 into laravel:11.x Jan 9, 2025
taylorotwell pushed a commit that referenced this pull request Jun 10, 2026
I've added some before in the past (#47398, #53794, #54111) and a new variant kept popping up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants