[MONGOCRYPT-576] Include the reason crypt_shared failed to load in error message Created: 01/May/23  Updated: 28/Oct/23  Resolved: 08/May/23

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: 1.8.0

Type: Improvement Priority: Unknown
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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?.



 Comments   
Comment by Githook User [ 09/May/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: MONGOCRYPT-576 Include the error from `mcr_dll_open` in hard error (#638)

  • add a failing test
Comment by Githook User [ 07/May/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: MONGOCRYPT-576 Include the error from `mcr_dll_open` in hard error (#638)

  • add a failing test
Comment by Cloud GitHub Webhooks [ 07/May/23 ]

kevinAlbs merged a pull request (MONGOCRYPT-576 Include the error from `mcr_dll_open` in hard error) into the following branch:
master: 792beee31246fd6dfc7fc8c0629b8769a3fabddf

Generated at Thu Feb 08 09:09:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.