Follow-up from T245062.
Description
Description
Details
Details
Related Changes in Gerrit:
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| SimpleCacheWithBagOStuff: Throw CacheInvalidArgumentException | mediawiki/extensions/Wikibase | master | +47 -44 |
Related Objects
Related Objects
- Mentioned In
- T273640: NULL in stack frame causes SVG to be unreadable
T246980: class@anonymous - Mentioned Here
- T245396: SimpleCacheWithBagOStuff shouldnt be so easy to use bad keys with
T246980: class@anonymous
T247057: CachingFallbackLabelDescriptionLookup attempts to cache entries for invalid Term Languages
T245062: Double ?uselang= passed to a file results in "Cache key contains characters that are not allowed: `P180_1101514477_fr?uselang=fr_label`"
Event Timeline
Comment Actions
if ( !preg_match( self::KEY_REGEX, $key ) ) { throw $this->invalidArgument( "Cache key contains characters that are not allowed: `{$key}`" ); # line 266 } } private function invalidArgument( $message ) { return new class( $message ) extends \InvalidArgumentException implements InvalidArgumentException { }; }
JSON record from Logstash:
{ "exception": { "trace": "#0 /srv/mediawiki/php-1.35.0-wmf.19/extensions/Wikibase/lib/includes/SimpleCacheWithBagOStuff.php(266): Wikibase\\Lib\\SimpleCacheWithBagOStuff->invalidArgument(string)\n#1 /srv/mediawiki/php-1.35.0-wmf.19/extensions/Wikibase/lib/includes/SimpleCacheWithBagOStuff.php(233): Wikibase\\Lib\\SimpleCacheWithBagOStuff->assertKeyIsValid(string)\n#2 /srv/mediawiki/php-1.35.0-wmf.19/extensions/Wikibase/lib/includes/Store/UncachedTermsPrefetcher.php(76): Wikibase\\Lib\\SimpleCacheWithBagOStuff->has(string)\n#3 /srv/mediawiki/php-1.35.0-wmf.19/extensions/Wikibase/lib/includes/Store/UncachedTermsPrefetcher.php(41): ………\n#53 {main}", "code": 0, "file": "/srv/mediawiki/php-1.35.0-wmf.19/extensions/Wikibase/lib/includes/SimpleCacheWithBagOStuff.php:271", "message": "Cache key contains characters that are not allowed: `P31_1111607050_⧼lang⧽_label`", "class": "class@anonymous" }, "server": "commons.wikimedia.org", "phpversion": "7.2.26-1+0~20191218.33+debian9~1.gbpb5a340+wmf1", "wiki": "commonswiki", "channel": "exception", "exception_id": "XkV86QpAICsAACWu934AAAAB", "program": "mediawiki", "type": "mediawiki", "message_checksum": "7e484ce0e90854049eec05efe58a1e41", "caught_by": "mwe_handler", "exception_url": "/wiki/Category: … ?uselang=%E2%A7%BCLang%E2%A7%BD", "http_method": "GET", "host": "mw1322", "@version": 1, "shard": "s4", "timestamp": "2020-02-13T16:44:25+00:00", "severity": "err", "unique_id": "XkV86QpAICsAACWu934AAAAB", "level": "ERROR", "ip": "10.64.32.43", "mwversion": "1.35.0-wmf.19", "logsource": "mw1322", "message": "[XkV86QpAICsAACWu934AAAAB] /wiki/Category: … ?uselang=%E2%A7%BCLang%E2%A7%BD class@anonymous", "normalized_message": "[{exception_id}] {exception_url} class@anonymous", "url": "/wiki/Category: … ?uselang=%E2%A7%BCLang%E2%A7%BD", "reqId": "XkV86QpAICsAACWu934AAAAB", "tags": [ "input-kafka-rsyslog-udp-localhost", "rsyslog-udp-localhost", "kafka", "es" ], "referrer": null, "@timestamp": "2020-02-13T16:44:25.843Z", "facility": "user" }
Comment Actions
Why exactly is this throwing an anonymous class instead of just an InvalidArgumentException?
Comment Actions
Change 576441 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/Wikibase@master] SimpleCacheWithBagOStuff: Throw InvalidArgumentException directly
Comment Actions
Change 576441 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] SimpleCacheWithBagOStuff: Throw CacheInvalidArgumentException