I am having issues with upgrading to nodejs 12 with couchbase nodejs sdk 2.6.9

I am getting the below error when upgrading to nodejs 12. It comes from couchbase install script where node-gyp install is done. (I am working on windows) :

gyp ERR! configure error gyp ERR! stack Error: write EPROTO 18492:error:1425F175:SSL routines:ssl_choose_client_version:inappropriate fallback:c:\ws\deps\openssl\openssl\ssl\statem\statem_lib.c:1951

Can anybody help me with this please ?

Hey @Vidhi-Choudhary,

Looks like there was a breaking change somewhere in Node 12. I think I saw a recent note from someone about the identical issue happening with Node 13. We are looking into it.

Cheers, Brett

Hey @Vidhi-Choudhary,

Upon taking a second look at this, it appears that this is likely a different issue than the one we are seeing with Node.js v13. Are you able to provide any more details about your environment? I have thus far been unable to reproduce this issue with Node.js v12.13.1.

Cheers, Brett

Hi Brett,

Dont you get error when ‘node-gyp rebuild’ is done for couchbase sdk ? I am behind a corporate proxy, could it be because of that ? I read that in nodejs 12, the default TLS protocol version has changed and hence this error. Did you use any flag while running the npm install ?

Hey @brett19 ,

Were you able to reproduce the issue ?

Hey @Vidhi-Choudhary,

Unfortunately I was not! I get no errors when building or rebuilding, I’ve used a variety of versions of Node.js and had no issues. I was not using any special flags when installing. Windows 10 x64.

Cheers, Brett

Hi @brett19,

I am still getting it, could be because I am behind a corporate proxy. Adding some logs for install with verbose flag:

gyp http GET https://nodejs.org/download/release/v12.13.1/node-v12.13.1-headers.tar.gz
gyp verb download using proxy url: “<proxy_url>”
(node:15976) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to ‘0’ makes TLS connections and HTTPS requests insecure by disabling certificate verification.
gyp WARN install got an error, rolling back install

What version of python and windows build tools are you using?

UPDATE: Doesn’t seem to be an issue with couchbase 2.6.9
Hi @brett19,
I’m running into the same issue (couchbase v2.4.3, node v12.14.0, running on OSX Catalina 10.15.1). For me 15 errors are produced. I will list them below in case they’re helpful. Nodejs12 did upgrade to use TLS 1.3 as default.

In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:40:
In file included from ../node_modules/nan/nan.h:203:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to
      'Local<v8::Context>'
  return scope.Escape(v8::Function::New( isolate
In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:40:
In file included from ../node_modules/nan/nan.h:203:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:337:37: error: too few arguments to function call, expected 2, have
      1
  return v8::StringObject::New(value).As<v8::StringObject>();
In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:40:
In file included from ../node_modules/nan/nan.h:203:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:337:58: error: expected '(' for function-style cast or type
      construction
  return v8::StringObject::New(value).As<v8::StringObject>();
../node_modules/nan/nan_implementation_12_inl.h:337:60: error: expected expression
  return v8::StringObject::New(value).As<v8::StringObject>();
In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:40:
../node_modules/nan/nan.h:916:44: error: no matching member function for call to 'ToString'
      v8::Local<v8::String> string = from->ToString();
In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:40:
../node_modules/nan/nan.h:926:37: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of
      type 'char *'
        length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:40:
In file included from ../node_modules/nan/nan.h:2365:
../node_modules/nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object,
      v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());
In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:40:
In file included from ../node_modules/nan/nan.h:2365:
../node_modules/nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object,
      v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:59:
../src/cas.h:33:16: error: no template named 'Handle' in namespace 'v8'
    static v8::Handle<v8::Value> CreateCas(uint64_t);
           ~~~~^
In file included from ../src/couchbase_impl.cc:21:
In file included from ../src/couchbase_impl.h:60:
../src/token.h:38:16: error: no template named 'Handle' in namespace 'v8'
    static v8::Handle<v8::Value> CreateToken(lcb_t instance, const lcb_MUTATION_TOKEN*);
../src/token.h:39:16: error: no template named 'Handle' in namespace 'v8'
    static v8::Handle<v8::Value> CreateToken(lcb_t instance, int cbtype, const lcb_RESPBASE*);
In file included from ../src/couchbase_impl.cc:21:
../src/couchbase_impl.h:72:11: error: no member named 'Handle' in namespace 'v8'
using v8::Handle;
      ~~~~^
../src/couchbase_impl.h:101:12: error: no template named 'Handle'
    static Handle<Object> createConstants();
           ^
../src/couchbase_impl.h:145:5: error: no template named 'Handle'
    Handle<Value> decodeDoc(const void *bytes, size_t nbytes, lcb_U32 flags);
    ^
../src/couchbase_impl.cc:107:1: error: no template named 'Handle'
Handle<Value> CouchbaseImpl::decodeDoc(
../src/couchbase_impl.cc:116:16: error: no viable conversion from returned value of type 'v8::Local<v8::Value>' to
      function return type 'int'
        return transDecodeFunc->Call(1, args);
../src/couchbase_impl.cc:119:12: error: no viable conversion from returned value of type 'Local<v8::Value>' to
      function return type 'int'
    return DefaultTranscoder::decode(bytes, nbytes, flags);
../src/couchbase_impl.cc:140:15: error: use of undeclared identifier 'Handle'; did you mean 'handle'?
              Handle<Object> encObj = res.As<Object>();
              handle
../node_modules/nan/nan_object_wrap.h:42:32: note: 'handle' declared here
  inline v8::Local<v8::Object> handle() const {
../src/couchbase_impl.cc:140:15: error: 'handle' does not name a template but is followed by template arguments
              Handle<Object> encObj = res.As<Object>();