Skip to content
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

[Bug Report] Windows ModuleClient: Cannot connect to EdgeHub #2223

Closed
and-rewsmith opened this issue Oct 28, 2021 · 4 comments
Closed

[Bug Report] Windows ModuleClient: Cannot connect to EdgeHub #2223

and-rewsmith opened this issue Oct 28, 2021 · 4 comments
Assignees
Labels
bug Something isn't working. IoTSDK Tracks all IoT SDK issues across the board

Comments

@and-rewsmith
Copy link

and-rewsmith commented Oct 28, 2021

Context

  • OS, version, SKU and CPU architecture used: Windows 10 Enterprise
  • Application's .NET Target Framework : netcoreapp3.1
  • Device: Windows 10 Enterprise Azure VM
  • SDK version used: <PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.28.2" /

Description of the issue

Please be as detailed as possible: which feature has a problem, how often does it fail, etc.

I am a member of the IoT Edge team. On windows only, we have observed behavior where the devices sdk tries to connect to EdgeHub. The ModuleClient will sometimes timeout connecting to EdgeHub. In many cases the ModuleClient will continue timing out and never successfully connect.

Code sample exhibiting the issue

Here is the module we are using to connect to EdgeHub. It is meant to be the canonical, basic example.
https://github.com/Azure/iotedge/tree/master/edge-modules/SimulatedTemperatureSensor

Here is one of our E2E tests where we see this issue. Notice how the module times out after EdgeHub is up and running. Also subsequent attempts to connect fail too. Timeline:

  1. TempSensor module starts at 16:48:29
  2. EdgeHub opens ports at 16:48:30
  3. TempSensor times out 3 times periodically (ModuleClient timeout set to 1 minute, overriding default)
    https://github.com/Azure/iotedge/blob/27bdf7d9afedf1f997e2fbc262b52efbbbbcefc0/edge-modules/SimulatedTemperatureSensor/src/Program.cs#L295

Test run exhibiting this behavior with logs:
https://dev.azure.com/msazure/One/_build/results?buildId=48134614&view=ms.vss-test-web.build-test-results-tab&runId=940061006&resultId=100000&paneView=attachments

~This reproduces 1/7 times iirc.Our theory is that if the ModuleClient tries to connect before EdgeHub has opened its ports then this will happen. When we added a wait to our module that waited enough time for EdgeHub to be guaranteed up and running at the time of ModuleClient.OpenAsync(), these problems disappeared.

The above strikethrough actually isn't the case. Even if EdgeHub is up and running, the ModuleClient will sometimes fail repeatedly to connect. And it happens ~40% of the time. This test run shows this happening:
https://msazure.visualstudio.com/One/_build/results?buildId=48370188&view=ms.vss-test-web.build-test-results-tab&runId=945793648&resultId=100007&paneView=debug

This also seems to reproduce with all protocols, not just Amqp_Tcp_Only.

I am available for assistance if you want to chat about this. My microsoft alias is andsmi.

Console log of the issue

Follow the instructions here to capture SDK logs.
Don't forget to remove any connection string information!

Click to expand code sample
SimulatedTemperatureSensor Main() started.
Initializing simulated temperature sensor to send 1 messages, at an interval of 5 seconds.
To change this, set the environment variable MessageCount to the number of messages that should be sent (set it to -1 to send unlimited messages).
[Information]: Trying to initialize module client using transport type [Amqp_Tcp_Only].
Unhandled exception. System.AggregateException: One or more errors occurred. (Transient network error occurred, please retry.)
 ---> Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: Transient network error occurred, please retry.
 ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
   at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
