Upon installation of latest upgrade to this module, my browser stopped at core/authorize.php with the following error:

The website encountered an unexpected error. Please try again later.
ArgumentCountError: Too few arguments to function Drupal\metatag\MetatagToken::__construct(), 1 passed in /home/explorerinruins/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 269 and exactly 2 expected in Drupal\metatag\MetatagToken->__construct() (line 36 of modules/metatag/src/MetatagToken.php).

Attempting to navigate back to any other page on the site merely results in:
The website encountered an unexpected error. Please try again later.

The whole site is currently dead. Ideas?

CommentFileSizeAuthor
#30 metatag-n3123665-30.patch537 bytesdamienmckenna

Comments

explorerinruins created an issue. See original summary.

explorerinruins’s picture

While I wasn't able to get to any other page on the site, I was able to run update.php. That did the trick of getting me back in.

When checking the log messages for this error, I found the following:

ArgumentCountError: Too few arguments to function Drupal\metatag\MetatagToken::__construct(), 1 passed in /home/explorerinruins/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 269 and exactly 2 expected in Drupal\metatag\MetatagToken->__construct() (line 36 of /home/explorerinruins/public_html/modules/metatag/src/MetatagToken.php)
#0 /home/explorerinruins/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(269): Drupal\metatag\MetatagToken->__construct(Object(Drupal\token\Token))
#1 /home/explorerinruins/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'metatag.token')
#2 /home/explorerinruins/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('metatag.token', 1)
#3 /home/explorerinruins/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#4 /home/explorerinruins/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'metatag.manager')
#5 /home/explorerinruins/public_html/core/lib/Drupal.php(158): Drupal\Component\DependencyInjection\Container->get('metatag.manager')
#6 /home/explorerinruins/public_html/modules/metatag/metatag.module(457): Drupal::service('metatag.manager')
#7 /home/explorerinruins/public_html/modules/metatag/metatag.module(125): metatag_get_tags_from_route()
#8 /home/explorerinruins/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(297): metatag_page_attachments(Array)
#9 /home/explorerinruins/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(273): Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array)
#10 /home/explorerinruins/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))
#11 /home/explorerinruins/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))
#12 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#13 /home/explorerinruins/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#14 /home/explorerinruins/public_html/vendor/symfony/http-kernel/HttpKernel.php(156): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent))
#15 /home/explorerinruins/public_html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#16 /home/explorerinruins/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /home/explorerinruins/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /home/explorerinruins/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /home/explorerinruins/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /home/explorerinruins/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /home/explorerinruins/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /home/explorerinruins/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /home/explorerinruins/public_html/core/lib/Drupal/Core/DrupalKernel.php(694): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /home/explorerinruins/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#25 {main}

While I no longer have an issue, perhaps this will help someone.

dave reid’s picture

Status: Active » Closed (works as designed)

You need to run update.php and drush cache:rebuild after updating code on a site, services may change (like what happened here), and you always should make sure the service container is fresh.

maxilein’s picture

location: .../core/authorize.php/

referrer: .../core/authorize.php?batch=1&id=7843&op=start

ArgumentCountError: Too few arguments to function Drupal\metatag\MetatagToken::__construct(), 1 passed in /..../core/lib/Drupal/Component/DependencyInjection/Container.php on line 269 and exactly 2 expected in Drupal\metatag\MetatagToken->__construct() (line 36 of /..../modules/metatag/src/MetatagToken.php)

#0 /..../core/lib/Drupal/Component/DependencyInjection/Container.php(269): Drupal\metatag\MetatagToken->__construct(Object(Drupal\token\Token))
#1 /..../core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'metatag.token')
#2 /..../core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('metatag.token', 1)
#3 /..../core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#4 /..../core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'metatag.manager')
#5 /..../core/lib/Drupal.php(158): Drupal\Component\DependencyInjection\Container->get('metatag.manager')
#6 /..../modules/metatag/metatag.module(454): Drupal::service('metatag.manager')
#7 /..../modules/metatag/metatag.module(422): metatag_get_tags_from_route()
#8 /..../core/lib/Drupal/Core/Theme/ThemeManager.php(287): metatag_preprocess_html(Array, 'html', Array)
#9 /..../core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Theme\ThemeManager->render('html', Array)
#10 /..../core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, true)
#11 /..../core/lib/Drupal/Core/Render/Renderer.php(144): Drupal\Core\Render\Renderer->render(Array, true)
#12 /..../core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#13 /..../core/lib/Drupal/Core/Render/Renderer.php(145): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#14 /..../core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php(66): Drupal\Core\Render\Renderer->renderRoot(Array)
#15 /..../core/lib/Drupal/Core/ProxyClass/Render/BareHtmlPageRenderer.php(76): Drupal\Core\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)
#16 /..../core/authorize.php(203): Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)
#17 {main}

