I need help at this mysterious issue: Core upgrade 9.4.1 -> 9.4.2 breaks drush command updatedb at some installations:

Fatal error: Cannot declare class Drupal\mysql\Driver\Database\mysql\Install\Tasks, because the name is already in use in /path/to/site/web/core/modules/mysql/src/Driver/Database/mysql/Install/Tasks.php on line 14

Drush-Version: 10.6.2

The error occures

  • not in 9.4.1, but in 9.4.2 and (also 9.4.3).
  • only with drush (not with update.php)
  • at 2 different installations (but not in 3 other installations)

It has something to do with the changes in location of mysql-driver in 9.4, but Version 9.4.1 makes no problems - this error is introduced with changes in 9.4.2. The error is triggered in update.inc, line 98 $requirements = \Drupal::moduleHandler()->invokeAll('requirements', ['update']); - but only if called via drush.

What can I do to get rid of it? Any ideas welcome.

  • This sounds like the well known drupal.org/project/drupal/issues/3284502 or one of its related issues. We can’t really fix bugs in this forum.
    – cilefen
    Jul 27 at 16:22
  • Thank you for the quick answer and the link, and it may be related, but the issue describes a problem with 9.4. general. 9.4.1 makes NO Problems. The problem is only at SOME of my installations - but I cannot find, what the difference makes. Jul 27 at 16:33
  • You did flush caches first before updb right?
    – leymannx
    Jul 27 at 16:49
  • No idea if it’s relevant for this update, but that’s not usually advisable @leymannx. It is sometimes, depending on what’s changed in code that an update hook might rely on, but in my experience not often. 9.3 -> 9.4 broke in a lot of environments, including Acquia cloud, if you cleared cache before the update. Drush’s recommended deployment workflow demonstrates this: drush.org/latest/deploycommand
    – Clive
    Jul 27 at 17:37
  • 1
    This problem seems not simple cache related. I always use drush cr before such steps. It is not a deploy problem. The error is if I update at my development machine - and I don't want deploy something with such bugs which break my deployment scripts. I wonder, why the error is at site A but not at site B. Which setting should I compare? Jul 27 at 21:50

1 Answer 1


I have found the solution after a long search. It is a weird Mac-specific issue with a case insensitive filesystem.

On my mac development machine the APFS-Filesystem is case-insensitive.




is the same for the system and most of the apps, but not for drush.

If I cd to my app path with wrong case, drush will sometimes fail. If I cd to my app path with correct case, all is fine.

For every Mac-User looking for errors with drush and errors like

PHP Fatal error: Cannot declare class…

Try to switch to your directory with the correct case spelling. Or better: avoid case insensitive file systems when unix developing…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.