I just attempted to update Drupal 9.2.10 to 9.3.0 using composer and received the following error during the database update.

views module
Update sort_identifier
Failed: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "tag" plugin does not exist. Valid plugin IDs for Drupal\views\Plugin\ViewsPluginManager are: in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /path/to/home/dir/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

I've used composer to install everything for quite some time now, and up until now everything has run just fine.

Upon further inspection into this error, I noticed that the installation doesn't even have the DiscoveryTrait.php file that is included in the Core 9.3.0 zip.

Furthermore, the installation is a rather complex multi-site install.

What, if any, ramifications would I encounter by copying some of the files from the zip to my local and pushing the changes via git?

Would I need to keep installing this file manually since it doesn't seem to be included in the composer package?

Lastly, why wouldn't this file had been installed after having run the composer update "drupal/*" -w command?

I guess I'm mostly concerned about what other files may be missing from the core at this point too...

  • 1
    Do not manually copy files over. Assuming your code is in git, and you have committed all your recent work, I would create a fresh clone of your repo in a separate directory and then run composer install to see if you have the same issue. The whole point of using composer + git is that you should get consistent, reproducible files everywhere, so when that doesn't happen, you should troubleshooting by going back to the source (a fresh git clone) instead of manually copying files. Dec 14 '21 at 16:01
  • 1
    How could DiscoverTrait.php cause an error when it is missing?
    – 4k4
    Dec 14 '21 at 16:15
  • DiscoveryTrait is not missing. As 4k4 has mentioned, it's what is throwing your error. Try running composer install again. It will add any missed files.
    – Jaypan
    Dec 14 '21 at 16:37
  • Also composer update "drupal/*" -w probably not the best thing to run all at once. I would do updates to core and contrib in smaller batches.
    – Kevin
    Dec 14 '21 at 18:21

The issue lied in my root .gitignore file where I had cache/ marked as a directory to ignore. I guess when I first set up that ignore file I didn't realize that that line would also exclude /path/to/public/core/modules/views/src/Plugin/views/cache and all of its contents, which is where Tag.php resides and is the actual plugin that it was looking for.

So for anyone that is seeing this, if you have a cache folder that you want to ignore from your root directory, make sure you add !*/core/**/cache/ to include any core cache files.

  • The safest way to use .gitignore is usually to use relative paths like ./cache (or to make a separate .gitignore in cache/ that just contains .. (Also, checking the files downloaded by composer into git in the first place might not be optimal, though it seems to be quite common.) Dec 17 '21 at 2:58

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