maxilein’s picture

update with a second browser window worked...

doar1004’s picture

update with a second browser window worked... --->What do you meand second browser?

damienmckenna’s picture

I'm sorry you've ran into this problem. I updated the release notes to recommend rebuilding the caches.

HNS-IT-Solutions’s picture

The issue still exists for one instance on a multisite setup
error logs still show error even after drush Cache:rebuild!

is there a further issue?

damienmckenna’s picture

HNS-IT-Solutions: Seeing as you mention a multisite setup, please confirm that there aren't multiple copies of contrib modules in the codebase, e.g. that one site doesn't have an extra copy of the Token module, etc. You might also make sure you can see any error messages that might be present on the site as I wonder if there's something else failing as part of the cache rebuild so this piece can't be properly reloaded.

greenhorn’s picture

Hello @DamienMcKenna, after installing the updates 1.12 the whole page is down. We don't have a multisite setup. Drush cr, druph updb done. Siete stays down with the output:
Fatal error: Cannot redeclare Drupal \ metatag \ Plugin \ metatag \ Tag \ Description :: form () in /path/to/project/web/modules/contrib/metatag/src/Plugin/metatag/Tag/Description.php on line 35
However, we have no error logs!
Sorry I have no idea where the error is.
How can we help solve the problem?

I currently pinned version 1.11
and the site is online again.

composer require 'drupal/metatag:1.11'

damienmckenna’s picture

Title: Upgrade to 1.12 Causes Failure of Entire Site » Upgrade to 1.12 causes site failure
Status: Closed (works as designed) » Fixed

I'm leaving this issue as "fixed" so folks can find it more easily.

@Greenhorn: Please make sure you only have one copy of the Metatag module installed - the specific error mentioned indicates that there are two copies of the src/Plugin/metatag/Tag/Description.php file in your site's codebase.

greenhorn’s picture

@DamienMcKenna,
thanks for the quick answer, does it help if i show you my composer json here? what is additionally installed is schema_metags.

{
  "name": "drupal-composer/drupal-project",
  "description": "Project template for Drupal 8 projects with composer",
  "type": "project",
  "license": "GPL-2.0-or-later",
  "authors": [
    {
      "name": "",
      "role": ""
    }
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    },
    {
      "type": "composer",
      "url": "https://asset-packagist.org"
    },
    {
      "type": "package",
      "package": {
        "name": "ckeditor-plugin/link",
        "version": "4.11.4",
        "type": "drupal-library",
        "dist": {
          "url": "https://download.ckeditor.com/link/releases/link_4.11.4.zip",
          "type": "zip"
        },
        "require": {
          "composer/installers": "~1.0"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "link",
        "version": "4.11.4",
        "type": "drupal-library",
        "dist": {
          "url": "https://download.ckeditor.com/link/releases/link_4.11.4.zip",
          "type": "zip"
        },
        "require": {
          "composer/installers": "~1.0"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "fakeobjects",
        "version": "4.11.4",
        "type": "drupal-library",
        "dist": {
          "url": "https://download.ckeditor.com/fakeobjects/releases/fakeobjects_4.11.4.zip",
          "type": "zip"
        },
        "require": {
          "composer/installers": "~1.0"
        }
      }
    }
  ],
  "require": {
    "bower-asset/dropzone": "^5.5",
    "ckeditor-plugin/link": "^4.11",
    "composer/installers": "^1.2",
    "cweagans/composer-patches": "^1.6",
    "dompdf/dompdf": "^0.8.3",
    "drupal-composer/drupal-scaffold": "^2.5",
    "drupal/admin_toolbar": "^2.0",
    "drupal/adminimal_admin_toolbar": "^1.8",
    "drupal/advagg": "^4.0",
    "drupal/anchor_link": "^2.0",
    "drupal/antibot": "^1.2",
    "drupal/backup_migrate": "^4.0",
    "drupal/better_exposed_filters": "^3.0@alpha",
    "drupal/block_field": "^1.0@alpha",
    "drupal/color_field": "^2.0",
    "drupal/config_ignore": "^2.1",
    "drupal/config_split": "^1.4",
    "drupal/console": "^1.0.2",
    "drupal/core": "^8.6.0",
    "drupal/crop": "^1.5",
    "drupal/devel": "^2.0",
    "drupal/dropzonejs": "^2.0@alpha",
    "drupal/entity_browser": "^2.1",
    "drupal/features": "^3.8",
    "drupal/field_group": "^3.0",
    "drupal/image_widget_crop": "^2.2",
    "drupal/imagecache_external": "^1.2",
    "drupal/imagemagick": "^3.1",
    "drupal/inline_entity_form": "^1.0@RC",
    "drupal/linkit": "^4.3",
    "drupal/mailsystem": "^4.1",
    "drupal/media_entity": "^1.8",
    "drupal/media_entity_browser": "2.x-dev",
    "drupal/media_entity_image": "^1.3",
    "drupal/metatag": "1.11",
    "drupal/migrate_file_to_media": "^1.0@beta",
    "drupal/migrate_plus": "^4.1",
    "drupal/migrate_tools": "^4.1",
    "drupal/minifyhtml": "^1.8",
    "drupal/module_filter": "^3.1",
    "drupal/node_revision_delete": "^1.0",
    "drupal/paragraphs": "^1.3",
    "drupal/pathauto": "^1.3",
    "drupal/private_files_download_permission": "^2.1",
    "drupal/redirect": "^1.3",
    "drupal/rename_admin_paths": "^2.0",
    "drupal/reroute_email": "^1.1",
    "drupal/schema_metatag": "^1.3",
    "drupal/search_api_attachments": "^1.0@beta",
    "drupal/search_api_autocomplete": "^1.1",
    "drupal/search_api_solr": "^3.7",
    "drupal/smtp": "^1.0@beta",
    "drupal/svg_formatter": "^1.8",
    "drupal/svg_image": "^1.9",
    "drupal/swiftmailer": "^1.0@beta",
    "drupal/twig_extender": "^2.2",
    "drupal/twig_tweak": "^2.4",
    "drupal/twig_vardumper": "^1.1",
    "drupal/views_autocomplete_filters": "^1.2",
    "drupal/views_bulk_operations": "^3.0",
    "drupal/views_data_export": "^1.0@beta",
    "drupal/viewsreference": "^1.4",
    "drupal/webform": "^5.2",
    "drupal/webform_views": "^5.0@alpha",
    "drupal/webp": "^1.0@beta",
    "drupal/xmlsitemap": "^1.0@alpha",
    "drush/drush": "^9.0.0",
    "fakeobjects": "^4.11",
    "link": "^4.11",
    "oomphinc/composer-installers-extender": "^1.1",
    "phpoffice/phpspreadsheet": "^1.6",
    "phpseclib/phpseclib": "^2.0",
    "symfony/event-dispatcher": "4.3.4 as 3.4.99",
    "vlucas/phpdotenv": "^2.4",
    "webflo/drupal-finder": "^1.0.0",
    "webmozart/path-util": "^2.3"
  },
  "require-dev": {
    "drupal/yoast_seo": "^1.5",
    "webflo/drupal-core-require-dev": "^8.6.0"
  },
  "conflict": {
    "drupal/drupal": "*"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "config": {
    "sort-packages": true
  },
  "autoload": {
    "classmap": [
      "scripts/composer/ScriptHandler.php"
    ],
    "files": [
      "load.environment.php"
    ]
  },
  "scripts": {
    "pre-install-cmd": [
      "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
    ],
    "pre-update-cmd": [
      "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
    ],
    "post-install-cmd": [
      "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
    ],
    "post-update-cmd": [
      "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
    ]
  },
  "extra": {
    "patchLevel": {
      "drupal/core": "-p2"
    },
    "installer-types": [
      "bower-asset"
    ],
    "installer-paths": {
      "web/core": [
        "type:drupal-core"
      ],
      "web/libraries/ckeditor/plugins/{$name}": [
        "vendor:ckeditor-plugin"
      ],
      "web/libraries/{$name}": [
        "type:drupal-library",
        "type:bower-asset"
      ],
      "web/modules/contrib/{$name}": [
        "type:drupal-module"
      ],
      "web/profiles/contrib/{$name}": [
        "type:drupal-profile"
      ],
      "web/themes/contrib/{$name}": [
        "type:drupal-theme"
      ],
      "drush/Commands/{$name}": [
        "type:drupal-drush"
      ]
    },
    "patches": {
      "drupal/core": {
        "migrate also if not all rows processed": "https://www.drupal.org/files/issues/2019-02-18/2797505-13.patch",
        "Allow symfony/event-dispatcher 4+ to be installed in Drupal 8": "https://www.drupal.org/files/issues/2019-09-17/2876675-48.Fix-symfony-version-requirements-for-symfonyeventdispatcher.patch"
      },
      "drupal/webp": {
        "Detect webp non-support, and display a user-friendly error message.": "https://www.drupal.org/files/issues/2019-02-07/webp-detect_webp_support-3008111-2.patch"
      },
      "drupal/smtp": {
        "SMTP Error: Could not authenticate.": "https://www.drupal.org/files/issues/2020-03-01/3114989-18.patch"
      }
    },
    "drupal-scaffold": {
      "initial": {
        ".editorconfig": "../.editorconfig",
        ".gitattributes": "../.gitattributes"
      }
    }
  }
}
greenhorn’s picture

@DamienMcKenna,
You will be surprised now, but I am also very surprised. I did the following:
after pinning the version i searched for copies of the src / plugin / metatag / tag / description.php.
ls -la web / modules / contrib / metatag / src / Plugin / metatag / Tag /
no duplicates found:
then composer require 'drupal / metatag'
version 1.12 was installed and I had no errors .....
what was that?
well it doesn't matter thanks again for your commitment
best regards greenhorn

damienmckenna’s picture

Glad you were able to get it working.

greenhorn’s picture

@DamienMcKenna,
yes I still anyway, generally a big thank you to you drupal developers, without you we are pretty stupid.
Thank you!

milan.durovic’s picture

I'm not a PHP or Drupal expert, but the error message suggests that a signature of the constructor has changed and it looks like what framework expects is different to what the new version provides. Isn't cache just data? How can that cause this problem? I've tried this upgrade a few times and it consistently fails, so I'm not sure how can this issue be marked as fixed when it's not? If seeing errors like this does not indicate an error, how can users tell when genuine error occurs?

damienmckenna’s picture

Title: Upgrade to 1.12 causes site failure » Upgrade to 1.12 causes site failure - suggested fix: try rebuilding sites caches

@milan.durovic: Yes, the cache is just data. Drupal's internal pointers regarding which service is connected to what is stored in its caches. When there's a change in the services structures they're updated by rebuilding the site's caches, which you can do by loading the /core/rebuild.php page through your browser, using a Drush command, or from the /admin/config/development/performance page. The issue is marked "fixed" because originally I set it to "works as designed", but realized that this would hide the issue so folks wouldn't find it very easily. The issue was marked "works as designed" because the problem can be fixed by rebuilding the site's caches. If you can successfully rebuild the site's caches and there's still a problem then we'll talk, but please try clearing/rebuilding the caches first. Thank you.

milan.durovic’s picture

This will be the last post from me on this topic: am I to take that the error we're seeing is unavoidable, whatever we do? I did the following:

1) restored the site from the full backup I had before the upgrade.
2) I went to admin, Configuration/Performance page, then clicked on "Clear all caches" button. I didn't do this step in my previous attempts
3) now I tried upgrading the Metatag module

I was expecting, from the explanations given in this thread, that if the caches were a problem, and I clear them JUST BEFORE the upgrade, that I won't see the error. However, the error message still came up, unchanged.

I don't know the mechanics of how module upgrades are executed, but wouldn't there be a hook or something, like "pre-install" step, where you could clear the caches or whatever else is needed to be done, so that the upgrade goes smoothly?

damienmckenna’s picture

When Drupal 8 rebuilds the caches it does so based upon the current codebase - it scans what's currently in the codebase and prepares the site to be loaded again with the new cached data. This means that rebuilding the caches needs to be done after making changes to the codebase, not before.

Had I realized that the caches needed to be rebuilt I could have added an empty update script to trigger the cache rebuilding, but given it can be done by the methods mentioned above I figured site maintainers might have been able to handle that when a mention was left in the release notes.

So please try rebuilding the site caches after updating the codebase and let me know if the problem still exists.

milan.durovic’s picture

Thanks Damien

sthomen’s picture

I just bumped into this, fortunately I was unsure enough about the update procedure to first try it on a copy in a docker container.

What you can do (and what maxilein in #5 above presumably did), if you don't have access to a shell on the webserver, is to keep the performance (Configuration > Development > Performance) page up in a separate tab, and when the update explodes in your face click the Clear all caches button. This seems to resolve the problem. Visiting core/rebuild.php did not help at all for me, presumably because the metatag module attempts to set headers so the module is "activated", and blows up before the cache can be rebuilt.

floown’s picture

Hello,

I have the same that un #1 message. I have follow all the ways exposed in this thread:
— update.php : ok
— the site came back again
— I rebuild the cache (drush cr) and in Performance in the admin gui
— But I try this to reassure me:

$ drush updb                            
 [error]  TypeError: Argument 1 passed to Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer::__construct() must be an instance of Drupal\Core\DependencyInjection\Container, instance of Drupal\Core\DependencyInjection\ContainerBuilder given in Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer->__construct() (line 39 of /home/admin/web/dev4.mydomain.com/public_html/web/modules/contrib/upgrade_status/src/ThemeFunctionDeprecationAnalyzer.php) #0 [internal function]: Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer->__construct(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#1 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1176): ReflectionClass->newInstanceArgs(Array)
#2 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, false, 'upgrade_status....')
#3 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1281): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('upgrade_status....', 1, Array, false)
#4 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1238): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Component\DependencyInjection\Reference), Array, false)
#5 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1149): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, false)
#6 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, false, 'upgrade_status....')
#7 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1281): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('upgrade_status....', 1, Array, false)
#8 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1238): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Component\DependencyInjection\Reference), Array, false)
#9 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1149): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, false)
#10 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, false, 'upgrade_status....')
#11 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1281): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('upgrade_status....', 1, Array, false)
#12 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1238): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Component\DependencyInjection\Reference), Array, false)
#13 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1646): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array)
#14 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1197): Symfony\Component\DependencyInjection\ContainerBuilder->callMethod(Object(Drush\Command\ServiceCommandlist), Array, Array)
#15 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, true, 'drush.command.s...')
#16 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(588): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('drush.command.s...', 1)
#17 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/DrupalBoot8.php(290): Symfony\Component\DependencyInjection\ContainerBuilder->get('drush.command.s...')
#18 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/DrupalBoot8.php(256): Drush\Boot\DrupalBoot8->addDrupalModuleDrushCommands(Object(Drush\Boot\BootstrapManager))
#19 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/BootstrapManager.php(293): Drush\Boot\DrupalBoot8->bootstrapDrupalFull(Object(Drush\Boot\BootstrapManager), Object(Consolidation\AnnotatedCommand\AnnotationData))
#20 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/BootstrapManager.php(447): Drush\Boot\BootstrapManager->doBootstrap(5, 5, Object(Consolidation\AnnotatedCommand\AnnotationData))
#21 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/BootstrapManager.php(396): Drush\Boot\BootstrapManager->bootstrapToPhaseIndex(5, Object(Consolidation\AnnotatedCommand\AnnotationData))
#22 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/BootstrapHook.php(28): Drush\Boot\BootstrapManager->bootstrapToPhase('full', Object(Consolidation\AnnotatedCommand\AnnotationData))
#23 /home/admin/web/dev4.mydomain.com/public_html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(34): Drush\Boot\BootstrapHook->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#24 /home/admin/web/dev4.mydomain.com/public_html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(27): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook(Object(Drush\Boot\BootstrapHook), Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#25 /home/admin/web/dev4.mydomain.com/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(145): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#26 /home/admin/web/dev4.mydomain.com/public_html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(289): Consolidation\AnnotatedCommand\CommandProcessor->initializeHook(Object(Drush\Symfony\DrushArgvInput), Array, Object(Consolidation\AnnotatedCommand\AnnotationData))
#27 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/console/Command/Command.php(221): Consolidation\AnnotatedCommand\AnnotatedCommand->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#34 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/includes/preflight.inc(18): require('/home/admin/web...')
#35 phar:///usr/local/bin/drush/bin/drush.php(141): drush_main()
#36 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#37 {main}. 
TypeError: Argument 1 passed to Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer::__construct() must be an instance of Drupal\Core\DependencyInjection\Container, instance of Drupal\Core\DependencyInjection\ContainerBuilder given in /home/admin/web/dev4.mydomain.com/public_html/web/modules/contrib/upgrade_status/src/ThemeFunctionDeprecationAnalyzer.php on line 39 #0 [internal function]: Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer->__construct(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#1 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1176): ReflectionClass->newInstanceArgs(Array)
#2 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, false, 'upgrade_status....')
#3 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1281): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('upgrade_status....', 1, Array, false)
#4 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1238): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Component\DependencyInjection\Reference), Array, false)
#5 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1149): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, false)
#6 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, false, 'upgrade_status....')
#7 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1281): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('upgrade_status....', 1, Array, false)
#8 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1238): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Component\DependencyInjection\Reference), Array, false)
#9 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1149): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, false)
#10 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, false, 'upgrade_status....')
#11 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1281): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('upgrade_status....', 1, Array, false)
#12 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1238): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Component\DependencyInjection\Reference), Array, false)
#13 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1646): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array)
#14 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(1197): Symfony\Component\DependencyInjection\ContainerBuilder->callMethod(Object(Drush\Command\ServiceCommandlist), Array, Array)
#15 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(634): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, true, 'drush.command.s...')
#16 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(588): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('drush.command.s...', 1)
#17 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/DrupalBoot8.php(290): Symfony\Component\DependencyInjection\ContainerBuilder->get('drush.command.s...')
#18 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/DrupalBoot8.php(256): Drush\Boot\DrupalBoot8->addDrupalModuleDrushCommands(Object(Drush\Boot\BootstrapManager))
#19 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/BootstrapManager.php(293): Drush\Boot\DrupalBoot8->bootstrapDrupalFull(Object(Drush\Boot\BootstrapManager), Object(Consolidation\AnnotatedCommand\AnnotationData))
#20 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/BootstrapManager.php(447): Drush\Boot\BootstrapManager->doBootstrap(5, 5, Object(Consolidation\AnnotatedCommand\AnnotationData))
#21 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/BootstrapManager.php(396): Drush\Boot\BootstrapManager->bootstrapToPhaseIndex(5, Object(Consolidation\AnnotatedCommand\AnnotationData))
#22 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Boot/BootstrapHook.php(28): Drush\Boot\BootstrapManager->bootstrapToPhase('full', Object(Consolidation\AnnotatedCommand\AnnotationData))
#23 /home/admin/web/dev4.mydomain.com/public_html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(34): Drush\Boot\BootstrapHook->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#24 /home/admin/web/dev4.mydomain.com/public_html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(27): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook(Object(Drush\Boot\BootstrapHook), Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#25 /home/admin/web/dev4.mydomain.com/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(145): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Consolidation\AnnotatedCommand\AnnotationData))
#26 /home/admin/web/dev4.mydomain.com/public_html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(289): Consolidation\AnnotatedCommand\CommandProcessor->initializeHook(Object(Drush\Symfony\DrushArgvInput), Array, Object(Consolidation\AnnotatedCommand\AnnotationData))
#27 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/console/Command/Command.php(221): Consolidation\AnnotatedCommand\AnnotatedCommand->initialize(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /home/admin/web/dev4.mydomain.com/public_html/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#34 /home/admin/web/dev4.mydomain.com/public_html/vendor/drush/drush/includes/preflight.inc(18): require('/home/admin/web...')
#35 phar:///usr/local/bin/drush/bin/drush.php(141): drush_main()
#36 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#37 {main}
TypeError: Argument 1 passed to Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer::__construct() must be an instance of Drupal\Core\DependencyInjection\Container, instance of Drupal\Core\DependencyInjection\ContainerBuilder given in Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer->__construct() (line 39 of /home/admin/web/dev4.mydomain.com/public_html/web/modules/contrib/upgrade_status/src/ThemeFunctionDeprecationAnalyzer.php).
 [warning] Drush command terminated abnormally.

What’s the problem?

Regards.

damienmckenna’s picture

@floown: the first part of that says:

TypeError: Argument 1 passed to Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer::__construct() must be an instance of Drupal\Core\DependencyInjection\Container, instance of Drupal\Core\DependencyInjection\ContainerBuilder given in Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer->__construct() (line 39 of /home/admin/web/dev4.mydomain.com/public_html/web/modules/contrib/upgrade_status/src/ThemeFunctionDeprecationAnalyzer.php) #0 [internal function]: Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer->__construct(Object(Drupal\Core\DependencyInjection\ContainerBuilder))

That says "upgrade_status", so maybe check for an updated version of that module that fixes this bug?

floown’s picture

Sorry Damien,

You have right. I’m a eternal newbie with Drupal and not so at ease with english to cope on my own.

I just apply a : composer require 'drupal/upgrade_status:2.x-dev' : the bug has been solved.

My special regards ;)

karenann’s picture

FWIW, I did the following and still got the error.

composer require 'drupal/metatag:^1.12'
drush @sites updb -y
drush @sites cr -y

I'm gonna hang out with 8.x-1.11 in my repo due to my own time constraints.

karenann’s picture

So, I decided to do all my other updates before digging back into this.

It's probably not completely relevant but I'll share what else I updated:

  • 'drupal/admin_toolbar:^2.2'
  • 'drupal/blockgroup:^1.2'
  • 'drupal/calendar:^1.0'
  • 'drupal/ctools:^3.4'
  • 'drupal/entity:^1.0'
  • 'drupal/entity_reference_revisions:^1.8'
  • 'drupal/entity_embed:^1.1'
  • 'drupal/menu_trail_by_path:^1.3'
  • 'drupal/paragraphs:^1.11'
  • 'drupal/permissions_by_term:^2.18'
  • 'drupal/restui:^1.18'
  • 'drupal/siteimprove:^1.5'
  • 'drupal/simple_sitemap:^3.6'
  • 'drupal/views_bulk_operations:^3.6'
  • 'drupal/video_embed_field:^2.3'
  • 'drupal/views_infinite_scroll:^1.7'
  • 'drupal/views_templates:^1.1'
  • 'drupal/webform:^5.9'
  • 'drupal/core:8.8.5'

