Couchbase node sdk: libc++abi: terminating due to uncaught exception of type std::runtime_error: sasl_prep: Multibyte UTF-8 is not implemented yet

Hi, i’m trying to connect to Couchbase db with the following code:

cached.conn = await couchbase.connect(connectionString, {
      username: COUCHBASE_USERNAME,
      password: COUCHBASE_PASSWORD,
    });

But it shows below error:

libc++abi: terminating due to uncaught exception of type std::runtime_error: sasl_prep: Multibyte UTF-8 is not implemented yet

I use node version 22.11.0 + couchbase node sdk version 4.3.1. I played around with node version and also couchbase sdk version combinations, and what works for me is using this combination: node version 18.20.4 + couchbase node sdk version 3.2.0. Despite that, I want to use major node version, and also major couchbase node sdk version, so does anyone know how to resolve it?

I use mac m3 on Sonoma 14.7, and can confirm that it also produces the same error on another mac m3, but i’m not sure if this is mac m3-specific. I use couchbase community 7.6.1.

The binary couchbase file that’s in my node_modules is:

couchbase-darwin-arm64-napi/couchbase-v4.3.1-napi-v6-darwin-arm64-boringssl.node

Thanks in advance.

Hi @penguindz – What you have run into is an issue w/ the 4.x version of the Node.js SDK using our C++ SDK “under they hood”. The 3.x version of the Node.js SDK used the C SDK (hence why you don’t have problems w/ 3.2.0).

I have created a ticket for the C++ SDK to make an update to this logic (CXXCBC-628). In the interim, if you want a work-around, can you make sure to avoid using non-ASCII characters for your username?

1 Like

Hi, thank you so much for the response, you’re right, the problem was that the username was using a non-ASCII, but it worked on previous version, so I was confused why it doesn’t on the current major version. Would be nice to get it fixed, but we ultimately decided to just change our username.

Anyway, in case someone else running into the same issue, please check if the username has non-ASCII characters even if it looks like it doesn’t.