Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-691

Must have a bucket open before a bucket can be created

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.6
    • lcb, library
    • None
    • 1

    Description

      Edit: It is sufficient to 'open' a nameless bucket :  cluster.bucket("");

       

      bit of a catch-22 here.

       

        1

        2 var couchbase = require('couchbase');

        3

        4 function sleep(ms)

      {   5   return new Promise(resolve => setTimeout(resolve, ms));   6 }

        7

        8 // Setup Cluster Connection Object

        9 const options = {username: 'Administrator', password: 'password'};

      10 const cluster = new couchbase.Cluster("http://localhost", options);

      11

      12 var bucketSettings =

      { 13   name: 'hello', 14   authType: 'sasl', 15   bucketType: 'couchbase', 16   ramQuotaMB: 100, 17   replicaNumber: 0, 18   saslPassword: "", 19   flushEnabled: 0 20 }

      ;

      21

      22 var bucketOpts = { timeout : 100 };

      23 var bucketManager = cluster.buckets();

      24 bucketManager.createBucket(bucketSettings, bucketOpts, function(err)

      { 25   if(err)console.log('Creation of hello bucket failed:', err); 26 }

      );

       

       

      Creation of hello bucket failed: Error: You must have one open bucket before you can perform queries.

          at Cluster._getClusterConn (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/cluster.js:435:13)

          at BucketManager.get _http [as _http] (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/bucketmanager.js:21:43)

          at /Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/bucketmanager.js:71:28

          at /Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/promisehelper.js:9:7

          at new Promise (<anonymous>)

          at Function.wrapAsync (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/promisehelper.js:8:12)

          at BucketManager.createBucket (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/bucketmanager.js:70:26)

          at Object.<anonymous> (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/k2.js:24:15)

          at Module._compile (internal/modules/cjs/loader.js:955:30)

          at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)

      (node:58976) UnhandledPromiseRejectionWarning: Error: You must have one open bucket before you can perform queries.

          at Cluster._getClusterConn (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/cluster.js:435:13)

          at BucketManager.get _http [as _http] (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/bucketmanager.js:21:43)

          at /Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/bucketmanager.js:71:28

          at /Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/promisehelper.js:9:7

          at new Promise (<anonymous>)

          at Function.wrapAsync (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/promisehelper.js:8:12)

          at BucketManager.createBucket (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/node_modules/couchbase/lib/bucketmanager.js:70:26)

          at Object.<anonymous> (/Users/michaelreiche/g2/docs-sdk-nodejs/modules/devguide/examples/nodejs/k2.js:24:15)

      Attachments

        Issue Links

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

          Activity

            There are no comments yet on this issue.

            People

              brett19 Brett Lawson
              michael.reiche Michael Reiche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty