-
Notifications
You must be signed in to change notification settings - Fork 42
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
ADU deviceupdate-agnet 1.0.2 is unable to connect to the IoT Hub, Connection Not Accepted: 0x5: Not Authorized #660
Comments
I'm still having this issue. It this repo abandoned? Should I look for answers elsewhere? |
Seems like the version of azure-iot-sdk-c is 1.9 from the hash in the logs providerd, 7329f70906, which is not an LTS release. The version of azure-iot-sdk for c supported by iot-hub-device-update ver 1.0.2 was the older LTS_07_2021_Ref01 as can be seen here: https://github.com/Azure/iot-hub-device-update/blob/2d1f03671d45be1e55b89c940514ffe91b3227e0/scripts/install-deps.sh#L46C15-L46C32 Was the DU agent installed from 1.2 debian package, or built from sources? Anyways, this is error 0x5 Not Authorized coming back from iot-hub MQTT server in the CONACK MQTT packet, so whatever cred received from AIS and sent to the MQTT server is not considered authorized by iothub MQTT server Is this use of AIS based on symmetric keys or x509.certs? If the former, something may be going on with the token generation in AIS, or a bug in the version of the iothub sdk. This is troubleshooting issue with AIS and iot-hub-sdk-for-c, so you could get faster support opening an issue at https://github.com/Azure/azure-iot-sdk-c/issues and/or https://github.com/Azure/iot-identity-service |
Hi, Thanks for your answer!
We build from source. As we build our own Linux based OS with the help of Yocto, we use recepices from https://github.com/GaiaSystem/meta-azure-device-update (which is a fork of https://github.com/Azure/meta-azure-device-update). We have OS:s based on Dunfell and Kirkstone at the moment, both seems to be running 1.0.2 of ADU.
We use symmetric keys. The problem is that we do not know which version of ADU (in our case which commit) that should be used. I find it hard to find any info about LTS versions etc. And what is bit worrying is that I can't get our device to work. The one which got the "error 0x5 Not Authorized" error. If I could clear some cache, restart something etc. etc. to get DU on device to work again I would feel a bit better, as we have a bunch of devices in production running the same version of DU. |
Hi, I would love some answers to my questions. Is development around ADU ongoing? It seems a bit dead to be honest. |
Hi @FinitelyFailed , the latest ADU Yocto recipes and meta layers are based on the Scarthgap release of Yocto as it is current LTS version. The main branch will be snapped to the Scarthgap version by end of the week as well. Our recommendation would be to use these layers and recipes. Any bug fixes and changes will be incorporated here. Additionally, these recipes have been tested with AIS and use the 1.1.0 commits of the ADU agent. Separately, it looks like your ADU AIS config.toml file is missing idtype = ["module"] that is required to allow auth of ADU as module for the Edge device. Documentation here This may be causing the connection not authorized error. |
Hi @eshashah-msft , Thanks for your answer. We will try to move our version of ADU to the same version as the one that Scarthgap points. I guess that the meta iot hub device update delta will be fixed as well? As it doesn't seem to have a finished Scarthgap branch (I guess that user/nox-msft/scarthgap is somekind of work branch)? The AIS config file for ADU actually looke like this:
The last line doesn't end with a newline, which made me miss that line when I copied it the first time ... Sorry. We flashed our faulty device, and now it works. Both its deviceupdate-agent and our software connects to the IoT Hub without any problems. Which makes me think that the error is in the deviceupdate-agent. And that something is cached, or similar on the device's disk. As a restart of the device, deviceupdate-agent, or AIS services doesn't do anything. We got the same problem on an other device in our test environment as well ... Which is a bit concerning. As far as we know the problem hasn't happened in production, yet. BTW: When I was looking around I saw that you seem to have a typo here: https://github.com/Azure/iot-hub-device-update-yocto/blob/568515f2f160189398907bdb5d69080c0ee1d4f6/azurepipelines/build-template.yml#L36 |
Expected Behavior
deviceupdate-agent should connect to the IoT hub, using the azure identity service to get a connection string.
Current Behavior
This happened on one of our test devices. We have multiple devices running, the other ones work fine. But this one stopped working about a week ago.
deviceupdate-agent can not connect to the IoT hub as it gets a "Connection Not Accepted" error.
Device Information
Logs
Additional Information
I have rebooted the computer, restarted the deviceupdate-agent, with no change in behavior.
The deviceupdate-agent is setup as a "Module Identity" on the device in the IoT hub.
We have a parallel connection to the device in the IoT hub for our software, which is able to connect to the IoT hub without an problems.
The text was updated successfully, but these errors were encountered: