Can not decommission a device. says 404

when setting a device to decommission in the UI i get

There was a problem decommissioning the device: cannot DELETE /api/management/v1/devauth/devices/5c8671a730665000010a0fee (404)…

looking at the logs i can see it hit the container devauth. it also is saying 404

time=“2019-03-21T20:13:22Z” level=info msg=“404 315μs DELETE /api/management/v1/devauth/devices/5c8671a730665000010a0fee HTTP/1.0 - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36” file=middleware.go func=“accesslog.(*AccessLogMiddleware).MiddlewareFunc.func1” line=60 request_id=3a203c41-aec8-48cf-9ffa-3bcba3761111 user_id=60a44ce7-d637-451c-93a9-21c02b91ffff

how can i debug this issue?

Hi @bbbh the first step is to enumerate the devices and make sure you are using the right ID.
The following worked for me.

$ curl -H “Authorization: Bearer $JWT” $MENDER_SERVER_URI/api/management/v2/devauth/devices | jq

followed by:

curl -H “Authorization: Bearer $JWT” -X DELETE $MENDER_SERVER_URI/api/management/v2/devauth/devices/5c951e92d75c9c000167440d

Specifically I was testing on Hosted Mender.