Azure / azure-kusto-dotnet

Azure Data Explorer (Kusto) SDK for .NET
MIT License
6 stars 3 forks source link

Kusto.Cloud.Platform.Utils.NativeThread Exception #31

Closed piotrszkudlarski closed 2 months ago

piotrszkudlarski commented 2 months ago

Hi, We are using Microsoft.Azure.Kusto in versions:

"Microsoft.Azure.Kusto.Data" Version="12.0.0"
"Microsoft.Azure.Kusto.Language" Version="11.3.5"

In service app which is based on linux docker image.

In logs we can see:

2024-05-10T06:37:23.268811208Z Unhandled exception. System.TypeInitializationException: The type initializer for 'Kusto.Cloud.Platform.Utils.NativeThread' threw an exception.
2024-05-10T06:37:23.268875109Z  ---> System.DllNotFoundException: Unable to load shared library 'kernel32.dll' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: 
2024-05-10T06:37:23.268886509Z /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.4/kernel32.dll.so: cannot open shared object file: No such file or directory

More logs:

2024-05-10T07:20:51.184924275Z warn: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[16]
2024-05-10T07:20:51.184998776Z       The WebRootPath was not found: /app/wwwroot. Static files may be unavailable.
2024-05-10T07:20:51.236176698Z info: Microsoft.Hosting.Lifetime[14]
2024-05-10T07:20:51.236220498Z       Now listening on:http://[::]:8080/
2024-05-10T07:20:51.237784317Z info: Microsoft.Hosting.Lifetime[0]
2024-05-10T07:20:51.237810118Z       Application started. Press Ctrl+C to shut down.
2024-05-10T07:20:51.238895531Z info: Microsoft.Hosting.Lifetime[0]
2024-05-10T07:20:51.238913531Z       Hosting environment: Staging
2024-05-10T07:20:51.239952444Z info: Microsoft.Hosting.Lifetime[0]
2024-05-10T07:20:51.239969844Z       Content root path: /app

We are using ICslQueryProvider to get data from adx:

using var reader = await _cslQueryProvider.ExecuteQueryAsync(string.Empty, query, clientRequestProperties, cancellationToken);
var returnValue = reader.Parse().ToList();

Registration of ICslQueryProvider:

builder.Services.AddSingleton(services =>
{
    var config = services.GetRequiredService<IConfiguration>();
    var connectionString = config.GetConnectionString("DbConnectionString");
    var builder = new KustoConnectionStringBuilder(connectionString);
     builder = builder.WithAadSystemManagedIdentity();
    return KustoClientFactory.CreateCslQueryProvider(builder);
});

We are running simple queries like get latest data using arg_max function.

Could you please advise what is wrong?

tomersh26 commented 2 months ago

Probably you're using an old version of the library. Please try to upgrade to at least version 12.0.1.

piotrszkudlarski commented 2 months ago

Upgrading libraries helped thanks