问题
I have a rule in my SonarQube that has no Quality Profile associated with it in the search list (The red box here). When I try to change it I get this error, and when i try to click the Deactivate button, nothing happens.
I tried adding a Quality Profile with that name and then changing it, but I think that name might refer to the ID instead of the readable name so that didn't work.
How would I go about removing a rule that has a missing Quality Profile?
回答1:
The best way to fix these kinds of issues is to stop your instance, clear $SQ_HOME/data/es and restart your instance. This will ensure that the ElasticSearch index of rules is in sync with the database state.
回答2:
I think I may have figured it out.
I just had to manually insert a new row into the rules_profiles database table with a key that matched the one in the error. Then go back into the online interface and delete that profile.
来源:https://stackoverflow.com/questions/28199435/sonarqube-cannot-deactivate-rule-with-missing-quality-profile