Page MenuHomePhabricator

Additional error handling needed in OATHAuthHooks::schemaUpdateOldUsers
Closed, ResolvedPublic

Description

In the event that database format upgrade fails because row data cannot be unserialized, the script errors fatally. Additional error handling is needed, or perhaps detection of row format to determine if the row data has already been upgraded.

Event Timeline

			MediaWiki\suppressWarnings();
			$scratchTokens = unserialize( base64_decode( $row->scratch_tokens ) );
			MediaWiki\restoreWarnings();

would be enough to stop the noise, but isn't really checking for whether things are already migrated

Change 311201 had a related patch set uploaded (by Reedy):
Suppress unserialize errors

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

Change 311201 merged by jenkins-bot:
Suppress unserialize errors

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

Reedy triaged this task as Low priority.Oct 31 2016, 2:45 PM
Reedy renamed this task from Additional error handling needed in maintenance/update_scratch_token_format.php to Additional error handling needed in OATHAuthHooks::schemaUpdateOldUsers.May 19 2017, 4:54 PM

@Reedy, is more work still required here ?

Maybe, but it's probably not worth the time. My previous change stopped it fatal-ing in most cases