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

Direct method invocation fails with device Not found but works from Azure portal #1

Open
srinikrish22 opened this issue Feb 26, 2022 · 7 comments

Comments

@srinikrish22
Copy link

srinikrish22 commented Feb 26, 2022

I have been trying to get the code sample for Direct Method invocation from the samples. I am trying to use this sample for my backend code.

My IOT device is an x64 Virtual Machine on Azure connected to IoT hub using the symmetric keys method in the official documentation. The main.py in the IoT edge module is this code sample from the the repository. The IoT device is running azure-iot-device version 2.9.0 and azure-core 1.20.1. The logs from edgeAgent and edgeHub do not report any connection errors on the IoT device.

I have already seen an older version of the sample working but now I have been trying to get the direct method call sample working, but always get an error:
msrest.exceptions.HttpOperationError: Operation returned an invalid status code 'Not Found'

But, when I try to trigger the direct method from the Azure Portal, it works completely fine and I get the response from the registered method shown on the response section on the portal. It also works from VS Code.

I am using the "iothubowner" Connection string for the direct method invocation (backend code) and the calling machine is a local laptop with a conda environment with azure-iot-hub version 2.6.0 installed. Any module related calls with the IoTHubRegistryManager object (created with iothubowner connection string inside the sample) returns the same error.

On the IoT device side, all connections are okay and the device connection is not showing any errors.

I hope I have provided all the required information and it is completely surprising for me that the code sample that was working until recently does not work anymore. I really appreciate the support.

@anthonyvercolano
Copy link

@srinikrish22

I assume that when you are testing this edge module is up and running?

@srinikrish22
Copy link
Author

srinikrish22 commented Feb 28, 2022

@anthonyvercolano ofcourse, the edge module is running. It even works when i try to test a direct method call from the portal. I have slightly modified the method response such that i get some custom text in the payload and this is received properly and displayed on the Azure portal and also VS Code.

@cartertinney
Copy link
Member

@srinikrish22 Right now we are working internally to get this issue addressed, we will update when there is more information

@srinikrish22
Copy link
Author

srinikrish22 commented Mar 8, 2022

@cartertinney Thanks a lot for your response. Can I treat this as a known issue now? I mean then it would be possible to get a fix for this at some point of time.

@cartertinney
Copy link
Member

@srinikrish22

I can't tell you when this will be addressed, but we will be looking into it. Please leave this GitHub issue open and we will update when we have something to report.

@cartertinney cartertinney transferred this issue from Azure/azure-iot-sdk-python Jul 28, 2022
@cartertinney cartertinney removed their assignment Jul 28, 2022
@kmfriedt
Copy link

Is this issue currently being worked on? Is there a time line for when it will be resolved?

@anthonyvercolano
Copy link

anthonyvercolano commented Jan 11, 2023

@kmfriedt Sorry, responded to the wrong bug. Let me get back to you on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants