Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 3.0.0, 3.0.1, 3.0.2
    • None
    • Mac OS Mojave, node v12.14.0, couchnode v3.0.2, vscode
    • 1

    Description

      ```
      var cluster = new couchbase.Cluster(
      'http://localhost:8091',

      { username:'Administrator', password:'Administrator'}

      )
       
      var bucket = cluster.bucket('beer-sample')
      ```
       
      When connecting, there is an error https://github.com/couchbase/couchnode/blob/master/lib/connection.js#L101
       
      "LCB_ERR_TIMEOUT (201): A request cannot be completed until the user-defined timeout fired"
       
      And the connection is closed. Then when I query `cluster.query(sqlStr)` it returns `Error: parent cluster object has been closed` because the connection is closed.
       
      The problem is that it fails randomly. If I use a debugger it has more chances to fail.
       
      Using the `async` functions to wait for the cluster creation seems to work fine. Something link:
       
      ```
      couchbase.Cluster.connect('http://localhost:8091',

      {    username: 'Administrator',    password: 'Administrator'}

      )
      .then((cluster) =>

      {       var bucket = cluster.bucket('beer-sample');       ... }

      );
      ```

      Attachments

        Issue Links

          Activity

            People

              brett19 Brett Lawson
              xgalen Alfredo López
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty