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

JSUDF:While executing JSUDF in a script- start getting "Couldn't connect to server"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.1.0
    • 7.1.0
    • js-evaluator, query
    • None
    • Untriaged
    • 1
    • Unknown

    Description

      Observed while running py-tpcc:

      I have reduced the script to create a function that is not updating/inserting -just basic selects and aggregates:

      The script runs fine for a while and then starts returning :Couldn't connect to server

      {'statement': 'EXECUTE FUNCTION doDelivery(1,7,"2021-12-22 16:06:52.042319")', 'creds': '[

      {"user":"Administrator","pass":"password"}

      ]'}

      {'requestID': '46ade909-53bd-487a-8139-8826cd50a942', 'signature': None, 'results': [

      {'message': "Couldn't connect to server", 'stack': 'Error\n    at N1QL (<anonymous>)\n    at doDelivery (functions/n1qltpcc2.js:31:25)'}

      ], 'status': 'success', 'metrics': {'elapsedTime': '96.00886ms', 'executionTime': '95.884413ms', 'resultCount': 1, 'resultSize': 133, 'serviceLoad': 6, 'transactionElapsedTime': '93.989516ms', 'transactionRemainingTime': '14.906004289s'}}

       

      Just before it has started returning error, it gives:

      {'statement': 'EXECUTE FUNCTION doDelivery(1,8,"2021-12-22 16:06:51.958340")', 'creds': '[

      {"user":"Administrator","pass":"password"}

      ]'}

      {'requestID': 'f56e5b12-89bf-4922-9365-4920a301ea79', 'signature': None, 'results': [[1, 2128, 2, 2128, 3, 2128, 4, 2128, 5, 2128, 6, 2128, 7, 2128, 8, 2128, 9, 2128, 10, 2128]], 'status': 'success', 'metrics': {'elapsedTime': '82.317586ms', 'executionTime': '82.195733ms', 'resultCount': 1, 'resultSize': 72, 'serviceLoad': 12, 'transactionElapsedTime': '79.470632ms', 'transactionRemainingTime': '14.920522373s'}}

       

      which is the correct result. This shows there is no error in the function.

      I have attached the result file.

      Is there some extra configuration setup needed for the proxy server, v8engine or js-evaluator?

      Also, CPU is at less than 50%.

      I have attached a screenshot of the system stats as well.

      also, once it gets in that state I tried to run the function via cbq and same result.
      The server however is up and running.

      cbq> EXECUTE FUNCTION doDelivery(1,5,"2021-12-22 16:46:07.970766") ;

      {

          "results": [

         

      {         "message": "Couldn't connect to server",         "stack": "Error\n    at N1QL (<anonymous>)\n    at doDelivery (functions/n1qltpcc2.js:10:24)"     }

          ],

       cbq> select 1;

      {

          "results": [

         

      {         "$1": 1     }

          ],

         }

       

      Attachments

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

        Activity

          People

            mihir.kamdar Mihir Kamdar (Inactive)
            kamini.jagtiani Kamini Jagtiani
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty