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

defining design documents with ES6 arrow functions cause the database to restart

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • 5.5.0
    • 5.0.1
    • view-engine
    • None
    • Untriaged
    • MacOSX 64-bit
    • Unknown

    Description

      Using this view definition:

      {
        "views": {
          "arrow_function": {
            "map": "function(doc) { (foo) => 'bar'; }"
          }
        }
      }
      

      Create a new bucket (type couchbase) then try to define this view:

      curl -XPUT -H 'Content-Type: application/json' http://localhost:8092/<bucket-name>/_design/arrow_function -d @/path/to/view.json
      

      Curl errors, stating the server returns an empty response.

      The admin UI is down briefly, then logging back in and checking the logs, I see these four new log lines that describe a graceful (...?) restart:

      Bucket "arrow_function" loaded on node 'ns_1@127.0.0.1' in 0 seconds.
      ns_memcached 000
      ns_1@127.0.0.1
      2:47:14 PM Mon Mar 12, 2018
       
      I'm the only node, so I'm the master.
      mb_master 000
      ns_1@127.0.0.1
      2:47:14 PM Mon Mar 12, 2018
       
      Couchbase Server has started on web port 8091 on node 'ns_1@127.0.0.1'. Version: "5.0.1-5003-community".
      menelaus_sup 001
      ns_1@127.0.0.1
      2:47:14 PM Mon Mar 12, 2018
       
      Shutting down bucket "arrow_function" on 'ns_1@127.0.0.1' for server shutdown
      ns_memcached 000
      ns_1@127.0.0.1
      2:47:11 PM Mon Mar 12, 2018
      

      Changing the view definition to remove the arrow function shows no such behavior:

      {
        "views": {
          "arrow_function": {
            "map": "function(doc) { }"
          }
        }
      }
      

      To which the server responds when curled:

      {"ok":true,"id":"_design/arrow_function"}
      

      Attachments

        Issue Links

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

          Activity

            People

              jeelan.poola Jeelan Poola
              seankelley Sean Kelley
              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