Page MenuHomePhabricator

Echo kleenean true fails
Closed, ResolvedPublicBUG REPORT

Description

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

  • go to https://wikifunctions.beta.wmflabs.org/wiki/Special:EvaluateFunctionCall
  • type and choose "Echo" as function (Z801)
  • in "Select a Type", type and choose "kleenean" (Z10321)
  • switch the mode selector after the first kleenean from x (literal) to the chain symbol (for reference)
  • in the field saying ZObject, type and choose "kleenean true" (Z10323)
  • click on "Call Function"

What happens?:
An error comes back

Error result
{
    "Z1K1": "Z22",
    "Z22K1": "Z24",
    "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": "Z518",
                    "Z5K2": {
                        "Z1K1": {
                            "Z1K1": "Z7",
                            "Z7K1": "Z885",
                            "Z885K1": "Z518"
                        },
                        "Z518K1": "Z10321",
                        "Z518K2": {
                            "Z1K1": "Z10321",
                            "Z10321K1": "Z10323"
                        },
                        "Z518K3": {
                            "Z1K1": "Z5",
                            "Z5K1": "Z502",
                            "Z5K2": {
                                "Z1K1": {
                                    "Z1K1": "Z7",
                                    "Z7K1": "Z885",
                                    "Z885K1": "Z502"
                                },
                                "Z502K1": "Z509",
                                "Z502K2": {
                                    "Z1K1": "Z5",
                                    "Z5K1": "Z509",
                                    "Z5K2": {
                                        "Z1K1": {
                                            "Z1K1": "Z7",
                                            "Z7K1": "Z885",
                                            "Z885K1": "Z509"
                                        },
                                        "Z509K1": [
                                            "Z5"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z882",
                    "Z882K1": "Z6",
                    "Z882K2": "Z1"
                },
                "K1": "orchestrationMemoryUsage",
                "K2": "113.38 MiB"
            },
            {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z882",
                    "Z882K1": "Z6",
                    "Z882K2": "Z1"
                },
                "K1": "orchestrationCpuUsage",
                "K2": "101.495 ms"
            },
            {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z882",
                    "Z882K1": "Z6",
                    "Z882K2": "Z1"
                },
                "K1": "orchestrationStartTime",
                "K2": "2022-12-15T18:20:52.839Z"
            },
            {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z882",
                    "Z882K1": "Z6",
                    "Z882K2": "Z1"
                },
                "K1": "orchestrationEndTime",
                "K2": "2022-12-15T18:20:53.055Z"
            },
            {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z882",
                    "Z882K1": "Z6",
                    "Z882K2": "Z1"
                },
                "K1": "orchestrationDuration",
                "K2": "216 ms"
            },
            {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z882",
                    "Z882K1": "Z6",
                    "Z882K2": "Z1"
                },
                "K1": "orchestrationHostname",
                "K2": "47ff3383e5b4"
            }
        ]
    }
}

What should have happened instead?:
The kleenean true should have been shown, not an error

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

Other information (browser name/version, screenshots, etc.):
It is surprising. It says Z502/not wellformed and then a Z509/list of errors, but the list of errors is just an empty benjamin array [Z5], which shouldn't be an error.

Event Timeline

This seems to be a simpler case of T325320

DVrandecic renamed this task from Echo kleenean false fails to Echo kleenean true fails.Dec 15 2022, 6:24 PM

Here are the relevant definitions:

Z10321/kleenean type
{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10321"
    },
    "Z2K2": {
        "Z1K1": "Z4",
        "Z4K1": "Z10321",
        "Z4K2": [
            "Z3",
            {
                "Z1K1": "Z3",
                "Z3K1": "Z10321",
                "Z3K2": {
                    "Z1K1": "Z6",
                    "Z6K1": "Z10321K1"
                },
                "Z3K3": {
                    "Z1K1": "Z12",
                    "Z12K1": [
                        "Z11",
                        {
                            "Z1K1": "Z11",
                            "Z11K1": "Z1002",
                            "Z11K2": "identity"
                        }
                    ]
                }
            }
        ],
        "Z4K3": "Z101"
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "kleenean"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    }
}
Z10323/kleenean true
{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10323"
    },
    "Z2K2": {
        "Z1K1": "Z10321",
        "Z10321K1": "Z10323"
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "kleenean true"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    }
}

Note that this currently does not fail, because the type Kleenean on Beta has been changed to have the type of its lone key to be String, and not Kleenean.

For testing purposes, I created the following type with the respective two values:

Calling Echo(BCE) leads to the error mentioned above.

Update: Z801 on Z10529 now results in a Z518 (Object type mismatch) on Z504 (ZID not found) with Builtin validator "Z101" not found for "Z10528". This is vaguely familiar as a thing we encountered before, but I can't find anything in Phabricator about it off-hand.

We can't meaningfully fix this right now. I suggest doing what you did with Kleenean and just make the identity field a Z6 instead of a Z9.

Assigning this to myself for now, to think about it. If anyone wants to take a shot, please let me know.

Update: Z801 on Z10529 now results in a Z518 (Object type mismatch) on Z504 (ZID not found) with Builtin validator "Z101" not found for "Z10528". This is vaguely familiar as a thing we encountered before, but I can't find anything in Phabricator about it off-hand.

Is that because builtin validators and user defined validators behave differently?

Yeah, so this is not a deep issue right now. It just doesn't find the validator.

When I change the validator on Z10528 to Z801 or Z10580, it gives the respective Builtin validator "Z801" not found for "Z10528" and Builtin validator "Z10528" not found for "Z10528" messages. I do believe that there is a deeper issue at play if this one gets fixed, but for now, let's figure out this one.

Unassigning myself for now.

Change 902471 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-orchestrator@master] Detect cyclical references in identity fields and stop expanding.

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

Change 902471 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Detect cyclical references in identity fields and stop expanding.

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

Yes, it works with Kleenean, because the Kleenean type is now implemented using a string, and not using identity.

I'll open a new bug for Gregorian Era, which currently hangs at the UX (the backend seems to work fine):

https://phabricator.wikimedia.org/T336719

Closing this one.