Since last two updates 11.4.11 and 11.4.12, when I run update.php I get the following error:
The website encountered an unexpected error. Try again later.
TypeError: Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer::renderBarePage(): Argument #1 ($content) must be of type array, false given, called in /web/htdocs/www.mysite.it/home/web/core/modules/system/src/Controller/DbUpdateContro... on line 211 in Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage() (line 73 of core/lib/Drupal/Core/ProxyClass/Render/BareHtmlPageRenderer.php).
Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage() (Line: 211)
Drupal\system\Controller\DbUpdateController->handle()
call_user_func_array() (Line: 115)
Drupal\Core\Update\UpdateKernel->handleRaw() (Line: 76)
Drupal\Core\Update\UpdateKernel->handle() (Line: 34)
Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (Line: 32)
require() (Line: 22)
require_once() (Line: 13)
Unfortunately my hosting service does not support SSH so I cannot use drush. Until 11.4.10 I hade no issues running update.php after the updates.
Any suggestion?
Thanks.
Comments
Comment #2
cilefen commentedThis has been reported in the past but there never seems to be enough information to characterize a bug. I attached an issue with the same error. If you didn’t already see it, would you please read it?
Comment #3
starcruiser commentedHi @cilefen, thanks a lot for the reply.
Yes, my issue seems very similar to the one described in the other issue.
Like in that case, the issue started randomly. In my case, since I am in a shared hosting with no SSH, I already have a local copy of the site, where I do the updates that then I transfer to the production site, but just like it is described by the other user, if I sun update.php on the local site I have no issues, while on the production I have it.
I am not sure how this can be relevant, but Gemini AI says the following when I asked for help: the update.php controller (DbUpdateController) attempts to render the update page by passing a boolean value (false) instead of a render array—an incompatibility rendered critical by the strict type handling in PHP 8.5 on Drupal 11.
When I further asked to suggest a possible solution, the suggestion was to update the line 211 of DbUpdateController.php this way:
The patch seemed to solve the issue, because I was not getting the error anymore, but the update page was showing empty on the right side where usually you have the message that says if you have updates pending or not...
When I asked Gemini for a reason of this new issue, the reply was: This new error occurs because, while rendering the update page, Twig (Drupal’s template engine) expects to find a valid array within the render structure, but instead encounters a boolean value (`false`) assigned to a numeric key ("0"). This happens because certain components of the active theme or modules are passing data that is incompatible with newer versions of Drupal.
Because I am not an expert and I did not want to mess up more with the core code, I restored the original version DbUpdateController.php, but I am still not able to run update.php on the production site.
Comment #4
cilefen commentedThe most correct thing the AI said is, "This happens because certain components of the active theme or modules are passing data that is incompatible with newer versions of Drupal." That's true. At this stage, you need to look up the names and versions of the installed modules and themes, check whether they need upgrading, and note that any patches on the site may be out of date.