realm::util::websocket::Error - code: 16

I’ve been working on a realm project for a few months and just started getting this error when attempting to open the realm with nodejs sdk

Connection[1]: Connection closed due to error
  name: 'Error',
  message: 'Bad WebSocket response 500 internal server error',
  isFatal: false,
  category: 'realm::util::websocket::Error',
  code: 16,
  userInfo: {}
Connection[1]: Connected to endpoint '' (from '')
ERROR: Connection[1]: Websocket: Expected HTTP response 101 Switching Protocols, but received:
HTTP/1.1 500 Internal Server Error
cache-control: no-cache, no-store, must-revalidate
connection: close
content-length: 204
content-type: application/json
date: Thu, 18 Nov 2021 04:55:47 GMT
server: envoy
vary: Origin
x-envoy-max-retries: 0
x-frame-options: DENY

The logs in MongoDB Realm read:


failed to construct service instance with name "mongodb-atlas": only [uri, clusterId, clusterName, clusterType, clusterSize, clusterUpdated, dbUsername, dbPassword, lastUpdated, wireProtocolEnabled, regionName, groupName, orgName, namespacePreimageConfigs, readPreference, readPreferenceTagSets, sync, sync_query, certificate] are allowed config options

Function Call Location:


Remote IP Address:


darwin vRealmJS/10.6.1

Platform Version:


I’ve terminated and re-enabled sync, reset the client, rolled back changes I had deployed. Nothing helped.

Anyone have any suggestions here? I’m stuck :frowning:

I’ve just opened the project today and the error is no longer occurring.

We need to know why this happened so as to feel confident it won’t happen in production.

Can anyone tell me what error code: 16 means? I can’t find any documentation of it.

Hi @Shea_Dawson,

The Websocket error was a red herring, the error above was indeed happening yesterday, and prevented the service from starting. We shared a workaround yesterday.

A fix was deployed yesterday evening, and has been solving all remaining failures.

Thank you for your collaboration and patience on the matter!

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.