I have the similar issue as https://issues.sonatype.org/browse/NEXUS-19437 but my problem is not about blobstore, but about Repository.
My scenario is:
- I created the NPM hosted repository through REST API Call
- but the blobStoreName was invalid (not exists)
- The Nexus didn´t validate the blobstore reference and created the repository. But the repository was not working
- I tried to DELETE the repository from GUI, but this failes
- Then I tried to DELETE repository from Groovy Task script like
- but all attempts failes on state, because the repozitory was in FAILED state and I didnt found any function, which could be used to DROP the repository
- also use o Repository manager was imposible, same errors
- as last chance I tried the code inspired by https://issues.sonatype.org/browse/NEXUS-19437
- but this code cases that the Repository instance cached in memory by RepositoryManager lost the reference to Configuration and the List of Repositories in UI was broken by nullpointerException - we lost capability to manage the Nexus repositories. It was already reported as https://issues.sonatype.org/browse/NEXUS-21048
- So we decided to restart Nexus to cleanup memory caches. But this was the last time when we saw the nexus responding. Some inconsistenci in database related to previous actions on repository, stops the nexus boot.
- So the result was - restore all data from backup
I see two bugs in this story:
- the repository Create command should validate all atributes corectly - IF the blobstore name is mandatory, the blobstore should exists or the Error should be thrown
- there is no capability to force DELETE (DROP) of Repository, which is in some inconsistent state, or in FAILED state. The API should be tolerant and make as much as possible to cleanup all objects related to repository and when something already was destroyed, skip it and continue to remove rest of the object. The Delete operation should be reentrant.
Thank you for improve of the functionality