Harden _batch_page() against missing or invalid operations

Created on 20 September 2022, over 2 years ago
Updated 3 January 2025, 3 months ago

Problem/Motivation

Warning: Undefined variable $response in _batch_page() (Zeile 107 in /web/core/includes/batch.inc).

followed by

Warning: Undefined array key "function" in Drupal\Core\Utility\Error::getLastCaller() (Zeile 130 in /web/core/lib/Drupal/Core/Utility/Error.php).

followed by

Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException: The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned null. Did you forget to add a return statement somewhere in your controller? in () (Zeile 98 in /web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php).

followed by

Warning: Undefined array key "function" in Drupal\Core\Utility\Error::getLastCaller() (Zeile 130 in /web/core/lib/Drupal/Core/Utility/Error.php).

  • PHP-Version: 8.0.23
  • Drupal Version: 9.4.6
  • Webserver: Apache (PHP FPM)
  • Database: 10.3.34-MariaDB-0ubuntu0.20.04.1

Steps to reproduce

When running any batch job like manually fetching update information or updating translation information. For example open /admin/reports/updates/check
The batch job starts, then the issue (WSOD) appears.

No idea what may cause this or since when the issue exists.

In the access logs I can see the following calls:

  1. GET /admin/reports/updates/check?destination=/admin/theme/update&token=XXX
  2. GET /batch?id=1568&op=start
  3. GET /core/misc/batch.js?1663685782
  4. Error GET /batch?id=1568&op=do_nojs
  5. POST /batch?id=1568&op=do_nojs&op=do&_format=json
  6. AH01071: Got error 'PHP message: Uncaught PHP Exception Symfony\\Component\\HttpKernel\\Exception\\ControllerDoesNotReturnResponseException: "The controller must return a "Symfony\\Component\\HttpFoundation\\Response" object but it returned null. Did you forget to add a return statement somewhere in your controller?" at

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Closed: works as designed

Version

11.0 🔥

Component

batch system

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India bhanu951

    Closing it as works as designed.

    @anybody please reopen the issue if thats not the case.

  • 🇩🇪Germany Anybody Porta Westfalica

    @longwave what do you think about closing this works as designed? I'd rather like to keep this open, but am not deep enough into this to be sure.

Production build 0.71.5 2024