Unable to load shared library 'pact_ffi' or one of its dependencies
See original GitHub issueHello. I have an issue with the current PactNet Beta version (4.0.0-beta.3) in the CI pipeline.
Error Message:
System.DllNotFoundException : Unable to load shared library 'pact_ffi' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library libpact_ffi: No such file or directory
Next, I tried to run the tests in docker with the mcr.microsoft.com/dotnet/sdk:6.0
image and the tests runed successful.
After that, I changed the image to mcr.microsoft.com/dotnet/sdk:6.0-alpine
and got the following error:
Error Message:
System.DllNotFoundException : Unable to load shared library 'pact_ffi' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library libpact_ffi: No such file or directory
Stack Trace:
at PactNet.Interop.NativeInterop.LogToBuffer(LevelFilter levelFilter)
at PactNet.Verifier.InteropVerifierProvider.Initialise()
at PactNet.Verifier.PactVerifier.InitialiseProvider(String providerName, Uri pactUri)
at PactNet.Verifier.PactVerifier.ServiceProvider(String providerName, Uri pactUri)
What additional information to provide to correct the issue?
Issue Analytics
- State:
- Created a year ago
- Comments:17 (13 by maintainers)
Top Results From Across the Web
Add `linux-musl-x64` Runtime Support · Issue #374
The FFI for musl currently only outputs a static .a library, whereas . ... Unable to load shared library 'pact_ffi' or one of...
Read more >Pact FFI | Pact Docs
Pact FFI. This crate provides a Foreign Function Interface (FFI) to the Pact-Rust crates, with the intent of enabling Pact's core matching ...
Read more >Unable to load shared library 'libdl.so' or one of its ...
I'm trying to compile a project and the compilation fails due to a missing library. ... I've been searching for known solutions in...
Read more >Unable to load shared library 'libwkhtmltox' or one of its ...
I am using https://github.com/rdvojmoc/DinkToPdf DinkToPDF library to convert a html to PDF. Everything working fine in local environment.
Read more >Dotnet driver v2.14.1 error: "Unable to load shared library ' ...
I get Unable to load shared library 'libdl' or one of its dependencies exception when initializing the client in this specific case:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While it is technically possible to create a dynamically linked library for Alpine, it is not advisable to do so. In essence, what you are creating is a shared library with the musl C library statically linked into it. What this means, if you then try to use this library on a different version of Alpine/musl, it can result in corruption of thread state and segmentation violations.
Dynamically linked libraries will have to be built for each specific version of Alpine and musl, and I don’t see the benefit in maintaining that. If people what this, I would recommend using Debian based docker images which support dynamically linked glibc.
Hi Reetu, glad to see you got it working. I will just add a reminder that (as per Ron’s comments above) it’s highly likely you will eventually run into issues on Alpine with that setup. We don’t officially support that setup, so please do note that if you do run into issues.