Page MenuHomePhabricator

Frequent occurrence of MediaWiki\Extension\WikiLambda\ZObjectStore::findZTesterResult threw from ZObjectFactory: Key value not wellformed
Closed, ResolvedPublicBUG REPORT

Description

Description

Observed in LogStash, a frequent occurrence of errors of type
MediaWiki\Extension\WikiLambda\ZObjectStore::findZTesterResult threw from ZObjectFactory: Key value not wellformed

These errors occur while the ZObjectFactory tries to create ZResponseEnvelope from the returned value of a test which has failed.

See example log: https://logstash.wikimedia.org/app/discover#/doc/logstash-*/logstash-mediawiki-1-7.0.0-1-2024.11.20?id=HnJzSZMBh8RuxXYkwBPH

Observed behavior

The Z22 object that causes Wikilambda::ZObjectStore to crash is this:

{
    "Z1K1": "Z22",
    "Z22K1": {
        "Z1K1": "Z40",
        "Z40K1": "Z42"
    },
    "Z22K2": {
        "Z1K1": {
            "Z1K1": "Z7",
            "Z7K1": "Z883",
            "Z883K1": "Z6",
            "Z883K2": "Z1"
        },
        "K1": [
            {
                "Z1K1": "Z7",
                "Z7K1": "Z882",
                "Z882K1": "Z6",
                "Z882K2": "Z1"
            },
            {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z882",
                    "Z882K1": "Z6",
                    "Z882K2": "Z1"
                },
                "K1": "errors",
                "K2": {
                    "Z1K1": "Z5",
                    "Z5K1": "Z507",
                    "Z5K2": {
                        "Z1K1": {
                            "Z1K1": "Z7",
                            "Z7K1": "Z885",
                            "Z885K1": "Z507"
                        },
                        "Z507K1": {
                            "Z1K1": "Z99",
                            "Z99K1": {}   <-------------------------------------- INVALID VALUE
                        },
                        "Z507K2": {
                            "Z1K1": "Z5",
                            "Z5K1": "Z500",
                            "Z5K2": {
                                "Z1K1": {
                                    "Z1K1": "Z7",
                                    "Z7K1": "Z885",
                                    "Z885K1": "Z500"
                                },
                                "Z500K1": "Call tuples failed in returnOnFirstError. Error: TypeError: responseEnvelope.Z22K1.asJSON is not a function."
                            }
                        }
                    }
                }
            }, 
            ... 
        ]
    }
}
  • The object returned in the error key is not wellformed because Z99K1 contains an invalid value {}
  • Additionally this response points at another error in the orchestrator Call tuples failed in returnOnFirstError. Error: TypeError: responseEnvelope.Z22K1.asJSON is not a function.

Completion checklist

Event Timeline

Change #1093868 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Do not recurse ZObject creation and validation inside Z99K1

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

Change #1093868 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Do not recurse ZObject creation and validation inside Z99K1

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

6 errors for wmf.15 - https://logstash.wikimedia.org/goto/8b1e58b81ad106c432312613c529450d. The error is about failing Test case - https://www.wikifunctions.org/view/en/Z19473:

Expected result: { "Z1K1": "Z40" }
Actual result: { "Z1K1": "Z40", "Z40K1": "Z41" }