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

Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found #4439

Closed
somir-khan opened this issue Nov 18, 2020 · 16 comments
Closed

Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found #4439

somir-khan opened this issue Nov 18, 2020 · 16 comments

Comments

@somir-khan
Copy link

somir-khan commented Nov 18, 2020

BC Break Report

Q A
BC Break yes
Version 3.0.0

Summary

Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found while migration

Previous behaviour

It was working flawlessly

Current behavior

How to reproduce

1.composer require doctrine/dbal to upgrade to version 3.0
2.run the migration command

@greg0ire
Copy link
Member

greg0ire commented Nov 18, 2020

BC breaks are expected to happen when you release a major version you know… no need to report them. That being said, I don't think you are using the DBAL yourself but through doctrine/migrations, that maybe wrongly advertises compatibility with doctrine/dbal? To be sure about that, please provide a stack trace. If you don't know how to get one, please read this guide. If that is indeed a bug with doctrine/migrations, I will be able to transfer your bug there.

@amigogobara
Copy link

amigogobara commented Nov 18, 2020

I have the same issue but I didn't install doctrine/migrations in laravel|
@greg0ire
Here's my stack trace:

  Symfony\Component\Debug\Exception\FatalThrowableError  : Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found

  at /var/www/bookingEngineLaravel/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php:64
    60|      * @return \Doctrine\DBAL\Driver\PDOMySql\Driver
    61|      */
    62|     protected function getDoctrineDriver()
    63|     {
  > 64|         return new DoctrineDriver;
    65|     }
    66| }
    67| 

  Exception trace:

  1   Illuminate\Database\MySqlConnection::getDoctrineDriver()
      /var/www/bookingEngineLaravel/vendor/laravel/framework/src/Illuminate/Database/Connection.php:892

  2   Illuminate\Database\Connection::getDoctrineSchemaManager()
      /var/www/bookingEngineLaravel/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/ChangeColumn.php:37

@amigogobara
Copy link

BTW I make a downgrade to version 2.12 and it's working fine @somir-khan

@somir-khan
Copy link
Author

somir-khan commented Nov 18, 2020 via email

@youssefkhouili
Copy link

what is the commend to install version 2.12?

@amigogobara
Copy link

composer require doctrine/dbal:2.*

@youssefkhouili
Copy link

Thank you

@greg0ire
Copy link
Member

@amigogobara I can only transfer issues within the Doctrine org, you should post the issue to Laravel. Before you do so, be sure to learn Github markdown or edit your message to see how I improved the markup so that it's legible.

@McMazalf
Copy link

composer require doctrine/dbal:2.*

Thanks :)

@hajatianapatrick
Copy link

Thank you

@hngmihai
Copy link

Had the exact same issue & downgrading helped. Thank you!

@afsarpervez
Copy link

composer require doctrine/dbal:2.*

Thank you!

@Dilshan97
Copy link

BTW I make a downgrade to version 2.12 and it's working fine @somir-khan

it's woking for me

@neoacevedo
Copy link

I installed the version 3.1 via composer require in L6: same result.

I checked the documentation in laravel: https://laravel.com/docs/6.x/migrations#modifying-columns

Downgrading the version to 2.* did the trick. @greg0ire please, more than one people reporting the same issue is a call of attention.

@greg0ire
Copy link
Member

greg0ire commented May 31, 2021

@neoacevedo but I have already given this attention, and a proper response:

you should post the issue to Laravel

Did anybody act on that? If not, please give my messages some attention, folks. I can elaborate in case this was unclear.

In #4439 (comment) , we can see that a class present in DBAL 2, and removed in DBAL 3 is referenced from laravel/framework/src/Illuminate/Database/MySqlConnection.php:64 (there is an alias, but you can see the FQCN here: https://github.com/laravel/framework/blob/43518afa5253600513b19ba7c3d4aad2a3eb69c3/src/Illuminate/Database/MySqlConnection.php#L5)

