ArgumentCountError: Too few arguments to function Drupal\metatag\MetatagManager::__construct(), 4 passed in /public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 280 and exactly 5 expected in /public_html/modules/metatag/src/MetatagManager.php on line 42 #0 /public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(280): Drupal\metatag\MetatagManager->__construct(Object(Drupal\metatag\MetatagGroupPluginManager), Object(Drupal\metatag\MetatagTagPluginManager), Object(Drupal\metatag\MetatagToken), Object(Drupal\redirect_404\Render\Redirect404LogSuppressor))
#1 /public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'metatag.manager')
#2 /public_html/core/lib/Drupal.php(158): Drupal\Component\DependencyInjection\Container->get('metatag.manager')
#3 /public_html/modules/metatag/metatag.module(333): Drupal::service('metatag.manager')
#4 /public_html/modules/metatag/metatag.module(114): metatag_get_tags_from_route()
#5 /public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(297): metatag_page_attachments(Array)
#6 /public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(273): Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array)
#7 /public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(117): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#8 /public_html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#9 /public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#10 /public_html/vendor/symfony/http-kernel/HttpKernel.php(149): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent))
#11 /public_html/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#12 /public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /public_html/core/lib/Drupal/Core/DrupalKernel.php(656): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#21 {main}
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | Metatag1.1Error.png | 20.01 KB | cmwelding |
| #28 | metatag-n2882954-28.patch | 3.34 KB | damienmckenna |
| #20 | metatag-n2882954-20.patch | 3.74 KB | damienmckenna |
| #17 | metatag-n2882954-16.tests-only.patch | 2.34 KB | damienmckenna |
| #12 | metatag-error-when-upgrading-to-1.1-2882954-8.x.patch | 1.42 KB | a.henry |
Comments
Comment #2
fomenkoandrey commentedthe same at 3 sites
https://image.prntscr.com/image/5590bc0c5c6846f28cc6d91799b19406.png
Comment #3
cmwelding commentedIt crashed the entire site after the update.
Comment #4
damienmckennaDid you try clearing the site's caches after the update?
Comment #5
damienmckennaCould you please let me know what version of core you're using? 8.3 I presume?
Comment #6
JonathanFontesCaetsu commentedHello DamienMcKenna,
I have 8.3.2. And the issue cross all the "Metatag: *" modules.
Comment #7
fomenkoandrey commented3 crashed sites use Drupal 8.3.2
Comment #8
a.henry commentedWe are facing the same problem after upgrading to 8.x-1.1
Metatag views is not install (only metatag), but in our case it is webprofiler 1.0-rc2 that is
causing the problem.
Uninstalling web profiler fix the error.
Tried it on simplytest.me with only metatag and web profiler (devel) installed.
The error message is not the exactly the same as the one that gmaxwelled is having, and not the same as in #2883088.
Comment #9
Bandit2300 commentedIdem. Site crashed after update !!!
Comment #10
JonathanFontesCaetsu commentedI can confirm, the problem is related with web profile, after uninstall webprofile and install metatag, this work perfectly.
Comment #11
nickvanboven commentedIdem. Site crashed after update !!! only when webprofiler is enabled
Comment #12
a.henry commentedHere is a patch to use EntityTypeManagerInterface instead of EntityTypeManager in the constructor.
Comment #13
a.henry commentedComment #14
damienmckennaIs anyone having this error and does *not* have the WebProfiler module installed?
Comment #15
JonathanFontesCaetsu commentedHello,
In my case after uninstall webprofile module, the issue disappear. So, i think the issue is related with webprofile.
Best Regards,
Jonathan Fontes
CAETSU
Comment #16
cmwelding commentedI had not installed WebProfiler and Devel module when the error occurred.
Comment #17
damienmckennaHere's a tests-only patch to see what happens with Devel and then WebProfiler are enabled.
Comment #18
Robardi56 commentedI have this issue on a fresh install of drupal aquia lightning (Drupal core 8.3.2 ) I downloaded today to evaluate.
First thing I did was update the metatag module that was the only one marked as outdated.
TypeError: Argument 5 passed to Drupal\metatag\MetatagManager::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, none given, called in /home/uniqueas/**/aa/core/lib/Drupal/Component/DependencyInjection/Container.php on line 280 in Drupal\metatag\MetatagManager->__construct() (line 42 of /home/uniqueas/**/aa/profiles/lightning/modules/contrib/metatag/src/MetatagManager.php) #0
Comment #20
damienmckennaThis combines both patches.
Comment #21
damienmckennaComment #22
damienmckennaFYI it seems that WebProfiler doesn't work with Drupal core 8.4.x anyway due to its change to Symfony 3 instead of 2.x, see #2879214: Support for Drupal 8.4.x using Symfony 3 in webprofiler. This means I'll have to update the automated tests to check core 8.3.x first instead of 8.4.x.
Comment #24
damienmckennaAs expected, the tests fail with 8.4. I've ran the tests locally with 8.3 and they work, so I've updated the module's configuration to use it by default and I'm rerunning the tests with it.
Comment #25
JonathanFontesCaetsu commentedI think my Drupal Core version is 8.3.x (something). And i have this issue
Comment #26
damienmckennaThe 8.3 tests are failing because it isn't downloading Devel.
Comment #28
damienmckennaWithout the info file changes.
Comment #29
damienmckennaOk, this is great! All tests are green with 8.3.
Comment #31
damienmckennaOk, I'm going to commit this as-is and I'll add a note to the 1.1 release notes about the problem.
Thanks everyone!
Comment #32
fomenkoandrey commentedDoes this patch in the dev version?
Comment #33
damienmckennaYes, he patch is included in the dev version.
Comment #34
leoraw commentedI just got this error when I tried the update:
The website encountered an unexpected error. Please try again later.
TypeError: Argument 5 passed to Drupal\metatag\MetatagManager::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, none given, called in /srv/bindings/c74fea21966541d39e9c7f99763e0015/code/core/lib/Drupal/Component/DependencyInjection/Container.php on line 280 in Drupal\metatag\MetatagManager->__construct() (line 42 of modules/metatag/src/MetatagManager.php).
======
And this appeared on the screen:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /core/authorize.php/core/authorize.php?batch=1&id=3520&op=do_nojs&op=do
StatusText: OK
ResponseText: TypeError: Argument 5 passed to Drupal\metatag\MetatagManager::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, none given, called in /srv/bindings/c74fea21966541d39e9c7f99763e0015/code/core/lib/Drupal/Component/DependencyInjection/Container.php on line 280 in Drupal\metatag\MetatagManager->__construct() (line 42 of /srv/bindings/c74fea21966541d39e9c7f99763e0015/code/modules/metatag/src/MetatagManager.php).
===========
Not using WebProfiler.
Comment #35
a.henry commentedTested the update with update manager on a fresh install (metatag 1.0 -> 1.1).
Wasn't able to reproduce.
Comment #36
cmwelding commentedTested the update Metatag 1.0 -> 1.1 on a fresh install at simplytest.me. Updated failed with following error. See the attached image.
Error installing / updating
File Transfer failed, reason: Cannot remove file /home/dc6y9/www/sites/default/modules/metatag/metatag_verification/src/Tests/MetatagVerificationTagsTest.php.
Comment #37
damienmckenna@cmwelding: I don't think that error has anything to do with Metatag.
Comment #38
arknoll commentedI tested patch https://www.drupal.org/files/issues/metatag-n2882954-28.patch and it did not work for me.
Here are my steps:
1. Using Lightning
2. Add patch file to composer
3. Update lightning to test next release: composer update acquia/lightning --with-dependencies
4. patch applies
5. Visit site and receive error:
6. Run drush cr and the error is gone
Comment #39
gustavo.marcante commentedSorry, I'm a Drupal newbie, and I got the same error.
I got it twice, updating Drupal just after fresh installing of two different distributions: OpenEdu (based on Acqua Lightning) and Varbase.
@DamienMcKenna I found webprofiler module in Varbase, but I did't find in Lightning and OpenEdu.
So, maybe this is not the only error.
BEFORE the patch, I could recover with (supposing being at the installation directory):
But, to avoid happen again, I tried the above patch too.
I don't know if I did right, in composer.json, after
there are many lines, after the last I put a comma and these:
Is it right?
What is said in https://www.drupal.org/project/webprofiler is that webprofiler is deprecated and unsupported.
Sorry to ask, but should not it have been removed from the current versions?
Comment #40
frederico commented@Gustavo, Thanks! You saved me!!! I appreciate you taking time to help the rest of us out. -Frederico
Comment #41
Jorgas commented@Gustavo, thanks a lot.