Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-35144

[UDF] executing a javascript function with a syntax error in it returns esoteric error

    XMLWordPrintable

Details

    • Untriaged
    • No

    Description

      create this syntactically incorrect javascript function

      [root@localhost logs]# curl -X POST http://localhost:43381/api/v1/functions -H 'content-type: application/json' -d '{"name":"math","code":"function add(a, b)

      { let data = a + b return data }

      "}'

      Now create a n1ql function based on that one:
      CREATE FUNCTION javaScriptAdd() LANGUAGE JAVASCRIPT AS

      { "math", "add" }

      Run this function:
      select javaScriptAdd(6,1)

      You get this error:
      [

      { "code": 5010, "msg": "Error evaluating projection. - cause: Error executing function javaScriptAdd (math:add): rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp 127.0.0.1:45173: connect: connection refused\" - cause: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp 127.0.0.1:45173: connect: connection refused\"" }

      ]

      sometimes it returns this as well:
      [

      { "code": 5010, "msg": "Error evaluating projection. - cause: Error executing function javaScriptAdd (math:add): rpc error: code = Unavailable desc = transport is closing - cause: rpc error: code = Unavailable desc = transport is closing" }

      ]

      It is hard to tell what these errors are for, almost certainly i wouldn't know this is because of a syntax error in my initial javascript

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            abhishek.jindal Abhishek Jindal
            ajay.bhullar Ajay Bhullar
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty