Crash on node js sdk 4.0

Hi, continuing on the previous topic my app crash on connection.
I found the issue, I was using the old deprecated connection method :

new couchbase.Cluster(config.connstr, { username: config.user, password: config.user_pwd });

This does produce a segmentation fault.
Using the new method does not crash.
I was using the old method because the new one have a different format for the connection string and I don’t know how to adapt to the new one( I think there was no example at the time), before I was just passing “host1:port,host2:port”, the new format start with “couchbase://”, it doesn’t parse correctly the old format with the new method.

Anyway, we fixed one problem and I just found another.
I have the following connection string connstr: “couchbase://,”.
The first host is not a valid host on purpose, to mimic a host down, so it should connect with the second host. With the old sdk I can connect just fine the new sdk produce “unhandledRejection UnambiguousTimeoutError: unambiguous timeout”

Hey @00christian00 , thanks so much for letting us know what you’re seeing.

One known cause of some crashes is that in some (believed to be rare) cases we see a segfault if you process.exit(). This leads to some threads not getting to complete background tasks. If you just instead let all of the events be handled before exit, you won’t see this. I found this bug myself, actually.

Interesting-- I thought we had this kind of negative case tested. Is it possible that it still connects, but also produces an error? I’ll have a look and file a bug if appropriate.

I was able to reproduce the issues you have seen and filed and to track their progress.

It looks like the first of those has already merged, so it will be picked up in the next maintenance release. Hopefully that works for you @00christian00 ; if you’re an Enterprise subscriber and need something earlier, you can certainly engage support.

Is there a list of all the breaking changes from sdk v3 to v4? Cannot find it

Hey @losapevo,

You can find the release notes for the Node.js SDK here:

Cheers, Brett

Also, we covered the API migration in the migration guide. You’ll note there are almost no API changes from 3.2 → 4.0.

The major version increment was more related to significant internal changes and us wanting to be clear about that in the release.

1 Like