Hi
The issue
I get errors while debugging ASP.NET 6 app that uses MongoDriver with client encryption in Visual Studio 2022 using docker image.
aspnet:6.0 and sdk:6.0 images
With these images I get the following error:
Exception thrown: ‘System.DllNotFoundException’ in MongoDB.Libmongocrypt.dll: ‘Unable to load shared library ‘libdl’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory’
I added LD_DEBUG environment variable. I cannot add attachments as I am a new user - attaching a link to google drive MongoDB issue in docker - Google Drive.
aspnet:6.0-alpine image
With the mcr.microsoft.com/dotnet/aspnet:6.0-alpine
image I get other error:
‘System.IO.FileNotFoundException’ in MongoDB.Libmongocrypt.dll: ‘/app/bin/Debug/net6.0/runtimes/linux/native/libmongocrypt.so’
More context info:
- NET 6.0
- MongoDB.Driver 2.17.1
- Base images that I tried
- aspnet
mcr.microsoft.com/dotnet/aspnet:6.0
mcr.microsoft.com/dotnet/aspnet:6.0-alpine
- SDK
mcr.microsoft.com/dotnet/sdk:6.0
- aspnet
- Client encryption
- Local KMS provider
Exception stack trace
> at MongoDB.Libmongocrypt.LibraryLoader.LinuxLibrary.dlopen(String filename, Int32 flags)
> at MongoDB.Libmongocrypt.LibraryLoader.LinuxLibrary..ctor(String path)
> at MongoDB.Libmongocrypt.LibraryLoader..ctor()
> at MongoDB.Libmongocrypt.Library.<>c.<.cctor>b__0_61()
> at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
> at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
> at System.Lazy`1.CreateValue()
> at MongoDB.Libmongocrypt.Library.<>c.<.cctor>b__0_1()
> at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
> at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
> at System.Lazy`1.CreateValue()
> at MongoDB.Libmongocrypt.CryptClientFactory.Create(CryptOptions options)
> at MongoDB.Driver.Encryption.ClientEncryption..ctor(ClientEncryptionOptions clientEncryptionOptions)
Thanks.