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

[UDF] js udf fails with symbol is not a function error

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      I want to start by saying I can't manually repro this, but we have logs and the tests on jenkins consistently fail

      http://qa.sc.couchbase.com/job/test_suite_executor/624250/consoleText

       membase.api.exception.CBQError: CBQError: host 172.23.120.196: ERROR:{'requestID': 'f73847c8-1de4-4103-925b-5896b31991b3', 'signature': None, 'results': [], 'errors': [{'code': 10109, 'msg': "Error executing function 'rbac_default' (n1ql:rbac_default)", 'reason': {'details': 'symbol is not a function: rbac_default', 'type': 'Exceptions from JS code'}}], 'status': 'fatal', 'metrics': {'elapsedTime': '3.105925ms', 'executionTime': '2.997892ms', 'resultCount': 0, 'resultSize': 0, 'serviceLoad': 1, 'errorCount': 1}}

      steps the test takes:

      CREATE OR REPLACE FUNCTION default:default._default.celsius(degrees) LANGUAGE INLINE AS (degrees - 32) * 5/9

      curl -s -k -X POST http://172.23.120.196:8093/evaluator/v1/libraries/n1ql -u Administrator:password -H 'content-type: application/json' -d 'function rbac_default() {            var query = EXECUTE FUNCTION default:default._default.celsius(10);            var acc = [];            for (const row of query) {                acc.push(row);            }            return acc;}'
      

      the library is made successfully
      [2023-10-05 11:59:56,282] - [remote_util:3376] INFO - command executed successfully with root
      [2023-10-05 11:59:56,282] - [tuq:4011] INFO - (['

      {"status": "OK"}

      '], [])

      CREATE OR REPLACE FUNCTION default:default.test.rbac_default() LANGUAGE JAVASCRIPT AS "rbac_default" AT "n1ql"

      EXECUTE FUNCTION default:default.test.rbac_default()

      now we see an the above mentioned error, I am attaching the logs we have from the run

      Attachments

        Issue Links

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

          Activity

            People

              ajay.bhullar Ajay Bhullar
              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