-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
Proposal
Include the error from mcr_dll_open when crypt_shared fails to load and an override path is set. Include the error from mcr_dll_open to this error.
Background & Motivation
Motivated by a discussion with kenneth.white@mongodb.com. A common mistake is using crypt_shared library built for the wrong architecture. The error returned by the driver does not indicate the cause of the error. Example:
A crypt_shared override path was specified [/Users/kevin.albertson/bin/mongo_crypt_shared_v1-macos-x86_64-enterprise-6.0.5/lib/mongo_crypt_v1.dylib], but we failed to open a dynamic library at that location
libmongocrypt logs the error from mcr_dll_open:
dlopen(/Users/kevin.albertson/bin/mongo_crypt_shared_v1-macos-x86_64-enterprise-6.0.5/lib/mongo_crypt_v1.dylib, 0x0005): tried: '/Users/kevin.albertson/code/libmongocrypt/.install/lib//mongo_crypt_v1.dylib' (no such file), '/Users/kevin.albertson/bin/mongo_crypt_shared_v1-macos-x86_64-enterprise-6.0.5/lib/mongo_crypt_v1.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
Not all drivers surface libmongocrypt logs. See Do drivers expose libmongocrypt logs?.