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] UpdateTwins2Async throws error when updating module twins with the same device ID #3481

Open
dnguyen-0 opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working.

Comments

@dnguyen-0
Copy link

Context

  • OS, version, SKU and CPU architecture used: Windows 11 Desktop x64
  • Application's .NET Target Framework : .net 8.0
  • Device: laptop
  • SDK version used: Microsoft.Azure.Devices 1.40.0

Description of the issue

I have a list of modules in an IoT hub Edge device. All the modules belong to the same edge device and they will have the same device ID. Invoking UpdateTwins2Async method throws an exception specified in the section below.
Last year there was no such problem. What could be the reason and what should I do? Thank you.

Code sample exhibiting the issue

List<Twin> moduleTwins = new List<Twin>();
foreach (var moduleId in moduleIds)
{
  var moduleTwin = await registryManager.GetTwinAsync(queriedDevice.Id, moduleId);
  moduleTwins.Add(moduleTwin);
}
ConfigureModuleTwins(moduleTwins); // Adapt modules' twins
await registryManager.UpdateTwins2Async(moduleTwins, true);

Console log of the issue

'{"Message":"ErrorCode:DeviceDefinedMultipleTimes;DeviceDefinedMultipleTimes, device ID FITS4U_GW_DNGUYEN","ExceptionMessage":"Tracking ID:4D2CE505AD7945E4B55EF03952FA8549-G2:-TimeStamp:2025-01-08T19:28:00.672603626Z"}'

@dnguyen-0 dnguyen-0 added the bug Something isn't working. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

1 participant