Page MenuHomePhabricator

Boolean wrapper raises Internal Server Error
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Given a type "Boolean wrapper" which consists of single key of type Boolean
  • Given a function "Boolean wrapper constructor" which takes a Boolean and returns a Boolean wrapper wrapping that value
  • Given a composition implementation of the latter
  • Run the function with a value

What happens?:

  • It returns
{
    "Z1K1": "Z22",
    "Z22K1": "Z23",
    "Z22K2": {
        "Z1K1": "Z5",
        "Z5K2": "Internal Server Error"
    }
}

What should have happened instead?:
Z22K1 should be a Boolean wrapper wrapping the value.

Type:

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10153"
    },
    "Z2K2": {
        "Z1K1": "Z4",
        "Z4K1": "Z10153",
        "Z4K2": [
            {
                "Z1K1": "Z3",
                "Z3K1": "Z40",
                "Z3K2": {
                    "Z1K1": "Z6",
                    "Z6K1": "Z10153K1"
                },
                "Z3K3": {
                    "Z1K1": "Z12",
                    "Z12K1": [
                        {
                            "Z1K1": "Z11",
                            "Z11K1": "Z1002",
                            "Z11K2": "inner"
                        }
                    ]
                }
            }
        ],
        "Z4K3": "Z101"
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Boolean wrapper"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1002",
                "Z31K2": []
            }
        ]
    }
}

Boolean wrapper function:

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10155"
    },
    "Z2K2": {
        "Z1K1": "Z8",
        "Z8K1": [
            {
                "Z1K1": "Z17",
                "Z17K1": "Z40",
                "Z17K2": {
                    "Z1K1": "Z6",
                    "Z6K1": "Z10155K1"
                },
                "Z17K3": {
                    "Z1K1": "Z12",
                    "Z12K1": [
                        {
                            "Z1K1": "Z11",
                            "Z11K1": "Z1002",
                            "Z11K2": "input"
                        }
                    ]
                }
            }
        ],
        "Z8K2": "Z10153",
        "Z8K3": [],
        "Z8K4": [],
        "Z8K5": "Z10155"
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Boolean wrapper constructor"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1002",
                "Z31K2": []
            }
        ]
    }
}

Boolean wrapper implementation:

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10158"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z10155",
        "Z14K2": {
            "Z1K1": "Z7",
            "Z7K1": "Z801",
            "Z801K1": {
                "Z1K1": "Z10153",
                "Z10153K1": {
                    "Z1K1": "Z18",
                    "Z18K1": {
                        "Z1K1": "Z6",
                        "Z6K1": "Z10155K1"
                    }
                }
            }
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Boolean wrapper constructor implementation"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1002",
                "Z31K2": []
            }
        ]
    }
}

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
Current local machine

Event Timeline

Not sure, I'm also thinking that it might be related to https://phabricator.wikimedia.org/T289681

DVrandecic triaged this task as Medium priority.Dec 8 2021, 11:32 PM
DVrandecic raised the priority of this task from Medium to High.

Currently, on my local installation of WikiLambda, with all components very recently updated, I'm getting "Internal server error" in the results of the last 3 examples on the API sandbox page for action = wikilambda_function_call. I don't know to what extent these broken examples might be related to this ticket.

For some reason, the calls to wikilambda_fetch aren't working. Calling wikilambda_fetch directly works fine, so it's a problem in the interface between the orchestrator and the wiki.

To get unblocked, you can change line 82 in function-orchestrator/src/orchestrate.js as follows:

const doValidate = false;

This hides the problem because most of the dereferencing that we do happens inside the validators. The examples on the API sandbox page don't (and can't) depend on any particular non-builtin ZID existing within the wiki, so by deactivating validation, you avoid performing these dereferences.

Okay, I found the problem. Will file a hot fix for now; the real fix was already underway as part of handling user-defined types :)

Hmm. Ignore that hot fix; it's too hot. Setting doValidate = false (only when running examples from the wiki) should fix the problem adequately.

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

[mediawiki/services/function-schemata@master] Bugfix: Exclude Z18 objects from specific Z6 and Z10 canonicalization

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

Change 747538 merged by jenkins-bot:

[mediawiki/services/function-schemata@master] Bugfix: Exclude Z18 objects from specific Z6 and Z10 canonicalization

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

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

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (2402b0c)

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

Change 748797 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (2402b0c)

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

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

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (993ad1d)

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

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

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (993ad1d)

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

Change 749203 merged by jenkins-bot:

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (993ad1d)

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

Change 749204 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (993ad1d)

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

Sorry, I can't get it to work. Cory, can you show me?