Giter VIP home page Giter VIP logo

Comments (12)

alancshi avatar alancshi commented on June 28, 2024

Hi @sheshadri99, this message indicates that ADU thinks that the group you are trying to delete still does have devices associated with it. Are you seeing no devices in that group when you view it in the portal? If you use the ADU CLI to list the devices does it appear empty?

"az iot du device list -n -i --filter "groupId eq ''"

@josephmsft to comment if there are other things you can check as well.

from iot-hub-device-update.

sheshadri99 avatar sheshadri99 commented on June 28, 2024

Hi @alancshi, i could see there are no devices in the group when viewed through portal.
Checked through cli as well, i am getting empty list as response.

from iot-hub-device-update.

alancshi avatar alancshi commented on June 28, 2024

@sheshadri99 that is strange, can you share your account/instance and group name? @josephmsft @Olee2021 can you please help with this investigation?

from iot-hub-device-update.

josephmsft avatar josephmsft commented on June 28, 2024

I'll take a look, please do tell us the account and instance. I'll see if I can find it from the group name alone but that will take longer.

from iot-hub-device-update.

josephmsft avatar josephmsft commented on June 28, 2024

Ok I have determined the issue. You have 1 unhealthy device that is still tagged as part of this group. Because it is unhealthy it is not listed in the device queries you're running. The deviceId is "4e63870a34774967b9ffb73505271931" and moduleId is "FirmwareModule". If you delete this device from your hub you should be able to delete the group. You can see what unhealthy devices you have by querying for unhealthy devices, although for now that API is not returning group information. I will follow up on how we can improve this scenario.

from iot-hub-device-update.

sheshadri99 avatar sheshadri99 commented on June 28, 2024

Is this the expected behaviour, having unhealthy devices being tagged to a group stops us from deleting them.
Is untagging the device from group not sufficient to delete group?
Can you share if there is documentation about health of devices?

from iot-hub-device-update.

sheshadri99 avatar sheshadri99 commented on June 28, 2024

For one particular device group, when viewed from portal it has no deployments, but when tried with api it says group has 1 active deployment, when tried to delete the deployment via api, it is returning 204 and deployment is not getting deleted.

DeviceId: ACCE000000000000A20000000F23D602

from iot-hub-device-update.

saumya318 avatar saumya318 commented on June 28, 2024

We have noticed this issue with another device group as well where in we are unable to delete a group as the error messages says that there are active deployments in the group, even though via the portal the deployment is not visible.
DELETE https://aduEndpoint/deviceUpdate/aduInstance/management/groups/groupId?api-version=2022-10-01

image

On calling the get deployments by group Id API we get an empty list:
GET https://aduEndpoint/deviceUpdate/aduInstance/management/groups/groupId/deployments?api-version=2022-10-01

image

However on calling the GET group details API, we get the deployment Id in the response:
GET https://aduEndpoint/deviceUpdate/aduInstance/management/groups/groupId?api-version=2022-10-01

image
When we try to delete this deployment using API:
DELETE https://aduEndpoint/deviceUpdate/aduInstance/management/groups/groupId/deployments/ce681527-3101-47d6-853c-b9c1737fb5fa/?api-version=2022-10-01
We get 204 No Content but post that when we try to delete the group again we still get 400 BadREquest with error as:

{
    "error": {
        "code": "GroupWithActiveDeploymentCannotBeDeleted",
        "message": "Cannot delete Group with an Active deployment. Please delete or cancel the deployment before deleting the group."
    }
}

from iot-hub-device-update.

josephmsft avatar josephmsft commented on June 28, 2024

Is this the expected behaviour, having unhealthy devices being tagged to a group stops us from deleting them. Is untagging the device from group not sufficient to delete group? Can you share if there is documentation about health of devices?

This is currently the expected behavior, I am following up with the team if we want to make any changes here since it seems that it's hard to diagnose what is causing the failure with the current behavior.

Untagging the unhealthy device should also work to be able to delete the group.

from iot-hub-device-update.

josephmsft avatar josephmsft commented on June 28, 2024

Is this the expected behaviour, having unhealthy devices being tagged to a group stops us from deleting them. Is untagging the device from group not sufficient to delete group? Can you share if there is documentation about health of devices?

Untagging the unhealthy device should also work to be able to delete the group.

https://learn.microsoft.com/en-us/azure/iot-hub-device-update/device-update-agent-check?tabs=portal is the documentation for agent check

from iot-hub-device-update.

josephmsft avatar josephmsft commented on June 28, 2024

We have noticed this issue with another device group as well where in we are unable to delete a group as the error messages says that there are active deployments in the group, even though via the portal the deployment is not visible. DELETE https://aduEndpoint/deviceUpdate/aduInstance/management/groups/groupId?api-version=2022-10-01

image

On calling the get deployments by group Id API we get an empty list: GET https://aduEndpoint/deviceUpdate/aduInstance/management/groups/groupId/deployments?api-version=2022-10-01

image

However on calling the GET group details API, we get the deployment Id in the response: GET https://aduEndpoint/deviceUpdate/aduInstance/management/groups/groupId?api-version=2022-10-01

image When we try to delete this deployment using API: DELETE https://aduEndpoint/deviceUpdate/aduInstance/management/groups/groupId/deployments/ce681527-3101-47d6-853c-b9c1737fb5fa/?api-version=2022-10-01 We get 204 No Content but post that when we try to delete the group again we still get 400 BadREquest with error as:

{
    "error": {
        "code": "GroupWithActiveDeploymentCannotBeDeleted",
        "message": "Cannot delete Group with an Active deployment. Please delete or cancel the deployment before deleting the group."
    }
}

I have investigated and this is due to a bug in the service. Your group currently has no subgroups, but it does have a deployment. In this scenario with no subgroups we are not correctly updating the group record to remove the active deployment when DELETE deployment is called. I will work on a fix and it should be deployed by late next week, after which you should be able to fully delete the deployment by calling DELETE deployment.

from iot-hub-device-update.

josephmsft avatar josephmsft commented on June 28, 2024

This was deployed the following week from my last comment. Closing this issue.

from iot-hub-device-update.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.