thingsboard / thingsboard

Open-source IoT Platform - Device management, data collection, processing and visualization.
https://thingsboard.io
Apache License 2.0
17.2k stars 5.07k forks source link

[Feature Request] Auto generate device profile provisioning key with version control #9675

Open Maxwh21 opened 9 months ago

Maxwh21 commented 9 months ago

I have a live server and a development server that are both running thingsboard. The development server has multiple tenants, one for each developer and a common development tenant. When using version control to import devices from live, I need to also import device profiles from live. When I try and import device profiles to more than one tenant on the development server I get the following error: Device profile with such provision key already exists. I take this to mean I cannot have the same device profile on the same server twice, even on different tenants.

What I've noticed is that this same issue could be applied to integrations, when I try to import integrations to multiple tenants on my development server I get the following error:

Failed to load the integration with external id 14298810-3d9d-11ee-8fd0-ddde583f640d due to the same integration key is already present in the database for another integration. Please consider enabling the auto-generate integration key setting in the restore form.

So as you can see for integrations there is a solution offered, to auto generate the integration key. Why can't this same feature be enabled for device profiles? to auto generate the device profile provisioning key to allow imports?

dmohns commented 3 months ago

Hey @Maxwh21

did you manage to find some kind of workaround for this?

Maxwh21 commented 3 months ago

the work around I did was to do 1 of the following options

1) Go to the device profile on the other tenants and disable the provisioning before importing the new device profiles image

2) Manually make the device profiles and import the rest of the items

dmohns commented 3 months ago

the work around I did was to do 1 of the following options

  1. Go to the device profile on the other tenants and disable the provisioning before importing the new device profiles image
  2. Manually make the device profiles and import the rest of the items

Yikes ... I guess that's what I will end up doing too. Thanks for sharing!

Let's hope we get this as a feature soonish 😉 @ikulikov any chance you have a look at this request?