Page MenuHomePhabricator

Phatality does not escape backslashes in normalized_message logstash link
Open, Needs TriagePublic

Description

Example at T293104.

Original “find normalized_message in Logstash” link:

https://logstash.wikimedia.org/app/dashboards#/view/AXFV7JE83bOlOASGccsT?_g=(time:(from:now-30d,to:now))&_a=(query:(query_string:(query:'normalized_message:%22%5B%7BreqId%7D%5D%20%7Bexception_url%7D%20%20%20TypeError:%20Argument%201%20passed%20to%20Wikibase%5CRepo%5CValidators%5CUniquenessViolation::__construct()%20must%20implement%20interface%20Wikibase%5CDataModel%5CEntity%5CEntityId%20or%20be%20null,%20string%20given,%20called%20in%20/srv/mediawiki/php-1.38.0-wmf.3/extensi%22')))

This searches for the message:

normalized_message:"[{reqId}] {exception_url} TypeError: Argument 1 passed to Wikibase\Repo\Validators\UniquenessViolation::__construct() must implement interface Wikibase\DataModel\Entity\EntityId or be null, string given, called in /srv/mediawiki/php-1.38.0-wmf.3/extensi"

but finds no results.

The correct link is:

https://logstash.wikimedia.org/app/dashboards#/view/AXFV7JE83bOlOASGccsT?_g=(time:(from:now-30d,to:now))&_a=(query:(query_string:(query:'normalized_message:%22%5B%7BreqId%7D%5D%20%7Bexception_url%7D%20%20%20TypeError:%20Argument%201%20passed%20to%20Wikibase%5C%5CRepo%5C%5CValidators%5C%5CUniquenessViolation::__construct()%20must%20implement%20interface%20Wikibase%5C%5CDataModel%5C%5CEntity%5C%5CEntityId%20or%20be%20null,%20string%20given,%20called%20in%20/srv/mediawiki/php-1.38.0-wmf.3/extensi%22')))

searching for the message:

normalized_message:"[{reqId}] {exception_url} TypeError: Argument 1 passed to Wikibase\\Repo\\Validators\\UniquenessViolation::__construct() must implement interface Wikibase\\DataModel\\Entity\\EntityId or be null, string given, called in /srv/mediawiki/php-1.38.0-wmf.3/extensi"

yields 2,250 results.

Phatality should automatically escape backslashes in the message, since they’re fairly likely to occur in class names (as above). This will become even more relevant with T166010. Other kinds of escaping (e.g. "\"?) might also be relevant, but backslashes are the only one I’ve noticed in practice so far.