Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra warning messages for "SSL: Connection timed out" #17950

Open
rbro opened this issue Feb 28, 2025 · 2 comments
Open

extra warning messages for "SSL: Connection timed out" #17950

rbro opened this issue Feb 28, 2025 · 2 comments

Comments

@rbro
Copy link

rbro commented Feb 28, 2025

Description

I am running PHP 8.3.16 on Linux, and I run PHP with "error_log = /var/log/phplog".

At times, I believe after long running processes have finished, I will see warnings like this logged:

[26-Feb-2025 00:10:35 America/New_York] PHP Warning:  PHP Request Shutdown: SSL: Connection timed out in Unknown on line 0

I'm trying to figure out where they are coming from and how to suppress them. My code is connecting to a MySQL database over SSL, so one possibility could be from this line, but I don't know for sure:

https://github.com/php/php-src/blob/master/ext/openssl/xp_ssl.c#L271

My questions are:

  • is there something I can do to definitely find out where this error is coming from?
  • could it be suppressed?

Thanks for your help.

PHP Version

8.3.16

Operating System

Linux

@iluuu1994
Copy link
Member

Maybe @bukka can help.

@bukka
Copy link
Member

bukka commented Mar 3, 2025

Yeah that's the right place where it's triggered most likely.

I think it might come from mysqlnd trying to finalize connection in request shutdown (assuming you don't use persistent connections). As it's using tls stream, it will fail on io for some reason and shows this message. If it happens on long running request, maybe MySQL server closes that connection due to some limits. Could be even the stream timout (like https://www.php.net/manual/en/mysqlnd.config.php#ini.mysqlnd.net-read-timeout ) but that's already quite hight by default.

I would probably look to the MySQL stats to see if there is anything close to limits and if there are any forced closures (there might be stat for it but not sure). You could even try to trace conncecttion (e.g. get traffic dump using tcpdump or other tools - if you use aws, then vpc logs might help) and see if there's anything there. There are tools to do that. Basically you will need to somehow figure it out and if you see something suspicious on PHP side, you can let us know. Otherwise there's unfortunately not much we can do about this.

There is no way to suppress it as far as I'm aware because it is an issue that should be reported. Well you can of course filter it from logs yourself if you don't mind that error (it might not be really a problem but it really depends what the cause is).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants