Skip to content

Unable to load shared library 'GsrSerDeCsGen' or one of its dependencies #493

@duncandee

Description

@duncandee

As per https://docs.aws.amazon.com/glue/latest/dg/schema-registry-gs-serde-csharp.html

I am on macOS using Rider if that helps?

Not sure what I could be doing wrong

var path = Path.Combine(
    AppContext.BaseDirectory, "schema-reg.properties"
);

var glueSchemaRegistryKafkaSerializer = new GlueSchemaRegistryKafkaSerializer(path);
var serialize = glueSchemaRegistryKafkaSerializer.Serialize(new
{
    name = "test-name",
}, "test-topic");
Console.WriteLine(serialize);
<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net8.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="AWS.Glue.SchemaRegistry" Version="1.0.1-linux-arm64" />
    </ItemGroup>

    <ItemGroup>
      <None Update="schema-reg.properties">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </None>
    </ItemGroup>

</Project>

System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.
---> System.DllNotFoundException: Unable to load shared library 'GsrSerDeCsGen' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable:
dlopen(/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/GsrSerDeCsGen.dylib, 0x0001): tried: '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/GsrSerDeCsGen.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/GsrSerDeCsGen.dylib' (no such file), '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/GsrSerDeCsGen.dylib' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/GsrSerDeCsGen.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/GsrSerDeCsGen.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/GsrSerDeCsGen.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/GsrSerDeCsGen.dylib' (no such file)
dlopen(/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/GsrSerDeCsGen.dylib, 0x0001): tried: '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/GsrSerDeCsGen.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/GsrSerDeCsGen.dylib' (no such file), '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/GsrSerDeCsGen.dylib' (no such file)
dlopen(GsrSerDeCsGen.dylib, 0x0001): tried: 'GsrSerDeCsGen.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSGsrSerDeCsGen.dylib' (no such file), '/usr/lib/GsrSerDeCsGen.dylib' (no such file, not in dyld cache), 'GsrSerDeCsGen.dylib' (no such file)
dlopen(/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/libGsrSerDeCsGen.dylib, 0x0001): tried: '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/libGsrSerDeCsGen.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/libGsrSerDeCsGen.dylib' (no such file), '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/libGsrSerDeCsGen.dylib' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/libGsrSerDeCsGen.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/libGsrSerDeCsGen.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/libGsrSerDeCsGen.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/libGsrSerDeCsGen.dylib' (no such file)
dlopen(/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/libGsrSerDeCsGen.dylib, 0x0001): tried: '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/libGsrSerDeCsGen.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/libGsrSerDeCsGen.dylib' (no such file), '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/libGsrSerDeCsGen.dylib' (no such file)
dlopen(libGsrSerDeCsGen.dylib, 0x0001): tried: 'libGsrSerDeCsGen.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibGsrSerDeCsGen.dylib' (no such file), '/usr/lib/libGsrSerDeCsGen.dylib' (no such file, not in dyld cache), 'libGsrSerDeCsGen.dylib' (no such file)
dlopen(/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/GsrSerDeCsGen, 0x0001): tried: '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/GsrSerDeCsGen' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/GsrSerDeCsGen' (no such file), '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/GsrSerDeCsGen' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/GsrSerDeCsGen, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/GsrSerDeCsGen' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/GsrSerDeCsGen' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/GsrSerDeCsGen' (no such file)
dlopen(/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/GsrSerDeCsGen, 0x0001): tried: '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/GsrSerDeCsGen' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/GsrSerDeCsGen' (no such file), '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/GsrSerDeCsGen' (no such file)
dlopen(GsrSerDeCsGen, 0x0001): tried: 'GsrSerDeCsGen' (no such file), '/System/Volumes/Preboot/Cryptexes/OSGsrSerDeCsGen' (no such file), '/usr/lib/GsrSerDeCsGen' (no such file, not in dyld cache), 'GsrSerDeCsGen' (no such file)
dlopen(/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/libGsrSerDeCsGen, 0x0001): tried: '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/libGsrSerDeCsGen' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/libGsrSerDeCsGen' (no such file), '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/runtimes/osx-arm64/native/libGsrSerDeCsGen' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/libGsrSerDeCsGen, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/libGsrSerDeCsGen' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/libGsrSerDeCsGen' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.20/libGsrSerDeCsGen' (no such file)
dlopen(/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/libGsrSerDeCsGen, 0x0001): tried: '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/libGsrSerDeCsGen' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/libGsrSerDeCsGen' (no such file), '/Users/myname/Dev/_Playground/ConsoleApp1/ConsoleApp1/bin/Debug/net8.0/libGsrSerDeCsGen' (no such file)
dlopen(libGsrSerDeCsGen, 0x0001): tried: 'libGsrSerDeCsGen' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibGsrSerDeCsGen' (no such file), '/usr/lib/libGsrSerDeCsGen' (no such file, not in dyld cache), 'libGsrSerDeCsGen' (no such file)

at GsrSerDePINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_GsrSerDe(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
at GsrSerDePINVOKE.SWIGExceptionHelper..cctor()
--- End of inner exception stack trace ---
at GsrSerDePINVOKE.SWIGExceptionHelper..ctor()
at GsrSerDePINVOKE..cctor()

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR welcomeUsers are welcome to submit PRenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions