temporalio / sdk-dotnet

Temporal .NET SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Unable to load shared library 'temporal_sdk_bridge' issue on docker(linux)

mahdiAkhi opened this issue · comments

What are you really trying to do?

I'm trying to use Temporal on a docker env. Everything is ok on my PC(windows) and Temporal works properly, but when I deploy my code to the server using docker and call the service which uses from the Temporal, I faced the problem Unable to load shared library 'temporal_sdk_bridge'. This issue occurs even when I try the your samlpe .
logs (1).txt

Here is a complete log of the error

System.DllNotFoundException: Unable to load shared library 'temporal_sdk_bridge' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libtemporal_sdk_bridge: cannot open shared object file: No such file or directory
   at Temporalio.Bridge.Interop.Methods.runtime_new(RuntimeOptions* options)
   at Temporalio.Bridge.Runtime..ctor(TemporalRuntimeOptions options)
   at Temporalio.Runtime.TemporalRuntime..ctor(TemporalRuntimeOptions options)
   at Temporalio.Runtime.TemporalRuntime.<>c.<.cctor>b__9_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
--- End of stack trace from previous location ---
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Temporalio.Runtime.TemporalRuntime.get_Default()
   at Temporalio.Client.TemporalConnection.ConnectAsync(TemporalConnectionOptions options)
   at Temporalio.Client.TemporalClient.ConnectAsync(TemporalClientConnectOptions options)
   at NotificationHelper.Service.NotificationSendService.SendSMS(String toPhoneNumber, String messageBody) in /src/common/NotificationHelper/Service/NotificationSendService.cs:line 75

I find useful this issue on dotnet repo. It says that it is possible to use a windows native function.

Are you deploying with temporal_sdk_bridge.dll instead of libtemporal_sdk_bridge.so? You need libtemporal_sdk_bridge.so. We run CI against Linux without issue.

Can you provide the exact steps you are taking to build your docker container? Or rather, can you provide a full Dockerfile that replicates this issue?

Needs more information (closing, can answer above questions and reopen as needed)

@cretz

I have a similar issue when I reference dotnet-sdk package inside Azure Functions hosted on Windows machines.
Using both lazy instantiation or manual TemporalClient.ConnectAsync gives me

Unable to load DLL 'temporal_sdk_bridge' or one of its dependencies: The specified module could not be found. (0x8007007E) error.

However, inside the deployement of my Azure Function I can see runtimes/win-64/native/temporal_sdk_bridge.dll file.

However, inside the deployement of my Azure Function I can see runtimes/win-64/native/temporal_sdk_bridge.dll file.

That is where it's supposed to be in the nuspec file, but I believe a built/deployed form would have that unmanaged DLL right alongside the rest of the managed ones.

Alongside with the managed DLL's currently there's only a Temporalio.dll, both in my local and deployed envs.

You need temporal_sdk_bridge.dll there too (and many other DLLs like Google.Protobuf.dll). This should automatically be put into the bin by dotnet build I believe. This is the case with our https://github.com/temporalio/samples-dotnet which you can try out. You can join us on our public Slack (https://t.mp/slack) in the #dotnet-sdk channel or on our forums at https://community.temporal.io/ for more troubleshooting.