mongodb-client-encryption 7.1.0 and 7.2.0 macOS prebuilt fail to load due to missing libmongocrypt symbol

XMLWordPrintableJSON

    • 1
    • 2
    • Not Needed
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a Node.js application developer using Client-Side Field Level Encryption on macOS,
      I want the published mongodb-client-encryption native prebuilt to load successfully,
      so that applications using ClientEncryption can start without downgrading dependencies.

      User Experience

      Expected:

      mongodb-client-encryption should load successfully after a normal npm installation.

      Actual:

      The macOS prebuilt native addon included with mongodb-client-encryption 7.1.0 and 7.2.0 fails to load with:

      Error: dlopen(.../node_modules/mongodb-client-encryption/build/Release/mongocrypt.node, 0x0001):
      symbol not found in flat namespace
      '_mongocrypt_ctx_explicit_encrypt_expression_init'
      
      code: 'ERR_DLOPEN_FAILED'
      

      Loading the package normally:

      node -e "require('mongodb-client-encryption')"
      

      produces a misleading fallback error:

      Error: Cannot find module '../build/Debug/mongocrypt.node'
      

      The Release binary exists. The Debug error occurs after bindings.js catches the Release-addon loading failure and attempts to load the nonexistent Debug binary.

      This is blocking for applications using ClientEncryption or automatic encryption. The current workaround is to remain on mongodb-client-encryption 7.0.0.

      One customer is confirmed affected. The problem reproduces deterministically in an empty npm project with no application dependencies.

      Environment

      macOS / Darwin: 24.6.0
      Node.js: v24.16.0
      Node architecture: x64
      mongodb-client-encryption: 7.1.0 and 7.2.0
      Package manager: npm
      

      The downloaded native addon is a universal macOS binary containing both x86_64 and arm64 architectures.

      Reproduction

      mkdir mongo-issue
      cd mongo-issue
      npm init -y
      npm install mongodb-client-encryption@7.1.0
      
      node -e "require('./node_modules/mongodb-client-encryption/build/Release/mongocrypt.node')"
      

      Actual result:

      Error: dlopen(.../mongocrypt.node, 0x0001):
      symbol not found in flat namespace
      '_mongocrypt_ctx_explicit_encrypt_expression_init'
      

      The same failure occurs with mongodb-client-encryption 7.2.0.

      Version Comparison

      mongodb-client-encryption 7.0.0:

      npm install mongodb-client-encryption@7.0.0
      node -e "require('mongodb-client-encryption'); console.log('7.0.0 loaded')"
      

      Result:

      7.0.0 loaded
      

      mongodb-client-encryption 7.1.0:

      ERR_DLOPEN_FAILED:
      symbol not found in flat namespace
      '_mongocrypt_ctx_explicit_encrypt_expression_init'
      

      mongodb-client-encryption 7.2.0:

      Fails with the same missing symbol.

      This indicates that the regression was introduced in version 7.1.0.

      Binary Information

      file node_modules/mongodb-client-encryption/build/Release/mongocrypt.node
      
      Mach-O universal binary with 2 architectures:
      [x86_64: Mach-O 64-bit bundle x86_64]
      [arm64: Mach-O 64-bit bundle arm64]
      
      otool -L node_modules/mongodb-client-encryption/build/Release/mongocrypt.node
      
      /usr/lib/libc++.1.dylib
      /usr/lib/libSystem.B.dylib
      

      There is no external libmongocrypt dynamic-library dependency shown by otool.

      A previously installed Homebrew libmongocrypt package was removed before repeating the clean-project reproduction. The issue still reproduces.

      Dependencies

      This may be related to NODE-7569.

      NODE-7569 changed how libmongocrypt artifacts are downloaded and was released in mongodb-client-encryption 7.1.0, which is the first affected version.

      NODE-5143 concerns build-from-source behavior and incompatible system libmongocrypt installations. It appears separate from this failure because this report concerns the published prebuilt addon in a clean environment.

      Risks / Unknowns

      It is not yet confirmed whether the issue affects:

      • macOS arm64 processes as well as x64 processes
      • Node.js 22 as well as Node.js 24
      • every supported macOS version

      However, the published universal binary contains an unresolved reference to mongocrypt_ctx_explicit_encrypt_expression_init, and the failure reproduces consistently on the environment listed above.

            Assignee:
            Sergey Zelenov
            Reporter:
            Tal Bar (EXT)
            Pavel Safronov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: