CORE BUG; The "metatag_display_extender" plugin does not exist

Created on 30 November 2017, almost 7 years ago
Updated 9 July 2024, 5 months ago

Hi,

After restarting PHP Worker, my website went down. The log indicates the php error below:

Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginException: "Plugin (metatag_display_extender) instance class "Drupal\metatag_views\Plugin\views\display_extender\MetatagDisplayExtender" does not exist." at /app/mdm_stg/web/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php line 97

Drupal\Component\Plugin\Exception\PluginNotFoundException : The "metatag_display_extender" plugin does not exist. dans Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (ligne 52 de /app/mdm/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Drupal\Component\Plugin\Exception\PluginNotFoundException : The "metatag_defaults" entity type does not exist. dans Drupal\Core\Entity\EntityTypeManager->getDefinition() (ligne 133 de /app/mdm/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php).

I have to reupload and rebuild (composer.json ) to get the site Up back.

My question: is this problem is caused by the module drupal/metatag or the server itself? Any Idea?

Drupal version : 8.3.7 
Web Server nginx/1.13.1
PHP Version: 7.0.20
๐Ÿ› Bug report
Status

Postponed

Version

1.0

Component

Views integration

Created by

๐Ÿ‡ฒ๐Ÿ‡ฆMorocco fidylalaina

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia tdnshah

    I am facing the above this issue when using blt and running a blt setup command, while blt tries to reinstall the site from scratch and importing the existing config I get the same error as below:

      The "metatag_display_extender" plugin does not exist. Valid plugin IDs for   
      Drupal\views\Plugin\ViewsPluginManager are: default    

    I tried adding the dependencies of metatag_views module in views.settings.ymlfile as, mentioned in #21 but it didnt resolve the issue for me.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    I think adding the dependency on the View definition that uses Metatag would be better than modifying views.settings.yml?

  • ๐Ÿ‡ช๐Ÿ‡ธSpain idiaz.roncero Madrid

    Same as #22: I can't do a site install from config (used for automated tests, drush si --existing-config -y), this error makes it crash.

    metatag_views module is enabled on config.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia tdnshah

    @DamienMcKenna tried adding the dependency to the view definition that uses the metatag_views but even this didnt work, secondly I obsered that it fails when scheduler module is getting installed, and hence little confused how and why installation of scheduler module is is looking for

    The "metatag_display_extender" plugin does not exist. Valid plugin IDs for   
      Drupal\views\Plugin\ViewsPluginManager are: default 

    plugin and causing this to fail.

    Looking for directions to debug this further and how this can be resolved ? Any help?

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    372 pass
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    I wonder if this was the problem?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    If anyone has reliable instructions for triggering this problem please let me know, I'd love to solve it, thank you.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia tdnshah

    Tested the above patch, its not resolving this Issue.
    The steps to reproduce are as below:

    Step 1. Create a normal Drupal Install
    Step 2. Add and enable metatag module
    Step 3. Add and enable metatag_views module
    Step 4. Ensure under admin/structure/views/settings/advanced metatag_display_extender
    Step 5. Run drush cex and export all the configs.
    Step 6. Then try re running drush si and this should cause the error.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA
  • ๐Ÿ‡ฒ๐Ÿ‡ฆMorocco zakariabdc

    None of the above solutions worked for me.
    I tried

    composer require drupal/metatag_views

    and it worked.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    "metatag_views" isn't a separate package available on Packagist, so "composer require drupal/metatag_views" shouldn't have changed your composer files. It does suggest part of the problem might be the class autoloading, and possibly one priority over another.

    I wonder if the priority for metatag_views was higher than the views priority, would that fix the problem?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia tdnshah

    @zakariabdc I tired adding the composer dependency to the project as mentioned by you, and that does not fix the issue on drush si .

    yeah I agree with @DamienMcKenna on adding the module as a composer dependency, it do not make any difference.

    @DamienMcKenna I tried changing the priority of the metatag_views in mycore.extension file, but no even that do not help.

    I feel this has something to do with plugin dependencies not getting calculated properly and hence the metatag_views module is not getting added, not 100% sure on this though.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    370 pass, 4 fail
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    How's about this?

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    That suggests the dependencies can't be modified on a config object using the get()/set() methods. So what's the best approach?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia tdnshah

    The patch in #33 is also not helping to solve the drush si issue.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia tdnshah

    Hi All,
    Still struggling to resolve this, requesting direction towards the resolution or even a work around would help for now ?
    Thanks in advance..

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    I think the first step would be to add a new install profile that adds Metatag Views to the install profile, then we can have something to debug.

  • Assigned to DamienMcKenna
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    Going to try creating an install profile..

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    113 pass
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    WIP.

  • Issue was unassigned.
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    We first need to make the tests fail.

  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine gilmord ๐Ÿ‡บ๐Ÿ‡ฆUkraine

    +1 for this to be solved, I face exactly the same issue with simple_sitemap also, looks like the problem is general and more likely related to core as multiple modules struggling with it

    Attaching the issue in case it will be solved earlier

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom AaronMcHale Edinburgh, Scotland

    As far as I can tell, at least part of the issue is that the metatag_views module lists views as a dependency (which makes sense), but that means when installing from a profile, Drupal will try to install Views before installing Metatag Views, and with the `metatag_display_extender` plugin is listed in the `views.settings` config, at the point where Drupal tries to install Views, it sees that but because Metatag Views isn't installed at this point, as far as Drupal is concerned the metatag_display_extender plugin does not exist, so it fails.

    Off the top of my head I can't think of a clean way around this.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    So maybe Views shouldn't cache its list of display extenders as a config object? Maybe this is ultimately a core issue?

  • Status changed to Postponed about 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 8 months ago
    120 pass
  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland Castor-designs

    I get this error as soon as I do anything in composer like uninstall a completely different module. How can I workaround this issue breaking my site as soon as I want to do basically anything?

    Hete's my scenario: https://imgur.com/a/frC5mEA

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom AaronMcHale Edinburgh, Scotland

    @Castor-designs If you have an export of your site's config, go into the views.settings.yml, look for the line metatag_display_extender, remove that line and try doing a config import, that might fix the issue for you.

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland Castor-designs

    Hi @AaronMcHale Sorry for seeing this so late. I've checked my views.settings.yml (core file) but there is no line that contains "metatag" in any way: https://pastebin.com/6rqsH9GR

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom AaronMcHale Edinburgh, Scotland

    Yeah that config doesn't have anything under display_extenders, did you try importing that? Importing that config might help with the issue.

Production build 0.71.5 2024