Metatag 2.2.1 Broke a site:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "Drupal\metatag\Hook\OutputHooks". in Drupal\Component\DependencyInjection\Container->get() (line 159 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Comments

fherman95 created an issue. See original summary.

fherman95’s picture

Drupal core 10.6.20

dkmishra’s picture

Thanks for the report. Could you please share the steps to reproduce this issue, so we can confirm it on our side?

fherman95’s picture

I upgraded with composer using the command from the Drupal website. I have Drupal core 10.6.20 on this server. I had to revert to the previous version to recover. I have now uninstalled Metatag from all the sites that had installed it to avoid problems with Metatag in the future.

shubhamgoel’s picture

Status: Active » Needs review

Hi @fherman95,

The Metatag code is fine. metatag.services.yml registers Drupal\metatag\Hook\OutputHooks, and the class exists in src/Hook/. The error most likely came from the compiled container still being the one built before the 2.2.1 update.
If the site still throws the error, run drush cr again on that environment. After any deploy that updates Metatag, run drush updb -y && drush cr. If you can't run drush, php core/scripts/rebuild_cache.php rebuilds the cache too.

damienmckenna’s picture

Title: Metatag 2.2.1 Update » OutputHooks service doesn't exist
Status: Needs review » Active
Parent issue: » #3632962: Plan for Metatag 2.2.2

I'm very sorry about this bug. Because of some changes to the d.o infrastructure tests currently only run against Drupal 11, so I missed that something was broken on D10. We'll fix it.

  • damienmckenna committed 6fa42a39 on 2.2.x
    Issue #3632975 by fherman95, shubhamgoel, DamienMcKenna: Empty update...
damienmckenna’s picture

Status: Active » Fixed
Parent issue: #3632962: Plan for Metatag 2.2.2 »

@shubhamgoel was correct - the service definition exists, the only reason this error would have showed up was because the caches were stale.

@fherman95: Please try clearing the caches after you update any codebase.

I've added an empty update script to force this step, this will be helpful when updating to the upcoming 2.2.2 release for any sites on 2.2.0.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

damienmckenna’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.