Page MenuHomePhabricator

session_name(): Cannot change session name when headers already sent in CommonSettings.php on line 510
Open, LowPublic

Description

Warning: session_name(): Cannot change session name when headers already sent in /srv/mediawiki-staging/wmf-config/CommonSettings.php on line 510

appears numerous times during beta-update-databases-eqiad

https://integration.wikimedia.org/ci/job/beta-update-databases-eqiad/39602/console

Event Timeline

I may be wrong, but errors like this one ("headers already sent") are often seen with some kinds of fatal errors. One specific type that seems to consistently cause this notice is a TypeError due to mismatching types in function calls. Hence, I believe this is actually a side effect of T243218.

I may be wrong, but errors like this one ("headers already sent") are often seen with some kinds of fatal errors.

It's possible, though it's happening for every wiki before.. And that can't appear retroactively

15:20:03 #!/usr/bin/env php
15:20:03 Warning: session_name(): Cannot change session name when headers already sent in /srv/mediawiki-staging/wmf-config/CommonSettings.php on line 510
15:20:03 MediaWiki 1.35.0-alpha Updater

Hmmmm interesting. I can think of two main reasons:

  • Some other PHP error/warning/notice is causing this. It should be possible, if the warning in question is hidden for any reason (e.g. error_reporting). In this case, we should first identify the underlying warning.
  • We're indeed sending headers intentionally before the session_name call. This could be a recent regression; we could try to figure it out by calling headers_list / headers_sent($file, $line) before line 510.

Also: what happens if you execute update.php manually?

Reedy triaged this task as Low priority.Jan 21 2020, 5:02 PM