Error importing rules file in checkstyle

I need to use a checkstyle rules file customizing but when importing it and clicking “create”
it shows me the following error.
“An error has occurred. Contact your administrator.”

I am using sonarQube v 7.9.5.38598, Community

Hi,

Welcome to the community!

SonarQube 7.9.5 is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience.

Regarding your question, it’s not clear to me how you’re attempting to import a Checkstyle rules file; I don’t believe even 7.9 supported that.

 
Ann

thanks, I will try to update it soon.

I am trying to import an xml file to checkstyle

Hi,

Thanks for the screenshot; it helps!

I remember this now. I haven’t seen it in ages because it apparently only shows up when you’re using a plugin that provides a custom exporter(?).

So I guess you’re trying to import a file generated by Checkstyle. I just did that myself. I installed Checkstyle, created a profile with Checkstyle rules, used the custom exporter & then tried to import that file into a new template. I got an error that looked a lot like yours. So I checked my server logs, specifically web.log. I saw this error:

Fail to process request http://localhost:9000/api/qualityprofiles/create org.sonar.api.utils.MessageException: The definition of the profile 'null' (language 'null') contains multiple occurrences of the 'checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.AvoidDoubleBraceInitializationChecktemplate' rule. The plugin which declares this profile should fix this.

So… I’m thinking you need to take this up with the Checkstyle maintainers.

 
:woman_shrugging:
Ann