Language of file can not be decided

Starting Jan 31 we are getting following error when running scan with maven’s sonar:sonar goal (actual file and project names replaced with XXX):

[INFO] **--- sonar-maven-plugin:3.6.0.1398:sonar (default-cli) @ XXX ---** 
[INFO] User cache: XXX
[INFO] SonarQube version: 7.7.0

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project XXX: Language of file 'XXX/src/main/webapp/WEB-INF/jsp/XXX.jsp' can not be decided as the file matches patterns of both sonar.lang.patterns.web : **/*.html,**/*.xhtml,**/*.jspf,**/*.jspx,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml,**/*.jsp and sonar.lang.patterns.jsp : **/*.jsp,**/*.jspf,**/*.jspx -> [Help 1]

I’ve noticed that sonar version in maven logs changed from 7.6.0 on Jan 30 to 7.7.0 on Jan 31.
Is it something we should change in our config or it can be fixed on your side?

Thanks

1 Like

Exact same problem here, on JSP files, and at the same time as you.
All our builds are stuck!

The last working build was exhibiting the following logs:

[INFO] --- sonar-maven-plugin:3.6.0.1398:sonar (default-cli) @ our-project-name ---
...
[INFO] User cache: /home/jenkins/.sonar/cache
[INFO] SonarQube version: 7.6.0

and the first (and following) broken builds exhibit the following logs

[INFO] --- sonar-maven-plugin:3.6.0.1398:sonar (default-cli) @ our-project-name ---
...
[INFO] User cache: /home/jenkins/.sonar/cache
[INFO] SonarQube version: 7.7.0
...
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project our-project-name: Language of file 'a-module/src/main/webapp/WEB-INF/jsp/ourjsp.jsp' can not be decided as the file matches patterns of both sonar.lang.patterns.web : **/*.html,**/*.xhtml,**/*.jspf,**/*.jspx,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml,**/*.jsp and sonar.lang.patterns.jsp : **/*.jsp,**/*.jspf,**/*.jspx -> [Help 1]

There were some leftovers on the configuration of our HTML analyzer, which was not compatible with the recent version we deployed last week.

This is fixed by now, your builds should be back to green.

Sorry for the inconvenience, and thanks for the heads up!

1 Like

I don’t now why this stopped working. I also don’t know if the following is the right solution to the problem. But at least it’s a work-around:

Go to Administration > General Settings > HTML, and remove the “.jsp” entry for the “HTML file suffixes” list.

Looks like original issue resolved now, but we are getting new error, not sure it is related with previous one, but here it is:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project XXX: Line 361 is out of range in the file XXX.java (lines: 360) -> [Help 1]
The file in question has 360 lines.

Sorry, let me check some configs, it may be on our side

Ok, confirmed that issue is resolved. Thanks for quick turnaround

1 Like