-
Notifications
You must be signed in to change notification settings - Fork 890
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
Not working in Docker: Unable to load shared library 'git2-106a5f2' or one of its dependencies #1798
Comments
This is a known issue. Ubuntu 20.04 isn't going to work right now. You'll need to an older version of Ubuntu, and when you publish, you likely need to use a more specific RID to ensure you're getting the correct native binary from the package. |
Can you link the issue please :) Using RID (runtime identifier) However alpine with RID
Poc-Repo available here, Image available here For now I can work with ubuntu-18.04, but it would be very nice if this would work with alpine, because it's very small (which makes it really good for micro-services 😉): |
It's talked about in several issues on the repo. For the alpine image you're trying, you probably need to use the Yes, this is all more complicated than I'd like for it to be. Ultimately, the fix is going to be getting #1618 finished, which is slowly happening. |
Integrate new implementations from libgit2/libgit2sharp#1618 With the previous version, in deployments on Docker found the 'load from git' function in the Elm Editor did not work. The backend returned this error with the HTTP response: ``` Exception in volatile host: System.AggregateException: One or more errors occurred. (The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.) ---> System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'git2-106a5f2' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-106a5f2: cannot open shared object file: No such file or directory at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary() at LibGit2Sharp.Core.NativeMethods..cctor() --- End of inner exception stack trace --- at LibGit2Sharp.Core.NativeMethods.git_clone(git_repository*& repo, String origin_url, FilePath workdir_path, GitCloneOptions& opts) at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) at Kalmit.LoadFromGithub.LoadFromUrl(String sourceUrl) in /app/PersistentProcess/PersistentProcess.Common/LoadFromGithub.cs:line 109 at Kalmit.LoadFromPath.LoadTreeFromPath(String path) in /app/PersistentProcess/PersistentProcess.Common/LoadFromPath.cs:line 11 [...] ``` See the discussion of the problem at libgit2/libgit2sharp#1798 Another workaround found in the discussion was switching to the bionic flavor of the .net docker image.
Integrate new implementations from libgit2/libgit2sharp#1618 With the previous version, in deployments on Docker found the 'load from git' function in the Elm Editor did not work. The backend returned this error with the HTTP response: ``` Exception in volatile host: System.AggregateException: One or more errors occurred. (The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.) ---> System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'git2-106a5f2' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-106a5f2: cannot open shared object file: No such file or directory at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary() at LibGit2Sharp.Core.NativeMethods..cctor() --- End of inner exception stack trace --- at LibGit2Sharp.Core.NativeMethods.git_clone(git_repository*& repo, String origin_url, FilePath workdir_path, GitCloneOptions& opts) at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) at Kalmit.LoadFromGithub.LoadFromUrl(String sourceUrl) in /app/PersistentProcess/PersistentProcess.Common/LoadFromGithub.cs:line 109 at Kalmit.LoadFromPath.LoadTreeFromPath(String path) in /app/PersistentProcess/PersistentProcess.Common/LoadFromPath.cs:line 11 [...] ``` See the discussion of the problem at libgit2/libgit2sharp#1798 and libgit2/libgit2sharp#1747 Another workaround found in the discussion was switching to the bionic flavor of the .net docker image.
Overview - The workflow
For details see below.
dotnet publish -c Release -r linux-x64 /p:PublishSingleFile=true
, which creates a standalone file and requires no dotnet locally installedFROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-focal
) is built with this fileHowever locally (on windows) it does not...
I also already checked out other issues, but found no workaround for my case:
Also tried to run / build the project not as self-contained file (without
/p:PublishSingleFile=true
and other modifications likeFROM mcr.microsoft.com/dotnet/core/runtime:3.1-focal
) but this also didn't work.Reproduction steps
I created a PoC repo here: https://github.com/litetex/LibGit2SharpPoc
Dockerfile
https://github.com/litetex/LibGit2SharpPoc/blob/develop/build/Dockerfile
Github workflow
https://github.com/litetex/LibGit2SharpPoc/blob/develop/.github/workflows/develop.yml
Project file
Code
Expected behavior
I expect the same behavior, as if I build it locally (
dotnet publish -c Release -r win-x64 /p:PublishSingleFile=true
) and execute the file:No crash, exit successfully :)
Actual behavior
When I start the container with:
It crashes with:
Version of LibGit2Sharp (release number or SHA1)
0.26.2 (latest at the moment)
Operating system(s) tested; .NET runtime tested
The text was updated successfully, but these errors were encountered: