Page MenuHomePhabricator

500 error in db upgrade stage due to output buffer reset in stdout
Closed, ResolvedPublic


Author: woozle

Symptom: upon reaching the "Upgrade existing installation" stage -- my exact URL is -- the installer hangs with a 500 error.

After detailed investigation, I found that the problem occurs after the 10th iteration of DatabaseUpdater::runUpdates(). The problem seems to be that the next call to $this->output() (which is actually Maintenance::output()) in ConvertLinks::execute() writes text to the BEGINNING of the output buffer instead of to the END. This mungs the HTTP headers in a way which apparently makes Apache very unhappy.

(I determined this by sending different text, which somehow changed the situation so that instead of a 500 error, I received the page as a file download -- which allowed me to see the source text that was being sent, which contained my text at the beginning -- before the HTTP headers.)

This is probably a kluge, but I was able to stop the error from happening by changing the line "$f = fopen( 'php://stdout', 'w' );" to "$f = fopen( 'php://output', 'a' );".

Now it gets all the way to "Populating log_search table" before hanging (at least there's no 500 error).

Version: 1.17.x
Severity: blocker
OS: Linux
Platform: PC


TitleReferenceAuthorSource BranchDest Branch
expand setup.tag to $KOKKURI_PIPELINE_TIMESTAMP-$BUILD_VARIANTrepos/releng/pipeline-to-gitlab!3dancyreview/dancy/setup-tagmaster
Use pipeline timestamp and build variant for default image tagrepos/releng/pipeline-to-gitlab!2kharlankharlan-master-patch-39957master
Define KOKKURI_PIPELINE_TIMESTAMP in KOKKURI_DOTENV_PATHrepos/releng/kokkuri!76dancyreview/dancy/pipeline-timestampmain
Add support for tag templatesrepos/releng/kokkuri!75dancyreview/dancy/tags-date-templatemain
gitlab: Use date format for tagged imagesrepos/mediawiki/services/ipoid!5kharlangitlab-use-datemain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:56 PM
bzimport set Reference to bz31822.

Reopening. This cause bug 32325 on PHP 5.2.6 and earlier because of PHP Bug 45303

Cleaned up in r103179, reclosing.