5

I cloned a repo of a site to my local computer, imported the database and ran "Composer install --with-dependencies" after the installation had been done I entered the local site and it worked, then I ran "drush updb -y" and it showed a couple of errors and warnings:

    The following module is missing from the file system: aspambot       [warning]
bootstrap.inc:268
The following module is missing from the file system: phpmailer      [warning]
bootstrap.inc:268

...

PHP  27. include() /home/www/sites/zb/web/vendor/composer/ClassLoader.php:444
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Interface 'Doctrine\Common\Reflection\ClassFinderInterface'
not found in
/home/www/sites/zb/web/core/lib/Drupal/Component/Annotation/Reflection/MockFileFinder.php,
line 14
The external command could not be executed due to an application     [error]
error.
PHP Fatal error:  Interface 'Doctrine\Common\Reflection\ClassFinderInterface' not found in /home/www/sites/zb/web/core/lib/Drupal/Component/Annotation/Reflection/MockFileFinder.php on line 14

I'm new to Drupal, so please help me get over these errors, I understand that the solution may seem straightforward to some, but I don't know what to do. Thank you!

  • 2
    The first error is due to the modules listed having been installed at some point so they are recorded in the database but not present in the installed source code. The second is because you are running the wrong version of Drush for your site. Is the site working or not? From these messages I would guess no DB update has occurred. – Alfred Armstrong Jul 23 '18 at 13:18
  • The second appeared after I ran "Drush updb -y". I'm using Drush 8. Last update went smoothly with this version of Drush. – Rusletov Jul 23 '18 at 13:43
  • The site is showing the following error: Fatal error: Interface 'Doctrine\Common\Reflection\ClassFinderInterface' not found in /home/www/sites/zb/web/core/lib/Drupal/Component/Annotation/Reflection/MockFileFinder.php on line 14 and a call stack. – Rusletov Jul 23 '18 at 13:49
  • My mistake, would sound like the composer install broke something in that case. That class should be found in your vendor folder, under doctrine / common / lib / Doctrine / Common / Reflection. – Alfred Armstrong Jul 23 '18 at 14:09
  • 1
    @Christia – That's not some filepath, it's a class provided by some package/library/dependency managed via Composer. But true indeed, it seems to be missing. Drupal's autoloader.php doesn't find that in the /vendor folder. Or maybe that's just what you meant ^^ – leymannx Jul 24 '18 at 22:28
3

Add "doctrine/common":">2.8" under conflict in your composer file and then run composer update.

"conflict": {
    "drupal/drupal": "*",
    "doctrine/common":">2.8"
},

See issue: https://www.drupal.org/project/drupal/issues/2986725

0

Thanks for giving a link to https://www.drupal.org/project/drupal/issues/2986725, where this problem is discussed.

That issue was closed as "works as designed". If you look at the last few comments on the issue, you will see why. The problem is caused by the PHP cache. If you clear the cache (or restart PHP or reboot your computer or use PHP on a Docker container that does not have the wrong autoload data in its cache) then the problem goes away.

Clearing the cache has fewer side effects than never updating to the current version of doctrine/common.

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.