Skip to content

Sentry bundle breaks doctrine migrations. #488

Closed
@vuryss

Description

@vuryss

Environment

PHP 8.0
Symfony 5.2
Doctrine Migrations 3.1
sentry-symfony 4.1

Steps to Reproduce

Having the above combination completely breaks the Doctrine migrations unless we add to each migrations a method indicating that the migration is not transactional.
Doctrine had this issue before (doctrine/migrations#1104) but they fixed it with this check:

https://github.com/doctrine/migrations/blob/96c64fa17477e503da8245f14541d70d7ae76091/lib/Doctrine/Migrations/Tools/TransactionHelper.php#L39

However, sentry decorates the connection with:

Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverConnection

which is obviously not a PDO instance, so the aforementioned check fails and we get a nasty error:

In TracingDriverConnection.php line 163:
                                  
  [PDOException]                  
  There is no active transaction  

Expected Result

Well obviously I expect migrations to work with and without the sentry bundle :)

Actual Result

In TracingDriverConnection.php line 163:
                                  
  [PDOException]                  
  There is no active transaction  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions