Page MenuHomePhabricator

Uncaught UnexpectedValueException: Udp transport "udp:///XWikimediaDebug" must specify a host
Closed, ResolvedPublic

Description

  1. Enable WikimediaDebug.
  2. Enable "Verbose logging".
  3. Browse any URL on a production wiki, e.g. https://test.wikipedia.org/w/index.php?title=Main_Page&action=history

Actual:

[6d434a25-0cbf-9acd-918f-9271b1b4be4c] Uncaught UnexpectedValueException: Udp transport "udp:///XWikimediaDebug" must specify a host in /srv/mediawiki/php-1.43.0-wmf.21/includes/debug/logger/monolog/LegacyHandler.php:131

Screenshot 2024-09-11 at 17.36.11.png (1×2 px, 225 KB)

Event Timeline

Forgot a global $wmgUdp2logDest; in that code. A bit surprising that this didn't fail any checks. I wonder how difficult it would be to set up Phan on that repo…

Change #1072330 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] logging: Fix WikimediaDebug "Verbose logging" option

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

I wonder how difficult it would be to set up Phan on that repo…

Running a minimal case that is indeed caught by phan (2nd line in the output below):

$ phan -q --color --no-progress-bar src/XWikimediaDebug.php wmf-config/logging.php
wmf-config/logging.php:73 PhanTypeSuspiciousStringExpression Suspicious type null= of a variable or expression $wmgUdp2logDest used to build a string. (Expected type to be able to cast to a string)
wmf-config/logging.php:73 PhanUndeclaredVariable Variable $wmgUdp2logDest is undeclared
wmf-config/logging.php:86 PhanUndeclaredClassReference Reference to undeclared class \MediaWiki\Logger\Monolog\LegacyHandler
wmf-config/logging.php:95 PhanTypeInvalidDimOffset Invalid offset "processors" of $wgMWLoggerDefaultSpi['args'][0] of array type array{handlers:array}
wmf-config/logging.php:95 PhanTypeMismatchArgumentInternal Argument 1 ($array) is $wgMWLoggerDefaultSpi['args'][0]['processors'] of type null but \array_keys() takes array
wmf-config/logging.php:116 PhanUndeclaredClassReference Reference to undeclared class \MediaWiki\Logger\Monolog\WikiProcessor
wmf-config/logging.php:186 PhanUndeclaredClassReference Reference to undeclared class \Monolog\Processor\PsrLogMessageProcessor
wmf-config/logging.php:193 PhanUndeclaredClassReference Reference to undeclared class \MediaWiki\Logger\Monolog\LegacyHandler

But we would need the job to have a copy of core/vendor/extensions/skins, and I guess run it for each of the wmf branches. So it is not impossible, but not entirely trivial either. That is probably worth filing it as a task :)

Change #1072330 merged by jenkins-bot:

[operations/mediawiki-config@master] logging: Fix WikimediaDebug "Verbose logging" option

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

Mentioned in SAL (#wikimedia-operations) [2024-09-12T13:21:31Z] <hashar@deploy1003> Started scap sync-world: Backport for [[gerrit:1072330|logging: Fix WikimediaDebug "Verbose logging" option (T374583)]]

Mentioned in SAL (#wikimedia-operations) [2024-09-12T13:23:39Z] <hashar@deploy1003> matmarex, hashar: Backport for [[gerrit:1072330|logging: Fix WikimediaDebug "Verbose logging" option (T374583)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-09-12T13:28:37Z] <hashar@deploy1003> Finished scap sync-world: Backport for [[gerrit:1072330|logging: Fix WikimediaDebug "Verbose logging" option (T374583)]] (duration: 07m 06s)