Skip to content

JSON-RPC: RPCInvalidArgsException ends up as a 500 "Column 'DATA' does not exist" #11

Description

@wouterhendriks

When a HareScript JSON-RPC webservice function throws RPCInvalidArgsException, the caller gets an HTTP 500 instead of the 400 we expected. The original exception does not show up anywhere; the errors log only has:

mod::system/lib/internal/remoting/transports.whlib (129,12): Column 'DATA' does not exist. in JSONRPCTRANSPORT#ENCODEEXCEPTION

We see this on our production server and locally on a recent master, for every call that throws it. In our case that is our "not logged in / not enough permissions" check, so every rights rejection in one of our dashboards now reaches the browser as a 500.

What stands out: EncodeException sets error.data := DEFAULT RECORD for RPCInvalidArgsException, while without the etr debug tag the error record is created without a data cell. We have not tested it with etr enabled.

Happy to put together a minimal module that reproduces this, if that helps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions