Page MenuHomePhabricator

Sessions can only be imported when none is active.
Closed, ResolvedPublicPRODUCTION ERROR

Description

From exception.log:

2016-01-27 20:28:40 mw1014 commonswiki exception ERROR: [5053f78f] /rpc/RunJobs.php?wiki=commonswiki&type=AssembleUploadChunks&maxtime=30&maxmem=300M   MWException from line 549 of /srv/mediawiki/php-1.27.0-wmf.11/includes/context/RequestContext.php: Sessions can only be imported when none is active. {"exception_id":"5053f78f"} 
[Exception MWException] (/srv/mediawiki/php-1.27.0-wmf.11/includes/context/RequestContext.php:549) Sessions can only be imported when none is active.
  #0 /srv/mediawiki/php-1.27.0-wmf.11/includes/jobqueue/jobs/AssembleUploadChunksJob.php(37): RequestContext::importScopedSession(array)
  #1 /srv/mediawiki/php-1.27.0-wmf.11/includes/jobqueue/JobRunner.php(257): AssembleUploadChunksJob->run()
  #2 /srv/mediawiki/php-1.27.0-wmf.11/includes/jobqueue/JobRunner.php(176): JobRunner->executeJob(AssembleUploadChunksJob, BufferingStatsdDataFactory, integer)
  #3 /srv/mediawiki/rpc/RunJobs.php(45): JobRunner->run(array)
  #4 {main}

Somehow the chunked upload assembly jobs have persistent sessions even though they shouldn't.

Event Timeline

Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr subscribed.
Restricted Application added subscribers: StudiesWorld, Steinsplitter, Aklapper. · View Herald Transcript

I tried chunked upload on Commons and it worked fine. No log message either; this must only occur in some kind of edge case.

Per https://logstash.wikimedia.org/#dashboard/temp/AVKFDMxaptxhN1XaNNaR about 10 failed uploads so far, from different users. Sometimes it's the PublisStashedUpload job that fails.

Change 266923 had a related patch set uploaded (by Anomie):
RequestContext::exportSession() should only export persisted session IDs

https://gerrit.wikimedia.org/r/266923

To reproduce this I had to do the following:

  • Arrange for at least two AssembleUploadChunks jobs to be pending
  • Run it using logic like in /rpc/RunJobs.php, not maintenance/runJobs.php, likely because the latter doesn't activate MediaWiki\Session\PHPSessionHandler IIRC

Change 266923 merged by jenkins-bot:
RequestContext::exportSession() should only export persisted session IDs

https://gerrit.wikimedia.org/r/266923

Change 266946 had a related patch set uploaded (by Gergő Tisza):
RequestContext::exportSession() should only export persisted session IDs

https://gerrit.wikimedia.org/r/266946

Change 266946 merged by jenkins-bot:
RequestContext::exportSession() should only export persisted session IDs

https://gerrit.wikimedia.org/r/266946

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM