There’s an issue if you create a label and delete it as you might not be able to reuse the same external_id ever again. Even if you first delete the asset or relationship that the label is conected to first and then delete the label, you end up with a ghost label. With some random exceptions(say in 1 of 15 cases it’s not an issue). It feels like a cache issue, but as we’ve seen over the last half a year or so, the issue seems to persists over several months.
For this example I’m using an empty dataset, I’ve created a label, tied it to an asset, deleted the asset and then deleted the label. The external id I’ve used for my label are now locked forever.
![](https://uploads-eu-west-1.insided.com/cognite-en/attachment/380bfa3e-0462-4a66-9784-2c1e4358f621.png)
I then try to create the label, if not found:
![](https://uploads-eu-west-1.insided.com/cognite-en/attachment/8342a62a-b83b-4c05-a7b8-54d8de03ee83.png)
Resulting in an error
![](https://uploads-eu-west-1.insided.com/cognite-en/attachment/c1ab795a-ac42-45d0-ad03-caa3b4e8b108.png)
This is a bug across the C# and the Python SDK.