Due to infrastructure issues, I needed to transfer a set of 405 devices from one application to another. I used API to remove the devices from the original application called iptec-aws-integration to be able to reregister them in the new one. I called the following API endpoint:
All devices have been deleted from the application, so then I deleted the application as well. But now I am not able to register a single device due to the following error:
but now I don’t have access to the application anymore. Now I know I should not go this way, but it happened and now I really need some help from you guys because the IoT devices are already installed in the terrain and I need to connect them into the cloud again with the same combination of DevEUI and JoinEUI. I have also a list of all devices with their original identifiers.
and comment again after you’ve done the id server delete too.
Or try the CLI which does it all for you - it may be able to clear out the bits that are left.
If those don’t work, then you will have to remap your identifiers over.
As you are creating a new OTAA session your devices will be offline until they do a link check. So you may want to look at when that will happen and plan accordingly - you may have a few days to get things in order.
@descartes Thank you for your reply! I was following this API reference and unfortunately deleted the devices only from the EndDeviceRegistry. After that, I deleted the application from the console (because no devices were there left), but I didn’t think through and forgot to delete them from the NsEndDeviceRegistry, AsEndDeviceRegistry and JsEndDeviceRegistry as well. So now, I would really love to finish the job, but I lost permission to the application because I deleted it (from the perspective of the system, hid it).
Forum moderators are not admin staff, just volunteers with (very) few additional privileges on the forum. The forum is meant for users to help users by answering questions and discussing TTN and LoRaWAN related concepts. It is not a support channel for TTI. If you need attention from TTI you can try Slack.
Okay, so let me repeat the problem as I understand it:
You had 405 end devices registered in application iptec-aws-integration
You deleted these 405 end devices from the EndDeviceRegistry (Identity Server / IS), but not from the NsEndDeviceRegistry (Network Server / NS), AsEndDeviceRegistry (Application Server / AS) or JsEndDeviceRegistry (Join Server / JS)
You then deleted your application iptec-aws-integration
You are now unable to register your end devices in the new application, because the NS, AS and JS refuse to do so, because the end devices still exist.
You are now unable to delete those end devices from the NS, AS and JS, because you no longer have rights on your deleted application.
You are now unable to restore your deleted application, because the restore window has expired.
Yes, that’s absolutely correct! And I would like to apologize for my stupid mistake because I should make a double check before a deleted the application and lost the permissions.
Okay. I just restored your deleted application.
This should make the NS, AS and JS APIs accept your Delete API calls again.
In a future version of The Things Stack we may consider extending the “restore window” to 7 days (up from 24 hours). We are also working on something that permanently deletes deleted applications (and their end devices) after the “restore window” expires. Hopefully that will be helpful if someone else in the future makes the same mistake.
Thank you so much! I agree extending the restore window would help because I finally found the restore command, but it was too late. Once again, thank you and have a nice day!