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

External JS UDF and Internal JS UDF creation fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.6.0
    • 7.6.0
    • js-evaluator
    • 7.6.0-1886
    • Untriaged
    • 0
    • Unknown

    Description

      External JS UDF:
      Try to create a Javascript function via the endpoint or via the UI. It fails with a: 404 Not Found error.
       

      curl -v -X POST \
      'http://localhost:8093/evaluator/v1/libraries/lib1' \-u Administrator:password \
      -H 'content-type: application/json' \
      -d 'function n1() {
          SELECT * FROM array_range(0,1) n1;
          return 1;
      }'
      

       

      Fails with this error:
      HTTP/1.1 404 Not Found.
       

      N1QL managed JS UDFs
      Similarly creating N1QL managed JS UDF also fails with the steps described here - MB-59954.

      create function func1() language javascript as "function func1() { return 1; }" ;

      Fails with this error:

      {
                  "code": 3000,
                  "column": 80,
                  "line": 1,
                  "msg": "internal javascript functions are disabled - line 1, column 80, near '...nc1() { return 1; }\"', at: ;"
              } 

      This error is only returned when the internal evaluator is 'nil'

       

       

      Query logs indicate that the internal and external evaluators have not been started:

      2023-12-05T12:20:04.834+05:30 [INFO] Unable to initialize functions cache monitor Could not access functions change counter because <nil>
      2023-12-05T12:20:04.834+05:30 [INFO] jsevaluator: impl::Engine::Initialize: Completed v8wrapper.engine creation.
      2023-12-05T12:20:05.529+05:30 [INFO] jsevaluator: impl::Engine::Initialize: Completed v8wrapper.engine initialization.
      2023-12-05T12:20:05.529+05:30 [INFO] jsevaluator: impl::Engine::Initialize: Completed setting up engine storage ops' log config.
      2023-12-05T12:20:05.529+05:30 [INFO] jsevaluator: impl::Engine::Initialize: Completed setting evaluator's system log config.
      2023-12-05T12:20:05.529+05:30 [INFO] jsevaluator: impl::Engine::Initialize: Completed setting evaluator's JsRestrictionsEnabled flag to false.
      2023-12-05T12:20:05.543+05:30 [INFO] jsevaluator: impl::Engine::Initialize: Compilation worker creation failed: No Waiter registered for this id.
      2023-12-05T12:20:05.543+05:30 [INFO] jsevaluator: n1ql_impl::Engine::Configure: Error initializing engine. Cause: Compilation worker creation failed: No Waiter registered for this id.
      2023-12-05T12:20:05.543+05:30 [INFO] Unable to start javascript evaluator client, err : Internal Error
      2023-12-05T12:20:05.543+05:30 [INFO] jsevaluator for internal javascript: impl::Engine::Initialize: Completed v8wrapper.engine creation.
      2023-12-05T12:20:05.564+05:30 [INFO] jsevaluator for internal javascript: impl::Engine::Initialize: Completed v8wrapper.engine initialization.
      2023-12-05T12:20:05.565+05:30 [INFO] jsevaluator for internal javascript: impl::Engine::Initialize: Completed setting up engine storage ops' log config.
      2023-12-05T12:20:05.565+05:30 [INFO] jsevaluator for internal javascript: impl::Engine::Initialize: Completed setting evaluator's system log config.
      2023-12-05T12:20:05.565+05:30 [INFO] jsevaluator for internal javascript: impl::Engine::Initialize: Completed setting evaluator's JsRestrictionsEnabled flag to false.
      2023-12-05T12:20:05.569+05:30 [INFO] jsevaluator for internal javascript: impl::Engine::Initialize: Compilation worker creation failed: No Waiter registered for this id.
      2023-12-05T12:20:05.569+05:30 [INFO] jsevaluator for internal javascript: n1ql_impl::Engine::Configure: Error initializing engine. Cause: Compilation worker creation failed: No Waiter registered for this id.
      2023-12-05T12:20:05.569+05:30 [INFO] Unable to start javascript evaluator client for internal javascript, err : Internal Error
      2023-12-05T12:20:05.569+05:30 [INFO] Failed to prime evaluator for internal javascript: libStore is nil
      

      Attachments

        Issue Links

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              dhanya.gowrish Dhanya Gowrish
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty