Subrequests in an KernelEvents::TERMINATE event subscriber (f.e. cron tasks doing subrequests) try to restart a session, resulting in runtime exceptions

Created on 2 February 2018, over 7 years ago
Updated 24 May 2025, 3 months ago

When cron runs, I get this runtime exception every time, but with various referrers. Most of the cron sessions work fine:

RuntimeException: Failed to start the session because headers have already been sent by "/home1/suppotf0/public_html/core/modules/big_pipe/src/Render/BigPipe.php" at line 264. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 135 of /home1/suppotf0/public_html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php).

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

request processing system

Created by

πŸ‡ΊπŸ‡ΈUnited States sbogner@insightcp.com

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • πŸ‡¦πŸ‡ΊAustralia nigelcunningham Geelong

    FWIW, I'm having similar issues because I'm implementing support for sending content updates via websockets on the tail of requests (looking at which cache tags were invalidated). The particular scenario I'm currently facing is that I've serialised the render array for a view when the user initially rendered the page. Now another request has modified the content and I'm seeking to re-render the view, but it has an exposed form and Formbuilder is seeking to check whether the session has a batch form state (line 253 of FormBuilder.php).

    Fun!

Production build 0.71.5 2024