Malformed bytecode query produces result without requestId

46 views
Skip to first unread message

Daniel C. Weber

unread,
Dec 5, 2024, 3:21:16 PM12/5/24
to Gremlin-users
I recently accidentally submitted a malformed bytecode query to Neptune which apparently made it freeze. It didn't really freeze however, it was just that the error response couldn't be mapped to the request because it did not contain the request id of the corresponding request. I was able to reproduce this on the latest Gremlin Server.

The request:

{
  "requestId": "9991b7c5-67f6-4812-9e47-79b54fd0a57c",
  "op": "bytecode",
  "processor": "traversal",
  "args": {
    "gremlin": {
      "@type": "g:Bytecode",
      "@value": {
        "step": [
          ["V"],
          [
            "has",
            "property",
            {
              "@type": "g:P",
              "@value": {
                "predicate":"lt",
                "value": {
                  "@type": "g:List",
                  "@value": [
                    {
                      "@type": "g:Int32",
                      "@value": 1
                    },
                    {
                      "@type": "g:Int32",
                      "@value": 2
                    }
                  ]
                }
              }
            }
          ]
        ]
      }
    },
    "aliases": {
      "g": "g"
    }
  }
}


Note that the P.lt(..) operator is given a list with two entries, which is invalid.

The response:

{
  "requestId": null,
  "status": {
    "message": "Invalid OpProcessor requested [null]",
    "code": 499,
    "attributes": {
      "@type": "g:Map",
      "@value": []
    }
  },
  "result": {
    "data":null,
    "meta": {
      "@type": "g:Map",
      "@value": []
    }
  }
}

The response suggests that the whole request could not be parsed properly (hence maybe the missing request id), but it's really just the query that's malformed, so I guess the request Id should be present.

Happy to help further if needed
Regards
Daniel

Ken Hu

unread,
Dec 5, 2024, 4:57:03 PM12/5/24
to Gremlin-users
Thanks for reporting this. Just curious, which GLV were you using when you found this issue (this probably affects all of them though since the requestId mapping exists in all of them)?

Daniel C. Weber

unread,
Dec 5, 2024, 5:18:00 PM12/5/24
to Gremlin-users
My own (github.com/Gremlinq/ExRam.Gremlinq) which does the websocket-submit/receive loop by itself but still relies on Gremlin.NET for GraphSon-request-serialization.
Reply all
Reply to author
Forward
0 new messages