Azure / azure-kusto-dotnet

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

Microsoft.Azure.Kusto.Data v10.1.0 - Kusto socket exception #3

Closed kpobb1989 closed 1 year ago

kpobb1989 commented 1 year ago

The latest version of the package throws socket exception when an app tries to connect to kusto from azure cloud. However on the local machine it is working fine.

Here the error message: Kusto client failed to send a request to the service: 'An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call.'

The best solution we were able to find is to downgrade the version of the package like it's described on stackoverflow

Please take a look at it in priority. Thanks.

kwirkykat commented 1 year ago

+1 We are also seeing this socket exception when trying to execute a Kusto query from an Azure Function. We didn't change anything other than updating to the new SDK version.

Here's the line of code where we call: dataSet = await this.queryProvider.ExecuteQueryAsync(databaseName, query, null);

Here's the stack trace: System.Net.Sockets.SocketException (10042): An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call. at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) at Kusto.Data.Net.Client.RestClient2.ConnectCallbackAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- ([0]Kusto.Data.Exceptions.KustoClientException.StackTrace:) at Kusto.Data.Net.Client.RestClient2.MakeHttpRequestAsyncImpl(String address, String csl, String ns, String databaseName, Boolean streaming, ClientRequestProperties properties, ServiceModelTimeoutKind timeoutKind, String clientRequestId, Stream body, StreamProperties streamProperties, CancellationToken cancellationToken, KustoProtocolRequest request) at Kusto.Cloud.Platform.Utils.MonitoredActivity.InvokeAsync[TActivityType,TResult](TActivityType activityType, Func1 func, String clientRequestId) at Kusto.Cloud.Platform.Utils.MonitoredActivity.InvokeAsync[TActivityType,TResult](TActivityType activityType, Func1 func, String clientRequestId) at Kusto.Data.Net.Client.RestClient2.MakeHttpRequestAsync(ActivityType activityType, String baseAddress, String relativeAddress, String clientRequestIdPrefix, String ns, String databaseName, String csl, String addr, Boolean streaming, ClientRequestProperties properties, ServiceModelTimeoutKind timeoutKind, StreamProperties streamProperties, CancellationToken cancellationToken) at Kusto.Data.Net.Client.RestClient2.ExecuteQueryAsync(String databaseName, String query, ClientRequestProperties properties)

a99cl208 commented 1 year ago

Same behavior here on an App Service deployment, and it works locally. I noticed that on the latest version all targets are based on .NET 6.0.8 which was not the case before: image

This may be a hint.

nsulikowski commented 1 year ago

Same problem with 10.1.1. Got resolved when downgrading to 10.0.2

a99cl208 commented 1 year ago

The version 11.0.0 fixed the issue for me.

nsulikowski commented 1 year ago

Yep 11.0.0 worked for me too

kpobb1989 commented 1 year ago

The issue was solved in v11