Cannot delete Built-in profiles with zero rules


(Adam Gabryś) #1

Yesterday I upgraded SonarQube from 7.1 to 7.3. I had to uninstall some plugins because they are incompatible. One of the uninstalled plugins has introduced 4 built-in quality profiles. Right now all have 0 rules. Unfortunately, I couldn’t remove them because they are built-in profiles.

How could I remove them without executing SQL commands? If it is impossible, could you clean them automatically (by database cleaner)?

(Nicolas Bontoux) #2

Hey Adam,

I feel like this relates to behaviour described in SONAR-10363, however not entirely sure at this stage whether that explain what you’re observing (especially as ticket was fixed in 7.2). I let you go through it already though, see if it prompts some thoughts.

(Adam Gabryś) #3

I don’t see any commits or comments (except an one that it has been tested and works correctly), but I found this:

I see it checks a default quality profile. My empty quality profiles are not default. I think the error path is different:

  • SONAR-10363:
    • stop the server
    • uninstall a plugin which defines a built-in quality profile which is also a default quality profile
    • install a new plugin which defines a built-in quality profile
    • start the server
      SonarQube chooses a new default quality profile because the old one has zero rules. It also deletes the old one.
  • my case:
    • stop the server
    • uninstall a plugin which defines a built-in quality profile which is not a default quality profile
    • start the server
      All default quality profiles have not been changed. The selectDefaultBuiltInProfilesWithoutActiveRules doesn’t return any of my empty quality profiles because they are not default. Finally, none of them have been removed.

(G Ann Campbell) #7


Thanks for finding and reporting this Adam. I’ve created

SONAR-11256 - Built-in profiles from deleted plugins are zombies


(Adam Gabryś) #8

Hi Ann,
Thank you for the ticket. I have an one solution proposal. If you afraid of removing profiles (inheritance problems etc.), then maybe you could only remove built-in flag from those profiles? System administrators would be able to remove them by themselves :slight_smile:

(G Ann Campbell) #9

I agree that that’s a potential solution Adam. :slight_smile:

Feel free to add it in a comment on the ticket.