When running "drush updb" I got this error message:

LogicException: Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use         [error]
renderPlain()/renderRoot() or #lazy_builder/#pre_render instead. in
/var/www/drupal/web/core/lib/Drupal/Core/Render/Renderer.php:241
Stack trace:
#0 /var/www/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#1 /var/www/drupal/web/modules/contrib/xmlsitemap/xmlsitemap.install(35): Drupal\Core\Render\Renderer->render(Array)
#2 [internal function]: xmlsitemap_requirements('update')
#3 /var/www/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('xmlsitemap_requ...', Array)
#4 /var/www/drupal/web/core/includes/update.inc(98): Drupal\Core\Extension\ModuleHandler->invokeAll('requirements', Array)
#5 /var/www/drupal/vendor/drush/drush/commands/core/drupal/update.inc(203): update_check_requirements()
#6 /var/www/drupal/vendor/drush/drush/commands/core/drupal/update.inc(134): drush_update_check_requirements()
#7 /var/www/drupal/vendor/drush/drush/commands/core/core.drush.inc(462): update_main()
#8 /var/www/drupal/vendor/drush/drush/includes/command.inc(422): drush_core_updatedb()
#9 /var/www/drupal/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#10 /var/www/drupal/vendor/drush/drush/includes/command.inc(199): drush_command()
#11 /var/www/drupal/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#12 /var/www/drupal/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#13 /var/www/drupal/vendor/drush/drush/drush.php(12): drush_main()
#14 {main}

As the message suggested, I tried changing the ->render() calls to ->renderPlain() in xmlsitemap.install and after that everything worked fine again.

Attaching patch in comment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Rade created an issue. See original summary.

Rade’s picture

Patch attached against latest dev version.

Dave Reid’s picture

Fixed a couple of things that were also not rendered correctly.

  • Dave Reid committed 898b1d7 on 8.x-1.x
    Issue #2956643 by Rade, Dave Reid: Fixed xmlsitemap_requirements()...
Dave Reid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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