-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Mysql as gone away #290
Comments
Related: #233 |
Fixed by symfony/symfony#53214. |
Hello @dunglas, I still face the issue when using Symfony 7.1 and |
Be sure to use a version of DoctrineBundle that contains the fix. Last time I checked this was the dev version. |
Thank you, yes, it seems it will be released in 2.13 soon if I'm not mistaken: doctrine/DoctrineBundle@2.12.x...2.13.x |
Hi there, we see the same issue, but with https://packagist.org/packages/doctrine/doctrine-bundle#2.13.x-dev Any ideas? Perhaps @dunglas ? :) Short update: as workaround, I increased wait_timeout on mysql side, but that it's quite dirty.. |
Same issue here, but with doctrine-bundle 2.13 stable. :-) Seems like the problem got reintroduced again after the fix. :-) |
Our workaround is to disable worker mode of frankenphp.. we don't really rely on the speed, so stability and availability is more important to us |
Would you be able to provide a reproducer (a repository with Docker containing minimal code for instance)? I'll take a look. |
Hey @dunglas, try api-platform demo, but instead of postgres, make it with mysql: |
Seems like issue is fixed with php 8.3.11 :-) I was using 8.3.7 it was related to mysql 8.0.36 or percona 8.0.36 pdo bug: php/php-src#13618 |
I'm not sure about that, because we are using mariadb and the linked issue seems to be explicitly only for mysql |
Sorry for false positive! Okay, it actually was not the only fix. The actual fix that did it was upgrade of Also make sure you have no EntityManagers injected in events which would run before this middleware, checkout Workers lifecycle over here: https://github.com/symfony/symfony/blob/7.2/src/Symfony/Component/Messenger/Worker.php#L162 because middlewares are handled in message bus dispatch method: https://github.com/symfony/symfony/blob/6864dbe5a6f578cb5b9d9a830fe8bb31b504f55d/src/Symfony/Component/Messenger/MessageBus.php#L69 Otherwise worker will load probably expired PDO instance via EntityManager -> MySQL Driver -> Connection -> PDO 😀 |
Hey guys,
I'm using the API-platform way of using frankenphp to create an API managing a MYSQL database,
My issue is that after a long time of inactivity (in dev environment for example) the mysql server closes the connection.
Since the connection seems to stay opened due to frankenphp. I get a "Mysql has gone away" after the wait_timeout as been reached I don't really now how it would be possible to renew the connection automatically. But I think it would be the way here ?
here is my doctrine configuration file if needed :
I'm new to frankenphp so I don't understand all the basics of how it works, so if my issue is not where it should be I apologize in advance.
Here is the complete log in case :
The text was updated successfully, but these errors were encountered: