This error was first observed when I tried to backport two changes to wmf.8 (quickly reverted); however, the error is still reproducible on Test Wikidata, so it’s not specific to the backports and blocks the train.
Steps to reproduce: take a tool that authenticates via OAuth; patch it to contact test.wikidata.org; try to log in. (I don’t know a tool that lets you select the “OAuth wiki” off the top of my head; I used my development version of Wikidata Lexeme Forms. If the broken code reaches Wikidata, then plenty of tools that target Wikidata start to break.)
Error
PHP Warning: Use of undefined constant NS_ENTITYSCHEMA_JSON - assumed 'NS_ENTITYSCHEMA_JSON' (this will throw an Error in a future version of PHP) TypeError: Argument 2 passed to EntitySchema\MediaWiki\Hooks\NamespaceRegistrationHandler::registerNamespace() must be of the type int, string given, called in /srv/mediawiki/php-1.43.0-wmf.9/extensions/EntitySchema/src/MediaWiki/Hooks/NamespaceRegistrationHandler.php on line 52
from /srv/mediawiki/php-1.43.0-wmf.9/extensions/EntitySchema/src/MediaWiki/Hooks/NamespaceRegistrationHandler.php(69) #0 /srv/mediawiki/php-1.43.0-wmf.9/extensions/EntitySchema/src/MediaWiki/Hooks/NamespaceRegistrationHandler.php(52): EntitySchema\MediaWiki\Hooks\NamespaceRegistrationHandler->registerNamespace(array, string, string, boolean, boolean, string, boolean) #1 /srv/mediawiki/php-1.43.0-wmf.9/includes/HookContainer/HookContainer.php(159): EntitySchema\MediaWiki\Hooks\NamespaceRegistrationHandler->onCanonicalNamespaces(array) #2 /srv/mediawiki/php-1.43.0-wmf.9/includes/HookContainer/HookRunner.php(1037): MediaWiki\HookContainer\HookContainer->run(string, array) #3 /srv/mediawiki/php-1.43.0-wmf.9/includes/title/NamespaceInfo.php(396): MediaWiki\HookContainer\HookRunner->onCanonicalNamespaces(array) #4 /srv/mediawiki/php-1.43.0-wmf.9/includes/title/NamespaceInfo.php(422): MediaWiki\Title\NamespaceInfo->getCanonicalNamespaces() #5 /srv/mediawiki/php-1.43.0-wmf.9/includes/language/Language.php(647): MediaWiki\Title\NamespaceInfo->getCanonicalIndex(string) #6 /srv/mediawiki/php-1.43.0-wmf.9/includes/title/MediaWikiTitleCodec.php(421): Language->getNsIndex(string) #7 /srv/mediawiki/php-1.43.0-wmf.9/includes/title/Title.php(2751): MediaWiki\Title\MediaWikiTitleCodec->splitTitleString(string, integer) #8 /srv/mediawiki/php-1.43.0-wmf.9/includes/title/Title.php(456): MediaWiki\Title\Title->secureAndSplit(string, integer) #9 /srv/mediawiki/php-1.43.0-wmf.9/includes/title/Title.php(404): MediaWiki\Title\Title::newFromTextThrow(string, integer) #10 /srv/mediawiki/php-1.43.0-wmf.9/extensions/OAuth/src/SessionProvider.php(85): MediaWiki\Title\Title::newFromText(string) #11 /srv/mediawiki/php-1.43.0-wmf.9/includes/session/SessionManager.php(542): MediaWiki\Extension\OAuth\SessionProvider->provideSessionInfo(MediaWiki\Request\WebRequest) #12 /srv/mediawiki/php-1.43.0-wmf.9/includes/session/SessionManager.php(248): MediaWiki\Session\SessionManager->getSessionInfoForRequest(MediaWiki\Request\WebRequest) #13 /srv/mediawiki/php-1.43.0-wmf.9/includes/Request/WebRequest.php(870): MediaWiki\Session\SessionManager->getSessionForRequest(MediaWiki\Request\WebRequest) #14 /srv/mediawiki/php-1.43.0-wmf.9/includes/session/SessionManager.php(167): MediaWiki\Request\WebRequest->getSession() #15 /srv/mediawiki/php-1.43.0-wmf.9/includes/Setup.php(488): MediaWiki\Session\SessionManager::getGlobalSession() #16 /srv/mediawiki/php-1.43.0-wmf.9/includes/WebStart.php(85): require_once(string) #17 /srv/mediawiki/php-1.43.0-wmf.9/index.php(50): require(string) #18 /srv/mediawiki/w/index.php(3): require(string) #19 {main}
Impact
“Pretty bad.” (Exact impact not totally clear to me, but certainly bad enough to block the train, I’m afraid.)
Notes
The error seems to be limited to Special:OAuth/initiate and CentralAuth:
lucaswerkmeister-wmde@mwlog2002:/srv/mw-log$ tail -n 500k error.log | grep NS_ENTITYSCHEMA_JSON | awk '{print $10}' | sort | uniq -c | sort -rn | sed -E 's/[0-9a-f]{39}/redacted/' 1063 NS_ENTITYSCHEMA_JSON 1054 /w/index.php?title=Special%3AOAuth%2Finitiate 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org 1 /w/api.php?centralauthtoken=redacted&origin=https%3A%2F%2Fru.wikipedia.org
There was also a different error during the deployment of those backports: “No such service: EntitySchema.EntitySchemaIsRepo”. That error seemed to go away after a brief spike, and I don’t know how related it is, nor whether it would also affect the train.