provisioning: cannot delete thing if still attached to a principal
Aws Connected Device Framework Affected Module(s):
provisioning
I'm submitting a ...
- [x] bug report
- [ ] feature request
Description:
There are times (not very reproducible) where we call deleteThing from the provisioning service, which detaches that thing from it's principals (certs, policies, etc), and then deletes the thing from IOT core, and the service returns a 500 error and reports:
InvalidRequestException: Cannot delete. Thing <thingName> is still attached to one or more principals
Current behavior:
500 Error is thrown
Expected behavior:
Provisioning service catches this error and attempts to re-detach principals if the first attempt didn't work for some reason.
Steps to reproduce:
Use the provisioning service to fully provision a device, then delete it using the provisioning service. Do this over-and-over and you should eventually see some errors.
Additional Information:
I think this is a problem with the AWS javascript SDK where it returns from the detachThingPrincipal function prior to it fully detatching the thing principal.

Thanks for reporting this @aaronatbissell, looks like this is something that need to be fixed from the IoT Device Management itself rather than fixing it on CDF.
Probably true - but I wouldn't think you'd want the provisioning service returning a 500, right? How would we get this on the backlog of the IoT Device Management Team?
Hi @aaronatbissell, will raise it on your behalf.