--- End of stack trace from previous location where exception was thrown ---
   at System.Net.Security.SslStream.ThrowIfExceptional()
   at System.Net.Security.SslStream.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result)
   at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__64_2(IAsyncResult iar)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Amqp.TaskHelpers.EndAsyncResult(IAsyncResult asyncResult)
   at Microsoft.Azure.Amqp.StreamExtensions.EndAuthenticateAsClient(SslStream sslStream, IAsyncResult asyncResult)
   at Microsoft.Azure.Amqp.Transport.TlsTransport.HandleOpenComplete(IAsyncResult result, Boolean syncComplete)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Amqp.ExceptionDispatcher.Throw(Exception exception)
   at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.OpenAsyncResult.End(IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.EndOpen(IAsyncResult result)
   at Microsoft.Azure.Amqp.Transport.TlsTransportInitiator.HandleTransportOpened(IAsyncResult result)
   at Microsoft.Azure.Amqp.Transport.TlsTransportInitiator.OnTransportOpened(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpIoTTransport.InitializeAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpIoTConnector.OpenConnectionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnectionHolder.EnsureConnectionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnectionHolder.OpenSessionAsync(DeviceIdentity deviceIdentity, TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.EnsureSessionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.OpenAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpTransportHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass23_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass33_0.<<OpenInternalAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at SimulatedTemperatureSensor.Program.<>c__DisplayClass18_0.<<CreateModuleClientAsync>b__1>d.MoveNext() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 298
--- End of stack trace from previous location where exception was thrown ---
   at SimulatedTemperatureSensor.Program.CreateModuleClientAsync(TransportType transportType, ITransientErrorDetectionStrategy transientErrorDetectionStrategy, RetryStrategy retryStrategy) in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 272
   at SimulatedTemperatureSensor.Program.MainAsync() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 80
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at SimulatedTemperatureSensor.Program.Main() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 49
SimulatedTemperatureSensor Main() started.
Initializing simulated temperature sensor to send 1 messages, at an interval of 5 seconds.
To change this, set the environment variable MessageCount to the number of messages that should be sent (set it to -1 to send unlimited messages).
[Information]: Trying to initialize module client using transport type [Amqp_Tcp_Only].
Unhandled exception. System.AggregateException: One or more errors occurred. (Transient network error occurred, please retry.)
 ---> Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: Transient network error occurred, please retry.
 ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
   at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
--- End of stack trace from previous location where exception was thrown ---
   at System.Net.Security.SslStream.ThrowIfExceptional()
   at System.Net.Security.SslStream.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result)
   at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__64_2(IAsyncResult iar)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Amqp.TaskHelpers.EndAsyncResult(IAsyncResult asyncResult)
   at Microsoft.Azure.Amqp.StreamExtensions.EndAuthenticateAsClient(SslStream sslStream, IAsyncResult asyncResult)
   at Microsoft.Azure.Amqp.Transport.TlsTransport.HandleOpenComplete(IAsyncResult result, Boolean syncComplete)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Amqp.ExceptionDispatcher.Throw(Exception exception)
   at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.OpenAsyncResult.End(IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.EndOpen(IAsyncResult result)
   at Microsoft.Azure.Amqp.Transport.TlsTransportInitiator.HandleTransportOpened(IAsyncResult result)
   at Microsoft.Azure.Amqp.Transport.TlsTransportInitiator.OnTransportOpened(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpIoTTransport.InitializeAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpIoTConnector.OpenConnectionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnectionHolder.EnsureConnectionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnectionHolder.OpenSessionAsync(DeviceIdentity deviceIdentity, TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.EnsureSessionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.OpenAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpTransportHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass23_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass33_0.<<OpenInternalAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at SimulatedTemperatureSensor.Program.<>c__DisplayClass18_0.<<CreateModuleClientAsync>b__1>d.MoveNext() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 298
--- End of stack trace from previous location where exception was thrown ---
   at SimulatedTemperatureSensor.Program.CreateModuleClientAsync(TransportType transportType, ITransientErrorDetectionStrategy transientErrorDetectionStrategy, RetryStrategy retryStrategy) in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 272
   at SimulatedTemperatureSensor.Program.MainAsync() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 80
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at SimulatedTemperatureSensor.Program.Main() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 49
SimulatedTemperatureSensor Main() started.
Initializing simulated temperature sensor to send 1 messages, at an interval of 5 seconds.
To change this, set the environment variable MessageCount to the number of messages that should be sent (set it to -1 to send unlimited messages).
[Information]: Trying to initialize module client using transport type [Amqp_Tcp_Only].
Unhandled exception. System.AggregateException: One or more errors occurred. (Transient network error occurred, please retry.)
 ---> Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: Transient network error occurred, please retry.
 ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
   at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
--- End of stack trace from previous location where exception was thrown ---
   at System.Net.Security.SslStream.ThrowIfExceptional()
   at System.Net.Security.SslStream.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result)
   at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__64_2(IAsyncResult iar)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Amqp.TaskHelpers.EndAsyncResult(IAsyncResult asyncResult)
   at Microsoft.Azure.Amqp.StreamExtensions.EndAuthenticateAsClient(SslStream sslStream, IAsyncResult asyncResult)
   at Microsoft.Azure.Amqp.Transport.TlsTransport.HandleOpenComplete(IAsyncResult result, Boolean syncComplete)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Amqp.ExceptionDispatcher.Throw(Exception exception)
   at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.OpenAsyncResult.End(IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.EndOpen(IAsyncResult result)
   at Microsoft.Azure.Amqp.Transport.TlsTransportInitiator.HandleTransportOpened(IAsyncResult result)
   at Microsoft.Azure.Amqp.Transport.TlsTransportInitiator.OnTransportOpened(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpIoTTransport.InitializeAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpIoTConnector.OpenConnectionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnectionHolder.EnsureConnectionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpConnectionHolder.OpenSessionAsync(DeviceIdentity deviceIdentity, TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.EnsureSessionAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.OpenAsync(TimeSpan timeout)
   at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpTransportHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass23_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func`1 asyncOperation)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass33_0.<<OpenInternalAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at SimulatedTemperatureSensor.Program.<>c__DisplayClass18_0.<<CreateModuleClientAsync>b__1>d.MoveNext() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 298
--- End of stack trace from previous location where exception was thrown ---
   at SimulatedTemperatureSensor.Program.CreateModuleClientAsync(TransportType transportType, ITransientErrorDetectionStrategy transientErrorDetectionStrategy, RetryStrategy retryStrategy) in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 272
   at SimulatedTemperatureSensor.Program.MainAsync() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 80
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at SimulatedTemperatureSensor.Program.Main() in D:\a\_work\1\s\edge-modules\SimulatedTemperatureSensor\src\Program.cs:line 49

@and-rewsmith and-rewsmith added the bug Something isn't working. label Oct 28, 2021
@github-actions github-actions bot added the IoTSDK Tracks all IoT SDK issues across the board label Oct 28, 2021
@and-rewsmith
Copy link
Author

@timtay-microsoft FYA

@azabbasi azabbasi self-assigned this Nov 3, 2021
kodiakhq bot pushed a commit to Azure/iotedge that referenced this issue Nov 3, 2021
I thought we could mitigate this SDK issue in our tests, but it seems worse than previously thought:
Azure/azure-iot-sdk-csharp#2223

We thought ModuleClient would recover on subsequent reconnects, but it never recovers. I have tried fiddling with the delays, removing the explicit `OpenAsync`, allowing more reconnect attempts, etc. Nothing seems to stabilize this flakiness. I didn't resort to changing the protocol as I believe our tests should use the default (and I believe most stable) Amqp_Tcp_Only. 

I feel like the loose thread here for further investigation is the fact that our Longhaul Tests don't suffer from this issue. So it seems like something specific to the TempSensor module might be at play.

For this PR, I have disabled the TempSensor test on windows with a comment to re-enable when the SDK issue is fixed. For the windows 10 minimal suite, I switched to using EdgeAgent ping test. 

Waiting on this test run before merge:
https://dev.azure.com/msazure/One/_build/results?buildId=48491714&view=results

5 E2E runs completed successfully


## Azure IoT Edge PR checklist:

This checklist is used to make sure that common guidelines for a pull request are followed.

### General Guidelines and Best Practices
- [x] I have read the [contribution guidelines](https://github.com/azure/iotedge#contributing).
- [x] Title of the pull request is clear and informative.
- [x] Description of the pull request includes a concise summary of the enhancement or bug fix.

### Testing Guidelines
- [x] Pull request includes test coverage for the included changes.
- Description of the pull request includes 
	- [x] concise summary of tests added/modified
	- [x] local testing done.  

### Draft PRs
- Open the PR in `Draft` mode if it is:
	- Work in progress or not intended to be merged.
	- Encountering multiple pipeline failures and working on fixes.

_Note: We use the kodiakhq bot to merge PRs once the necessary checks and approvals are in place. When it merges a PR, kodiakhq converts the PR title to the commit title, PR description to the commit description, and squashes all the commits in the PR to a single commit. The net effect is that entire PR becomes a single commit. Please follow the best practices mentioned [here](https://chris.beams.io/posts/git-commit/#:~:text=The%20seven%20rules%20of%20a%20great%20Git%20commit,what%20and%20why%20vs.%20how%20For%20example%3A%20) for the PR title and description_
@azabbasi
Copy link
Contributor

azabbasi commented Nov 5, 2021

It appears you are using an older LTS version of the device client. We have since published another LTS version you may be interested to use.
https://github.com/Azure/azure-iot-sdk-csharp/releases/tag/lts_2021-3-18-patch3

Having said that, it is a bit difficult to investigate this issue with no SDK logs. It would be great if you could share the SDK logs when the connection issue happens.
You can use the following instructions to capture the SDK logs.
https://github.com/Azure/azure-iot-sdk-csharp/tree/main/tools/CaptureLogs

@azabbasi
Copy link
Contributor

Based on the etl logs you provided, it looks like the connection doesn't open because the remote server is actively refusing it.
No connection could be made because the target machine actively refused it.

We can sync offline to reach out to the service team and try to figure out the issue from their side.

@azabbasi
Copy link
Contributor

@and-rewsmith
Based on our offline conversation, this appears to be an issue on the edge hub side. Closing the issue. let me know if there is anything we can assist with in the future.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. IoTSDK Tracks all IoT SDK issues across the board
Projects
None yet
Development

No branches or pull requests

2 participants