Im trying to delete an Amazon Account from Infrastructure - Accounts, but I get error:
“This account cannot be deleted as it is currently referenced by a variable. Please refer to account usage for more detail.”
Under “Usage”, as you can see in attached image, Octopus say that its not used. And I dont think it should be used anywhere. It was used in a project variable before, but previous releases is either deleted or variables updated in them.
What could be wrong or how do I troubleshoot this?
Hi Tobias, sorry to hear that you are running into issues.
This sounds like we are not showing all the usages in the UI. The document relationships that would be preventing the deletion should be stored in the RelatedDocuments table. You can get the account ID from the URL when on the account detail page. This account ID would look something like the following amazonwebservicesaccount-<name>. You can use this ID to query the database directly if you have access to do so.
Select * from RelatedDocument where RelatedDocumentId = 'account-id'
I would imagine that the usages being returned by the API would not be the same as the output of the SQL query. In order to confirm this, could I also get you to run the following script and provide the output, please?
Thanks for that. It still feels a bit strange that the usage didn’t show up and there may still be a bug lurking here. I will try and reproduce and raise an issue if I manage to do so. I will accept the issue being resolved for you as a win for now though
Please let us know if there is anything else we can help with!