I see that doctrine/dbal is not a hard dependency of laravel/framework, otherwise forbidding DBAL 3 would have fixed the issue. They still test that package with the DBAL, but with this constraint: https://github.com/laravel/framework/blob/43518afa5253600513b19ba7c3d4aad2a3eb69c3/composer.json#L81 (DBAL 2). So IMO DBAL 3 was never intended to be supported by L6

IMO a conflict with DBAL > 3.0.0 could have been added to laravel/framework v6 to avoid this issue, but now it's a bit late… not much anyone can do in Laravel IMO, and there I think nothing that can be done in the DBAL either, sorry.

greg0ire added a commit to greg0ire/framework that referenced this issue Aug 25, 2021
doctrine/dbal is an optional dependency of laravel/framework, and v3 of
the DBAL has been released recently, but obviously, Laravel was never
meant to be compatible with that version.
Users still using Laravel 6 and updating their dependencies get confused
and file invalid reports on the DBAL, see for instance
doctrine/dbal#4439
or
doctrine/dbal#4757

Fixes laravel#24271
greg0ire added a commit to greg0ire/framework that referenced this issue Aug 25, 2021
doctrine/dbal is an optional dependency of laravel/framework, and v3 of
the DBAL has been released recently, but obviously, Laravel 6 was never
meant to be compatible with that version.
Users still using Laravel 6 and updating their dependencies get confused
and file invalid reports on the DBAL, see for instance
doctrine/dbal#4439
or
doctrine/dbal#4757

Fixes laravel#24271
greg0ire added a commit to greg0ire/framework that referenced this issue Aug 25, 2021
doctrine/dbal is an optional dependency of laravel/framework, and v3 of
the DBAL has been released recently, but obviously, Laravel 6 was never
meant to be compatible with that version.
Users still using Laravel 6 and updating their dependencies get confused
and file invalid reports on the DBAL, see for instance
doctrine/dbal#4439
or
doctrine/dbal#4757

Fixes laravel#24271
greg0ire added a commit to greg0ire/framework that referenced this issue Aug 25, 2021
doctrine/dbal is an optional dependency of laravel/framework, and v3 of
the DBAL has been released recently, but obviously, Laravel 6 was never
meant to be compatible with that version.
Users still using Laravel 6 and updating their dependencies get confused
and file invalid reports on the DBAL, see for instance
doctrine/dbal#4439
or
doctrine/dbal#4757

Fixes laravel#24271
greg0ire added a commit to greg0ire/framework that referenced this issue Aug 25, 2021
doctrine/dbal is an optional dependency of laravel/framework, and v3 of
the DBAL has been released recently, but obviously, Laravel 6 was never
meant to be compatible with that version.
Users still using Laravel 6 and updating their dependencies get confused
and file invalid reports on the DBAL, see for instance
doctrine/dbal#4439
or
doctrine/dbal#4757

Fixes laravel#24271
taylorotwell pushed a commit to laravel/framework that referenced this issue Aug 26, 2021
doctrine/dbal is an optional dependency of laravel/framework, and v3 of
the DBAL has been released recently, but obviously, Laravel 6 was never
meant to be compatible with that version.
Users still using Laravel 6 and updating their dependencies get confused
and file invalid reports on the DBAL, see for instance
doctrine/dbal#4439
or
doctrine/dbal#4757

Fixes #24271
taylorotwell pushed a commit to illuminate/database that referenced this issue Aug 26, 2021
doctrine/dbal is an optional dependency of laravel/framework, and v3 of
the DBAL has been released recently, but obviously, Laravel 6 was never
meant to be compatible with that version.
Users still using Laravel 6 and updating their dependencies get confused
and file invalid reports on the DBAL, see for instance
doctrine/dbal#4439
or
doctrine/dbal#4757

Fixes laravel#24271
victorvilella pushed a commit to cdsistemas/framework that referenced this issue Oct 12, 2021
doctrine/dbal is an optional dependency of laravel/framework, and v3 of
the DBAL has been released recently, but obviously, Laravel 6 was never
meant to be compatible with that version.
Users still using Laravel 6 and updating their dependencies get confused
and file invalid reports on the DBAL, see for instance
doctrine/dbal#4439
or
doctrine/dbal#4757

Fixes laravel#24271
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests