Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DllNotFoundException in ASP.NET Core 3.1 Docker container #481

Closed
sibbl opened this issue Jan 14, 2020 · 2 comments
Closed

DllNotFoundException in ASP.NET Core 3.1 Docker container #481

sibbl opened this issue Jan 14, 2020 · 2 comments

Comments

@sibbl
Copy link

@sibbl sibbl commented Jan 14, 2020

Describe the bug

I'd like to build a docker container of my ASP.NET Core 3.1 application which uses the Speech SDK.

Unfortunately I get the following exception as soon as SpeechConfig.FromEndpoint(any(Uri), any(string)) is called:

DllNotFoundException: Unable to load shared library 
'libMicrosoft.CognitiveServices.Speech.core.so' or one of its dependencies.
In order to help diagnose loading problems, consider setting the LD_DEBUG
environment variable: liblibMicrosoft.CognitiveServices.Speech.core.so:
cannot open shared object file: No such file or directory

I'm building it with the "bionics" base images from Microsoft, which is based on Ubuntu 18.04. As far as I read this should be supported.

I've provided a small test project which can be run as is to reproduce the issue: SpeechSdkDockerTestProject.zip

To Reproduce
Steps to reproduce the behavior:

  1. Open the project above in Visual Studio (2019, Windows, all updates installed)
  2. Run the "Docker" target
  3. Wait until /helloworld is loaded in your browser or open it yourself

Expected behavior
The string "hello world" should be returned instead of the exception above.

Version of the Cognitive Services Speech SDK
1.8.0
Platform, Operating System, and Programming Language

  • OS: Windows
  • Hardware: x64
  • Programming language: C#
  • Browser doesn't matter

Additional context

  • I'm using Linux containers in Docker v2.1.0.5
  • running cat /etc/os-release inside the Docker container returns Ubuntu 18.04.3 LTS (Bionic Beaver)
  • the runtimes directory including the *.so libs exist in the container
@Curious425

This comment has been minimized.

Copy link

@Curious425 Curious425 commented Jan 14, 2020

In addition to ensuring the so file is there, have you set your LD_LIBRARY_PATH to include that location.

Also, did you install openssl and libasound packages inside the docker image?

https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/quickstart/cpp/linux/from-microphone/README.md

@sibbl

This comment has been minimized.

Copy link
Author

@sibbl sibbl commented Jan 15, 2020

@Curious425 thanks a lot, that helped me solving it! Indeed these packages were missing in my container. No LD_LIBRARY_PATH was necessary though.

@sibbl sibbl closed this Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.