RuntimeException: Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() func Failed to start the session because headers have already been sent by "" at line 0. (/xxx/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php 152)

#0 /xxx/web/core/lib/Drupal/Core/Session/SessionManager.php(162): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
#1 /xxx/web/core/lib/Drupal/Core/Session/SessionManager.php(193): Drupal\Core\Session\SessionManager->startNow()
#2 /xxx/vendor/symfony/http-foundation/Session/Session.php(189): Drupal\Core\Session\SessionManager->save()
#3 /xxx/web/core/lib/Drupal/Core/StackMiddleware/Session.php(60): Symfony\Component\HttpFoundation\Session\Session->save()
#4 /xxx/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle()
#5 /xxx/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#6 /xxx/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#7 /xxx/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle()
#8 /xxx/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#9 /xxx/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#10 /xxx/web/core/lib/Drupal/Core/DrupalKernel.php(716): Stack\StackedHttpKernel->handle()
#11 /xxx/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#12 {main}

apache2, php 7.4, debian 10; I have installed drupal 9 on it but I am getting this error. what could be missing?

Comments

Okipa created an issue. See original summary.

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative
Okipa’s picture

my error is in anonymous user before login

larowlan’s picture

Do you have any modules that are printing output before the session is started?
Or perhaps some php files with blank lines before the opening <?php

Okipa’s picture

commerce module. Anonymous user cannot add product to cart.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

kristen pol’s picture

Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)". This issue was marked "Postponed (maintainer needs more info)" over a year ago.

@Okipa Did you ever resolve this issue? If so, would you provide information on how? If not, would you provide a list of all contributed modules/themes you are using? Perhaps there is an issue with one of them.

Thanks!

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nicxvan’s picture

Assigned: Okipa » Unassigned
Status: Postponed (maintainer needs more info) » Active

This is happening for me now on 10.1 when indexing using search api:

RuntimeException while trying to render item entity:node/75890:en with view mode full for search index Search Site: Failed to start the session because headers have already been sent by "/var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php" at line 264. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 132 of /var/www/html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php).

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

This is postponed because information is needed.

nicxvan’s picture

Sorry I missed the request for modules installed, is there something else you need?

Core Automated Cron (automated_cron) Enabled 10.1.0
Core BigPipe (big_pipe) Enabled 10.1.0
Core Block (block) Enabled 10.1.0
Core Block Content (block_content) Enabled 10.1.0
Core Breakpoint (breakpoint) Enabled 10.1.0
Core CKEditor 5 (ckeditor5) Enabled 10.1.0
Core Configuration Manager (config) Enabled 10.1.0
Core Contextual Links (contextual) Enabled 10.1.0
Field types Datetime (datetime) Enabled 10.1.0
Core Database Logging (dblog) Enabled 10.1.0
Core Internal Dynamic Page Cache Enabled 10.1.0
(dynamic_page_cache)
Core Text Editor (editor) Enabled 10.1.0
Core Field (field) Enabled 10.1.0
Core Field UI (field_ui) Enabled 10.1.0
Field types File (file) Enabled 10.1.0
Core Filter (filter) Enabled 10.1.0
Field types Image (image) Enabled 10.1.0
Field types Link (link) Enabled 10.1.0
Core Custom Menu Links (menu_link_content) Enabled 10.1.0
Core Menu UI (menu_ui) Enabled 10.1.0
Migration Migrate (migrate) Enabled 10.1.0
Core MySQL (mysql) Enabled 10.1.0
Core Node (node) Enabled 10.1.0
Field types Options (options) Enabled 10.1.0
Core Internal Page Cache (page_cache) Enabled 10.1.0
Core Path (path) Enabled 10.1.0
Core Path alias (path_alias) Enabled 10.1.0
Core Password Compatibility (phpass) Enabled 10.1.0
Web services Serialization (serialization) Enabled 10.1.0
Core System (system) Enabled 10.1.0
Core Taxonomy (taxonomy) Enabled 10.1.0
Field types Text (text) Enabled 10.1.0
Core Toolbar (toolbar) Enabled 10.1.0
Core Update Manager (update) Enabled 10.1.0
Core User (user) Enabled 10.1.0
Core Views (views) Enabled 10.1.0
Core Views UI (views_ui) Enabled 10.1.0
Administration Admin Toolbar (admin_toolbar) Enabled 3.3.0
Administration Admin Toolbar Extra Tools Enabled 3.3.0
(admin_toolbar_tools)
Views Better Exposed Filters Enabled 6.0.3
(better_exposed_filters)
Config Config Filter (config_filter) Enabled 8.x-1.10
Config Configuration Split (config_split) Enabled 8.x-1.9
Elasticsearch Elasticsearch Connector Enabled 8.x-7.0-alpha4
(elasticsearch_connector)
(elasticsearch_connector_views)
Search Elasticsearch - Search API Enabled
(elasticsearch_search_api)
Entity Entity Redirect (entity_redirect) Enabled 8.x-2.2
Search Facets (facets) Enabled 2.0.6
Search Facets Searchbox Widget Enabled 2.0.6
(facets_searchbox_widget)
Search Facets autocomplete Enabled 2.1.1
(facets_autocomplete)
Fields Inline Entity Form Enabled 8.x-1.0-rc14
(inline_entity_form)
jQuery UI jQuery UI (jquery_ui) Enabled 8.x-1.6
jQuery UI jQuery UI Datepicker Enabled 2.0.0
(jquery_ui_datepicker)
jQuery UI jQuery UI Slider (jquery_ui_slider) Enabled 2.0.0
jQuery UI jQuery UI Touch Punch Enabled 1.1.0
(jquery_ui_touch_punch)
Field types JSON Field (json_field) Enabled 8.x-1.2
Field types JSON Field Widget (json_field_widget) Enabled 8.x-1.2
Migration Migrate Plus (migrate_plus) Enabled 6.0.1
Migration Migrate Source CSV Enabled 8.x-3.5
(migrate_source_csv)
Migration Migrate Tools (migrate_tools) Enabled 6.0.1
Other Rabbit Hole taxonomy (rh_taxonomy) Enabled 8.x-1.0-beta11
Other Rabbit Hole (rabbit_hole) Enabled 8.x-1.0-beta11
Schema.org Schema.org Blueprints JSON-LD Enabled
Blueprints API (schemadotorg_jsonld)
Schema.org Schema.org Blueprints UI Enabled
Blueprints (schemadotorg_ui)
Schema.org Schema.org Blueprints (schemadotorg) Enabled
Blueprints
Search Search API (search_api) Enabled 8.x-1.29
Search Algolia Search (search_api_algolia) Enabled 3.0.0-beta7
Other Storage Entities (storage) Enabled 1.2.6
Other Token (token) Enabled 8.x-1.11
Administration Upgrade Status (upgrade_status) Enabled 4.0.0-alpha1
Views Views Aggregator Plus Enabled 2.0.1
(views_aggregator)
Core Claro (claro) Enabled 10.1.0
Core Stable 9 (stable9) Enabled 10.1.0

cilefen’s picture

The question was about contributed modules. Anyway, what about comment #4?

nicxvan’s picture

I'll check for empty lines before <?php, it's going to take a bit of time.

I don't have any module printing before the session starts that I'm aware of.

Search api is trying to render the content so I can index the rendered content so maybe that is triggering the issue.

nicxvan’s picture

Related issue in search api

nicxvan’s picture

Ok I had a chance to check, I don't see any modules with empty space before the php tag.

I think in my case it's from trying to render items to index them. I posted the related issue.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nicxvan’s picture

Status: Postponed (maintainer needs more info) » Active

Forgot to move this back to active after answering.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

The OP did not reply so this should probably be closed.

Later comments about search API strongly point to the existing issue in #15 as the main discussion area.

nicxvan’s picture

Status: Postponed (maintainer needs more info) » Active

Sorry, do you mean that Search api has a bug in how it's render for indexing functionality?
How can we be sure the issue is there and not with BigPipe?

Okipa may not have replied, but I've experienced the same issue and responded with the requested info.

What information is the maintainer still requesting that was not answered?

Two questions I see:
Do you have any modules that are printing output before the session is started?
Or perhaps some php files with blank lines before the opening <?php

I listed all modules for that project and checked for the extra space in my project.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.