Once all of these were done, I ran composer require 'drupal/metatag:^1.12' again.

I see there are no db updates and no config changes.

Once I ran the drush @sites cr -y, as I'm in a multisite setup, things seemed better.

damienmckenna’s picture

Status: Fixed » Needs review
Parent issue: » #3122327: Plan for Metatag 8.x-1.13
StatusFileSize
new537 bytes

Am going to add an update script to 8.x-1.13, this should trigger the cache rebuild that sites need.

Status: Needs review » Needs work

The last submitted patch, 30: metatag-n3123665-30.patch, failed testing. View results

damienmckenna’s picture

Status: Needs work » Needs review

I fixed the branch tests in 8.x-1.x for the 8.8.x core branch, so let's run the tests again.

  • DamienMcKenna committed fb24fb4 on 8.x-1.x
    Issue #3123665 by DamienMcKenna, Greenhorn, milan.durovic,...
damienmckenna’s picture

Status: Needs review » Fixed

Committed. The next release will include this update script and so updating should be a-ok.

Status: Fixed » Closed (fixed)

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

jasonawant’s picture

FWIW - I recently came across the output of "The sites's caches will need to be rebuild to ensure Metatag works as intended.", and it reminded me of this core usage of hook_post_update_NAME here in this example usage.

/**
 * Rebuild caches to ensure schema changes are read in.
 */
function views_post_update_grouped_filters() {
  // Empty update to cause a cache rebuild so that the schema changes are read.
}

Looking more closely at this change, I found this CR and policy: Use hook_post_update_NAME instead of hook_update_N to clear the cache. Just sharing this year in case anyone else comes across this.