Page MenuHomePhabricator

Creation of object fails in betacluster with Unspecified error
Closed, ResolvedPublicBUG REPORT

Description

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

Create a new test here:
https://wikifunctions.beta.wmflabs.org/w/index.php?title=Special:CreateObject&uselang=en&zid=Z20&Z20K1=Z802

What happens?:
Fails with Unspecified error

In devtools console:
Failed to load resource: the server responded with a status of 400 ()

In network tab:

{
    "error": {
        "code": "wikilambda-zerror",
        "info": "Error of type Z500",
        "title": "Unspecified error",
        "message": "Unspecified error",
        "zerror": {
            "Z1K1": "Z5",
            "Z5K1": "Z500",
            "Z5K2": {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z885",
                    "Z885K1": "Z500"
                },
                "K1": "<p>Could not create a new page.\nIt already exists.\n</p>"
            }
        },
        "labelled": {
            "type": "Error",
            "error type": "Unspecified error",
            "error value": {
                "type": {
                    "type": "Function call",
                    "function": "Errortype to type",
                    "errortype": "Unspecified error"
                },
                "error information": "<p>Could not create a new page.\nIt already exists.\n</p>"
            }
        },
        "*": "See https://wikifunctions.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/&gt; for notice of API deprecations and breaking changes."
    },
    "servedby": "deployment-mediawiki11"
}

What should have happened instead?:
Test should be successfully created

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
1.43.0-alpha

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

gif of failurescreenshot
Screen Recording 2024-06-21 at 11.26.13 AM.gif (1×2 px, 2 MB)
Screenshot 2024-06-21 at 11.22.56 AM.png (818×1 px, 96 KB)

Event Timeline

vaughnwalters renamed this task from Creation of objects fail in betacluster with Z500 error to Creation of object fails in betacluster with Unspecified error.

Some quick test edits on Beta Cluster to try to debug this:

$store = \MediaWiki\Extension\WikiLambda\WikiLambdaServices::getZObjectStore();

$services = \MediaWiki\MediaWikiServices::getInstance();

$z1 = $store->fetchZObjectByTitle( \Title::newFromText('Z1') );
$oldContent = $z1->getNativeData();

# Test system user
$oldContent->Z2K3->Z12K1[3]->Z11K2 = "Fish";
$newContent = FormatJson::encode($oldContent);
$status = $store->updateZObjectAsSystemUser( RequestContext::getMain(), 'Z1', $newContent, 'Test CLI edit', EDIT_UPDATE );
# Works
$status->isOK();

# Test super-user
$oldContent->Z2K3->Z12K1[3]->Z11K2 = "Fishy";
$newContent = FormatJson::encode($oldContent);
$status = $store->updateZObject(RequestContext::getMain(), 'Z1', $newContent, 'Test CLI edit', \User::newFromName('Jdforrester (WMF)'), EDIT_UPDATE);
# Works
$status->isOK();

# Test IP
$oldContent->Z2K3->Z12K1[3]->Z11K2 = "Fishier";
$newContent = FormatJson::encode($oldContent);
$status = $store->updateZObject(RequestContext::getMain(), 'Z1', $newContent, 'Test CLI edit', $services->getUserFactory()->newAnonymous('1.2.3.4'), EDIT_UPDATE);
# Rejected, no IP editing
$status->isOK();
$status->getErrors()->getMessage();

# Test Functioneer
$status = $store->updateZObject(RequestContext::getMain(), 'Z1', $newContent, 'Test CLI edit', User::newFromName('Selenium user'), EDIT_UPDATE);
# Works
$status->isOK();

# Test regular user
$oldContent->Z2K3->Z12K1[3]->Z11K2 = "Fishiest";
$newContent = FormatJson::encode($oldContent);
$status = $store->updateZObject(RequestContext::getMain(), 'Z1', $newContent, 'Test CLI edit', User::newFromName('DSmit'), EDIT_UPDATE);
# Works
$status->isOK();

… but when I try to make a creation, it breaks:

$newContent = '{"Z1K1":"Z2","Z2K1":{"Z1K1":"Z6","Z6K1":"Z0"},"Z2K2":"Test content","Z2K3":{"Z1K1":"Z12","Z12K1":["Z11",{"Z1K1":"Z11","Z11K1":"Z1002","Z11K2":"Test label"}]},"Z2K4":{"Z1K1":"Z32","Z32K1":["Z31"]},"Z2K5":{"Z1K1":"Z12","Z12K1":["Z11"]}}';

# Test super-user via createNewZObject()
$status = $store->createNewZObject( RequestContext::getMain(), $newContent, 'Test CLI creation', User::newFromName( 'Jdforrester (WMF)' ) );
# Fails
$status->isOK();
# "Unspecified error"
$status->getErrors()->getMessage();
# "Could not create a new page.\nIt already exists." (edit-already-exists)
$status->getErrors()->getHtmlMessage();

This is an intriguing difference in errors to get. Especially, what is emitting this error, and why does getHtmlMessage() give different results? But also, this should work. :-)

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

[operations/mediawiki-config@master] [BETA CLUSTER] Decommission Beta Wikifunctions

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

Change #1135100 merged by jenkins-bot:

[operations/mediawiki-config@master] [BETA CLUSTER] Decommission Beta Wikifunctions

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

Jdforrester-WMF claimed this task.

Fixed by decommissioning Beta Wikifunctions. Finally.

Mentioned in SAL (#wikimedia-operations) [2025-04-08T21:18:21Z] <ladsgroup@deploy1003> Started scap sync-world: Backport for [[gerrit:1135110|LoginSignupSpecialPage: Get a login token before persisting the session (T390514)]], [[gerrit:1135109|LoginSignupSpecialPage: Get a login token before persisting the session (T390514)]], [[gerrit:1135100|[BETA CLUSTER] Decommission Beta Wikifunctions (T362200 T363397 T368161 T373464 T389274)]]

Mentioned in SAL (#wikimedia-operations) [2025-04-08T21:25:39Z] <ladsgroup@deploy1003> ladsgroup, jforrester: Backport for [[gerrit:1135110|LoginSignupSpecialPage: Get a login token before persisting the session (T390514)]], [[gerrit:1135109|LoginSignupSpecialPage: Get a login token before persisting the session (T390514)]], [[gerrit:1135100|[BETA CLUSTER] Decommission Beta Wikifunctions (T362200 T363397 T368161 T373464 T389274)]] synced to the testservers (https://wikitech.wikimed

Mentioned in SAL (#wikimedia-operations) [2025-04-08T21:34:03Z] <ladsgroup@deploy1003> Finished scap sync-world: Backport for [[gerrit:1135110|LoginSignupSpecialPage: Get a login token before persisting the session (T390514)]], [[gerrit:1135109|LoginSignupSpecialPage: Get a login token before persisting the session (T390514)]], [[gerrit:1135100|[BETA CLUSTER] Decommission Beta Wikifunctions (T362200 T363397 T368161 T373464 T389274)]] (duration: 15m 42s)