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

Incompatible with Sentry if using DB tracing #81

Open
Lehren opened this issue Feb 7, 2024 · 1 comment
Open

Incompatible with Sentry if using DB tracing #81

Lehren opened this issue Feb 7, 2024 · 1 comment

Comments

@Lehren
Copy link

Lehren commented Feb 7, 2024

Hello, I'm using this package together with sentry and sentry-symfony. When I enable DBAL tracing for sentry, the default connection driver gets wrapped in Sentry's own TracingDriver, but the default connection driver is in turn the MysqlComeBackDriver wrapping the regular DBAL connection, which then causes an error in ConnectionTrait on line 50.

        if (!$driver instanceof ServerGoneAwayExceptionsAwareInterface) {
            throw new \InvalidArgumentException(
                sprintf('%s needs a driver that implements ServerGoneAwayExceptionsAwareInterface', get_class($this))
            );
        }

See picture: The driver is the Sentry driver decorating the MySqlComeBack driver.
Screenshot 2024-02-07 at 13 53 33

I can fix it by disabling DBAL tracing for Sentry, but I would like to have it enabled.

Package info:

symfony/symfony: 4.4.50
sentry/sentry: 3.7.0
sentry/sentry-symfony: 4.3.0
facile-it/doctrine-mysql-come-back: 1.10.1

Any suggestions? Maybe I can somehow change the order in which the drivers get wrapped so that the ComeBack one is always on top.

@Jean85
Copy link
Member

Jean85 commented Feb 7, 2024

Which version of DBAL are you using? DBAL 3 has middlewares and it could fix your issue.

Also, you could try to change the order of the bundles (Sentry and Doctrine) so see if anything changes.

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

No branches or pull requests

2 participants