Page MenuHomePhabricator

Some object changes or creations leads to ZErrorException on wikifunctions.org
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
I get the message

[09a5b803-9656-4073-a2a3-0cd104d8c9f9] Caught exception of type MediaWiki\Extension\WikiLambda\ZErrorException

and the object is not saved

What should have happened instead?:
No such error message. Publish object.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

From your error state:

from /srv/mediawiki/php-1.41.0-wmf.19/extensions/WikiLambda/includes/ZObjectUtils.php(1006)
#0 /srv/mediawiki/php-1.41.0-wmf.19/extensions/WikiLambda/includes/ZObjectUtils.php(1036): MediaWiki\Extension\WikiLambda\ZObjectUtils::extractHumanReadableZObject(NULL, array, LanguageEn)
#1 /srv/mediawiki/php-1.41.0-wmf.19/extensions/WikiLambda/includes/ZObjectUtils.php(1036): MediaWiki\Extension\WikiLambda\ZObjectUtils::extractHumanReadableZObject(stdClass, array, LanguageEn)
#2 /srv/mediawiki/php-1.41.0-wmf.19/extensions/WikiLambda/includes/ZObjects/ZObject.php(302): MediaWiki\Extension\WikiLambda\ZObjectUtils::extractHumanReadableZObject(stdClass, array, LanguageEn)
#3 /srv/mediawiki/php-1.41.0-wmf.19/extensions/WikiLambda/includes/ZObjects/ZError.php(136): MediaWiki\Extension\WikiLambda\ZObjects\ZObject->getHumanReadable()
#4 /srv/mediawiki/php-1.41.0-wmf.19/extensions/WikiLambda/includes/API/WikiLambdaApiBase.php(73): MediaWiki\Extension\WikiLambda\ZObjects\ZError->getErrorData()
#5 /srv/mediawiki/php-1.41.0-wmf.19/extensions/WikiLambda/includes/API/ApiZObjectEditor.php(44): MediaWiki\Extension\WikiLambda\API\WikiLambdaApiBase->dieWithZError(MediaWiki\Extension\WikiLambda\ZObjects\ZError)
#6 /srv/mediawiki/php-1.41.0-wmf.19/includes/api/ApiMain.php(1915): MediaWiki\Extension\WikiLambda\API\ApiZObjectEditor->execute()
#7 /srv/mediawiki/php-1.41.0-wmf.19/includes/api/ApiMain.php(892): ApiMain->executeAction()
#8 /srv/mediawiki/php-1.41.0-wmf.19/includes/api/ApiMain.php(863): ApiMain->executeActionWithErrorHandling()
#9 /srv/mediawiki/php-1.41.0-wmf.19/api.php(95): ApiMain->execute()
#10 /srv/mediawiki/php-1.41.0-wmf.19/api.php(48): wfApiMain()
#11 /srv/mediawiki/w/api.php(3): require(string)
#12 {main}

This means the ZObjectStore objected, and then the error message generation exploded somehow. :-(

Change 944298 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] WikiLambdaApiBase: Don't explode in dieWithZError()

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

Jdforrester-WMF changed the task status from Open to In Progress.Aug 1 2023, 6:04 PM
Jdforrester-WMF claimed this task.
Jdforrester-WMF triaged this task as Unbreak Now! priority.
Jdforrester-WMF added a project: WikiLambda.
Jdforrester-WMF moved this task from Backlog to In Progress on the Abstract Wikipedia team board.

The underlying error is a MediaWiki\Extension\WikiLambda\ZErrorException: JSON syntax error which you shouldn't be able to trigger whatever you're doing, so even with the above patch landed this is still a bug.

Change 944298 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] WikiLambdaApiBase: Don't explode in dieWithZError()

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

Change 944195 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@wmf/1.41.0-wmf.19] WikiLambdaApiBase: Don't explode in dieWithZError()

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

Change 944196 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@wmf/1.41.0-wmf.20] WikiLambdaApiBase: Don't explode in dieWithZError()

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

Reedy renamed this task from Some object changes or creations leads to ZErrorException on wikifuntions.org to Some object changes or creations leads to ZErrorException on wikifunctions.org.Aug 1 2023, 8:05 PM

Change 944195 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@wmf/1.41.0-wmf.19] WikiLambdaApiBase: Don't explode in dieWithZError()

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

Change 944196 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@wmf/1.41.0-wmf.20] WikiLambdaApiBase: Don't explode in dieWithZError()

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

Mentioned in SAL (#wikimedia-operations) [2023-08-01T21:05:09Z] <jforrester@deploy1002> Synchronized ./php-1.41.0-wmf.20/extensions/WikiLambda/: T343253 T343256 (duration: 07m 23s)

Now I get an "Error of type Z500"

The error being thrown is that the JSON is invalid, but I can't immediately see how; my example edit, which was refused:

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z0"
    },
    "Z2K2": {
        "Z1K1": "Z20",
        "Z20K1": "Z10000",
        "Z20K2": {
            "Z1K1": "Z7",
            "Z7K1": "Z10000",
            "Z10000K1": "dlrow",
            "Z10000K2": " ,olleH"
        },
        "Z20K3": {
            "Z1K1": "Z7",
            "Z7K1": "Z866",
            "Z866K2": "dlrow ,olleH"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "join strings(dlrow, ,olleH)"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}

However, it's no longer throwing a production error, as we're actually catching it.

Change 944322 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] WikiLambdaApiBase::dieWithZError: Log that something went wrong for us to check

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

I can't reproduce this anymore on production.

Jdforrester-WMF lowered the priority of this task from Unbreak Now! to Needs Triage.Aug 2 2023, 3:50 PM
Jdforrester-WMF triaged this task as High priority.

Change 944322 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] WikiLambdaApiBase::dieWithZError: Log that something went wrong for us to check

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

This hasn't recurred in two months. I propose we just close this.

DVrandecic claimed this task.