Azure / iotedgehubdev

IoT Edge Hub Dev Tool
Other
87 stars 30 forks source link

ACKs lost in Simulator #233

Closed pkoronawa closed 4 years ago

pkoronawa commented 4 years ago

I've implemented the basic messaging tutorial described in https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-windows

When I run it in the simulator, IotEdgeModule1 receives the first temperature message and posts it to the hub, but subsequently times out as below. Thereafter, it keeps receiving the same message repeatedly.

The same modules work properly when deployed to a VM running IoT Edge.

This seems to be related to https://github.com/Azure/iotedgehubdev/issues/106

edgeHubDev                    | <4> 2019-11-02 15:31:42.729 -07:00 [WRN] - Did not receive ack for message 601203c8-3d67-4c29-a61b-95753fc9adee from device/module DsgEdgeDevice/IotEdgeModule1
edgeHubDev                    | <4> 2019-11-02 15:31:42.729 -07:00 [WRN] - Error sending messages to module DsgEdgeDevice/IotEdgeModule1
edgeHubDev                    | System.TimeoutException: Message completion response not received
edgeHubDev                    |    at Microsoft.Azure.Devices.Edge.Hub.Core.Device.DeviceMessageHandler.SendMessageAsync(IMessage message, String input) in C:\agent\_work\4\s\edge-hub\src\Microsoft.Azure.Devices.Edge.Hub.Core\device\DeviceMessageHandler.cs:line 416
edgeHubDev                    |    at Microsoft.Azure.Devices.Edge.Hub.Core.Routing.ModuleEndpoint.ModuleMessageProcessor.ProcessAsync(ICollection`1 routingMessages, IDeviceProxy dp, CancellationToken token) in C:\agent\_work\4\s\edge-hub\src\Microsoft.Azure.Devices.Edge.Hub.Core\routing\ModuleEndpoint.cs:line 165
adashen commented 4 years ago

@pkoronawa Thanks for reporting this. Can you share more information about the csharp SDK version and protocol used (mqtt or amqp)?

pkoronawa commented 4 years ago

Here is the test project. I'm not sure where to find the SDK version number

VanillaTest.zip

Also, a screen shot of loaded modules

image

SLdragon commented 4 years ago

Hi, @pkoronawa , you can use "dotnet list package" command to check your C# SDK version under your module project.

Another suggestion is that you can try to use MQTT protocol to see whether the issue still exists, because we previously found that AMQP protocol is not very stable.

pkoronawa commented 4 years ago
c:\Repos\Dev\Sandbox\VanillaTest>dotnet list VanillaTest.sln package
The project `c:\Repos\Dev\Sandbox\VanillaTest\VanillaTest\VanillaTest.iotedgeproj` uses package.config for NuGet packages, while the command works only with package reference projects.

Project 'IotEdgeModule1' has the following package references
   [netcoreapp2.1]:
   Top-level Package                                                 Requested   Resolved
   > Microsoft.Azure.Devices.Client                                  1.*         1.21.1
   > Microsoft.Extensions.Configuration                              2.1.1       2.1.1
   > Microsoft.Extensions.Configuration.Abstractions                 2.1.1       2.1.1
   > Microsoft.Extensions.Configuration.Binder                       2.1.1       2.1.1
   > Microsoft.Extensions.Configuration.EnvironmentVariables         2.1.1       2.1.1
   > Microsoft.Extensions.Configuration.FileExtensions               2.1.1       2.1.1
   > Microsoft.Extensions.Configuration.Json                         2.0.0       2.0.0
   > Microsoft.NETCore.App                                     (A)   [2.1.0, )   2.1.0
   > System.Runtime.Loader                                           4.3.0       4.3.0

(A) : Auto-referenced package.

c:\Repos\Dev\Sandbox\VanillaTest>
pkoronawa commented 4 years ago

Looks like this is a recently introduced problem in Microsoft.Azure.Devices.Client

See thread in https://github.com/Azure/iotedge/issues/1715

SLdragon commented 4 years ago

Thank you for your feedback, seems like it is a SDK issue, and we will keep this issue open until SDK team solve the problem.

SLdragon commented 4 years ago

C# SDK version 1.21.2 fixed this problem, and close this issue.