-
Notifications
You must be signed in to change notification settings - Fork 493
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] InvokeDeviceMethodAsync fails with error code 400000 #3472
Comments
Can you share a bit more about the direct method payload you are sending? |
The payload is a json with protobuf base64 string, for example { The code below is used to set the payload: var payloadJson = JsonConvert.SerializeObject(payload, jsonSerializerSettings); |
Hello @williamiwell I was able to reproduce the issue and obtain the same error code. Your call is missing a parameter, since I believe you are trying to invoke an edge custom module direct method, please add both the deviceId and the moduleId as parameters, this will enable the private function:
to create the appropriate URL for the request to the API and call the method invocation for IoT edge module as mentioned in: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-direct-methods#method-invocation-for-iot-edge-modules Following the function expected parameters to invoke an edge custom module direct method, your call to the function should be similar to: (invoking the $edgeAgent ping method for reference, you can replace it with your custom module identity).
Executing this reference code I obtain from the CLI application:
Hope the information is helpful, kind regards! |
I can confirm that using two parameters works.
|
Context
Description of the issue
We use IotHub to send messages from our cloud to edge devices, using the InvokeDeviceMethodAsync method. This worked fine until 25-September-2024 19:00 UTC, but now we receive error code 400000. We can't find any information about this code, it's not listed in the common error codes docs.
We are using the latests nuget package: microsoft.azure.devices/1.39.1. The devices are online and are able to send device to cloud messages.
Any idea what is going on and if we can resolve this or that is related to an IotEdge issue?
Our IotHub is located in West Europa.
Code sample exhibiting the issue
this throws the exception below:
The text was updated successfully, but these errors were encountered: