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

No error message in terminal when cluster is offline for Node.js SDK 3.0.1

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 3.0.1
    • None
    • lcb, library
    • None
    • 1
    • SDK 44: Txns, SDK 3.1, Docs

    Description

      Summary

      It appears that no error message is given in the terminal when running the following line whilst the cluster is completely offline:

      const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
      

      We would expect for an error message to be shown in the terminal to reflect the fact that the cluster is offline, but nothing is shown in this instance. 

      If we replace the above line with:

      const getResult = await collection.get(`${KEY}`);
      

      Then we do get an error message shown in the terminal, as we would expect for the other line:

      Error: cluster object was closed
      

        

      Steps to Reproduce

      • Create a 1 node cluster on 6.0.3 running Data/Index/Query services
      • Create a Couchbase bucket called "bucket1"
      • Add a document with key = "doc1"
      • Create primary index for bucket1
      • Take the cluster offline (eg. vagrant halt)
      • Copy the following into a Node JS file and run, adjusting cluster address and log in credentials as necessary:

      const BUCKET_NAME = 'bucket1';
      const KEY = 'doc1'const couchbase = require('couchbase');try {
          var cluster = new couchbase.Cluster(
              'http://10.112.193.101:8091', {
                  username: 'Administrator',
                  password: 'password'});
          var bucket = cluster.bucket(BUCKET_NAME);
          var collection = bucket.defaultCollection();
          var binaryCollection = collection.binary();    (async function(){
              try {
                  const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
                  console.log(getResult);
              } catch (e){
                  console.log(e);
              }
          })();} catch (e){
          console.log(e);
      }
      

      * Observe that no error message is given on the terminal 

      • Replace the line:

      const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`);
      

      with the following:

      const getResult = await collection.get(`${KEY}`);

       

      • Rerun the code and observe that an "Error: cluster object was closed" message is now shown on the terminal

       

      Expected Results

      We would expect an error message to be shown in the terminal in both instances to reflect that the cluster is offline.

       

      Actual Results

      • An "Error: cluster object was closed" message is shown on the terminal when using the following line: 

      const getResult = await collection.get(`${KEY}`);

      * No message is shown when using the following line:

      const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
      

       

      Attachments

        Issue Links

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

          Activity

            callum.majumdar Callum Majumdar created issue -
            callum.majumdar Callum Majumdar made changes -
            Field Original Value New Value
            Description +Summary+

            It appears that nothing is logged when running the following line whilst the cluster is completely offline:

             
            {code:java}
            const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
            But if we replace this line with:

             

             
            {code:java}
            const getResult = await collection.get(`${KEY}`);
            {code}
            Then we get the following message logged:

             

             
            {code:java}
            Error: cluster object was closed
            {code}
             

             

            +Steps to Reproduce+
             * Create a 1 node cluster on 6.0.3 running Data/Index/Query services
             * Create a Couchbase bucket called "bucket1"
             * Add a document with key = "doc1"
             * Create primary index for bucket1
             * Take the cluster offline (eg. vagrant halt)
             * Copy the following into a Node JS file and run, adjusting cluster address and log in credentials as necessary:

             
            {code:java}
            const BUCKET_NAME = 'bucket1';
            const KEY = 'doc1'const couchbase = require('couchbase');try {
                var cluster = new couchbase.Cluster(
                    'http://10.112.193.101:8091', {
                        username: 'Administrator',
                        password: 'password'});
                var bucket = cluster.bucket(BUCKET_NAME);
                var collection = bucket.defaultCollection();
                var binaryCollection = collection.binary(); (async function(){
                    try {
                        const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
                        console.log(getResult);
                    } catch (e){
                        console.log(e);
                    }
                })();} catch (e){
                console.log(e);
            }
            {code}
             * Observe that nothing is logged 
             * Replace the line:

             
            {code:java}
            const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`);
            {code}
            with the following:

             

             
            {code:java}
            const getResult = await collection.get(`${KEY}`);{code}
             

             
             * Rerun the code and observe that an "Error: cluster object was closed" message is now logged

             

            +Expected Results+

            We would expect a message to be logged in both instances to reflect that the cluster is offline.

             

            +Actual Results+
             * An "Error: cluster object was closed" message is logged when using the following line:

             
            {code:java}
            const getResult = await collection.get(`${KEY}`);{code}
             
             * No message is logged when using the following line:

            {code:java}
            const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
             
            +Summary+

            It appears that nothing is logged when running the following line whilst the cluster is completely offline:
            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
            But if we replace this line with:
            {code:java}const getResult = await collection.get(`${KEY}`);
            {code}
            Then we get the following message logged:
            {code:java}Error: cluster object was closed
            {code}
              

            +Steps to Reproduce+
             * Create a 1 node cluster on 6.0.3 running Data/Index/Query services
             * Create a Couchbase bucket called "bucket1"
             * Add a document with key = "doc1"
             * Create primary index for bucket1
             * Take the cluster offline (eg. vagrant halt)
             * Copy the following into a Node JS file and run, adjusting cluster address and log in credentials as necessary:

            {code:java}const BUCKET_NAME = 'bucket1';
            const KEY = 'doc1'const couchbase = require('couchbase');try {
                var cluster = new couchbase.Cluster(
                    'http://10.112.193.101:8091', {
                        username: 'Administrator',
                        password: 'password'});
                var bucket = cluster.bucket(BUCKET_NAME);
                var collection = bucket.defaultCollection();
                var binaryCollection = collection.binary(); (async function(){
                    try {
                        const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
                        console.log(getResult);
                    } catch (e){
                        console.log(e);
                    }
                })();} catch (e){
                console.log(e);
            }
            {code} * Observe that nothing is logged 
             * Replace the line:

            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`);
            {code}
            with the following:
            {code:java}const getResult = await collection.get(`${KEY}`);{code}
             
             * Rerun the code and observe that an "Error: cluster object was closed" message is now logged

             

            +Expected Results+

            We would expect a message to be logged in both instances to reflect that the cluster is offline.

             

            +Actual Results+
             * An "Error: cluster object was closed" message is logged when using the following line: 

            {code:java}const getResult = await collection.get(`${KEY}`);{code} * No message is logged when using the following line:

            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
             
            callum.majumdar Callum Majumdar made changes -
            Description +Summary+

            It appears that nothing is logged when running the following line whilst the cluster is completely offline:
            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
            But if we replace this line with:
            {code:java}const getResult = await collection.get(`${KEY}`);
            {code}
            Then we get the following message logged:
            {code:java}Error: cluster object was closed
            {code}
              

            +Steps to Reproduce+
             * Create a 1 node cluster on 6.0.3 running Data/Index/Query services
             * Create a Couchbase bucket called "bucket1"
             * Add a document with key = "doc1"
             * Create primary index for bucket1
             * Take the cluster offline (eg. vagrant halt)
             * Copy the following into a Node JS file and run, adjusting cluster address and log in credentials as necessary:

            {code:java}const BUCKET_NAME = 'bucket1';
            const KEY = 'doc1'const couchbase = require('couchbase');try {
                var cluster = new couchbase.Cluster(
                    'http://10.112.193.101:8091', {
                        username: 'Administrator',
                        password: 'password'});
                var bucket = cluster.bucket(BUCKET_NAME);
                var collection = bucket.defaultCollection();
                var binaryCollection = collection.binary(); (async function(){
                    try {
                        const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
                        console.log(getResult);
                    } catch (e){
                        console.log(e);
                    }
                })();} catch (e){
                console.log(e);
            }
            {code} * Observe that nothing is logged 
             * Replace the line:

            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`);
            {code}
            with the following:
            {code:java}const getResult = await collection.get(`${KEY}`);{code}
             
             * Rerun the code and observe that an "Error: cluster object was closed" message is now logged

             

            +Expected Results+

            We would expect a message to be logged in both instances to reflect that the cluster is offline.

             

            +Actual Results+
             * An "Error: cluster object was closed" message is logged when using the following line: 

            {code:java}const getResult = await collection.get(`${KEY}`);{code} * No message is logged when using the following line:

            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
             
            +Summary+

            It appears that nothing is logged when running the following line whilst the cluster is completely offline:
            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
            But if we replace this line with:
            {code:java}const getResult = await collection.get(`${KEY}`);
            {code}
            Then we get the following message logged:
            {code:java}Error: cluster object was closed
            {code}
              

            +Steps to Reproduce+
             * Create a 1 node cluster on 6.0.3 running Data/Index/Query services
             * Create a Couchbase bucket called "bucket1"
             * Add a document with key = "doc1"
             * Create primary index for bucket1
             * Take the cluster offline (eg. vagrant halt)
             * Copy the following into a Node JS file and run, adjusting cluster address and log in credentials as necessary:

            {code:java}const BUCKET_NAME = 'bucket1';
            const KEY = 'doc1'const couchbase = require('couchbase');try {
                var cluster = new couchbase.Cluster(
                    'http://10.112.193.101:8091', {
                        username: 'Administrator',
                        password: 'password'});
                var bucket = cluster.bucket(BUCKET_NAME);
                var collection = bucket.defaultCollection();
                var binaryCollection = collection.binary(); (async function(){
                    try {
                        const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
                        console.log(getResult);
                    } catch (e){
                        console.log(e);
                    }
                })();} catch (e){
                console.log(e);
            }
            {code} * Observe that nothing is logged 
             * Replace the line:

            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`);
            {code}
            with the following:
            {code:java}const getResult = await collection.get(`${KEY}`);{code}
             
             * Rerun the code and observe that an "Error: cluster object was closed" message is now logged

             

            +Expected Results+

            We would expect a message to be logged in both instances to reflect that the cluster is offline.

             

            +Actual Results+
             * An "Error: cluster object was closed" message is logged when using the following line: 

            {code:java}const getResult = await collection.get(`${KEY}`);{code}
            * No message is logged when using the following line:
            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
             
            callum.majumdar Callum Majumdar made changes -
            Link This issue causes CBSE-8283 [ CBSE-8283 ]
            callum.majumdar Callum Majumdar made changes -
            Description +Summary+

            It appears that nothing is logged when running the following line whilst the cluster is completely offline:
            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
            But if we replace this line with:
            {code:java}const getResult = await collection.get(`${KEY}`);
            {code}
            Then we get the following message logged:
            {code:java}Error: cluster object was closed
            {code}
              

            +Steps to Reproduce+
             * Create a 1 node cluster on 6.0.3 running Data/Index/Query services
             * Create a Couchbase bucket called "bucket1"
             * Add a document with key = "doc1"
             * Create primary index for bucket1
             * Take the cluster offline (eg. vagrant halt)
             * Copy the following into a Node JS file and run, adjusting cluster address and log in credentials as necessary:

            {code:java}const BUCKET_NAME = 'bucket1';
            const KEY = 'doc1'const couchbase = require('couchbase');try {
                var cluster = new couchbase.Cluster(
                    'http://10.112.193.101:8091', {
                        username: 'Administrator',
                        password: 'password'});
                var bucket = cluster.bucket(BUCKET_NAME);
                var collection = bucket.defaultCollection();
                var binaryCollection = collection.binary(); (async function(){
                    try {
                        const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
                        console.log(getResult);
                    } catch (e){
                        console.log(e);
                    }
                })();} catch (e){
                console.log(e);
            }
            {code} * Observe that nothing is logged 
             * Replace the line:

            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`);
            {code}
            with the following:
            {code:java}const getResult = await collection.get(`${KEY}`);{code}
             
             * Rerun the code and observe that an "Error: cluster object was closed" message is now logged

             

            +Expected Results+

            We would expect a message to be logged in both instances to reflect that the cluster is offline.

             

            +Actual Results+
             * An "Error: cluster object was closed" message is logged when using the following line: 

            {code:java}const getResult = await collection.get(`${KEY}`);{code}
            * No message is logged when using the following line:
            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
             
            +Summary+

            It appears that no error message is given in the terminal when running the following line whilst the cluster is completely offline:
            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
            We would expect for an error message to be shown in the terminal to reflect the fact that the cluster is offline, but nothing is shown in this instance. 

            If we replace the above line with:
            {code:java}const getResult = await collection.get(`${KEY}`);
            {code}
            Then we do get an error message shown in the terminal, as we would expect for the other line:
            {code:java}Error: cluster object was closed
            {code}
              

            +Steps to Reproduce+
             * Create a 1 node cluster on 6.0.3 running Data/Index/Query services
             * Create a Couchbase bucket called "bucket1"
             * Add a document with key = "doc1"
             * Create primary index for bucket1
             * Take the cluster offline (eg. vagrant halt)
             * Copy the following into a Node JS file and run, adjusting cluster address and log in credentials as necessary:

            {code:java}const BUCKET_NAME = 'bucket1';
            const KEY = 'doc1'const couchbase = require('couchbase');try {
                var cluster = new couchbase.Cluster(
                    'http://10.112.193.101:8091', {
                        username: 'Administrator',
                        password: 'password'});
                var bucket = cluster.bucket(BUCKET_NAME);
                var collection = bucket.defaultCollection();
                var binaryCollection = collection.binary(); (async function(){
                    try {
                        const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
                        console.log(getResult);
                    } catch (e){
                        console.log(e);
                    }
                })();} catch (e){
                console.log(e);
            }
            {code} * Observe that no error message is given on the terminal 
             * Replace the line:

            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`);
            {code}
            with the following:
            {code:java}const getResult = await collection.get(`${KEY}`);{code}
             
             * Rerun the code and observe that an "Error: cluster object was closed" message is now shown on the terminal

             

            +Expected Results+

            We would expect an error message to be shown in the terminal in both instances to reflect that the cluster is offline.

             

            +Actual Results+
             * An "Error: cluster object was closed" message is shown on the terminal when using the following line: 

            {code:java}const getResult = await collection.get(`${KEY}`);{code} * No message is shown when using the following line:

            {code:java}const getResult = await cluster.query(`SELECT * from ${BUCKET_NAME}`)
            {code}
             
            Summary Nothing is logged for NodeJS SDK 3.0.1 when the cluster is offline No error message in terminal when cluster is offline for Node.js SDK 3.0.1
            brett19 Brett Lawson made changes -
            Status New [ 10003 ] Open [ 1 ]
            brett19 Brett Lawson made changes -
            Component/s library [ 10250 ]
            brett19 Brett Lawson made changes -
            Fix Version/s 3.0.2 [ 16736 ]
            brett19 Brett Lawson made changes -
            Fix Version/s 3.0.3 [ 16796 ]
            Fix Version/s 3.0.2 [ 16736 ]
            brett19 Brett Lawson made changes -
            Link This issue depends on CCBC-1200 [ CCBC-1200 ]
            brett19 Brett Lawson made changes -
            Component/s lcb [ 15854 ]
            brett19 Brett Lawson made changes -
            Fix Version/s 3.0.7 [ 17049 ]
            Fix Version/s 3.0.6 [ 16796 ]
            ingenthr Matt Ingenthron made changes -
            Sprint SDK 44: Txns, SDK 3.1 [ 1289 ]
            ingenthr Matt Ingenthron made changes -
            Rank Ranked lower
            brett19 Brett Lawson added a comment -

            I've added some additional testing to the SDK for this, and am not able to reproduce the issue.

            brett19 Brett Lawson added a comment - I've added some additional testing to the SDK for this, and am not able to reproduce the issue.
            brett19 Brett Lawson made changes -
            Fix Version/s 3.0.7 [ 17049 ]
            Resolution Cannot Reproduce [ 5 ]
            Status Open [ 1 ] Resolved [ 5 ]

            People

              brett19 Brett Lawson
              callum.majumdar Callum Majumdar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty