question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load shared library 'pact_ffi' or one of its dependencies

See original GitHub issue

Hello. 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:closed
  • Created a year ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
uglyogcommented, May 1, 2022

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.

1reaction
mefellowscommented, Dec 15, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found