CSS rules were not executed- during sonar-scanner

Hi Experts,

I am trying to SonarQube analysis on linux based C project. During sonar-scanner i got below issue:

ERROR: CSS rules were not executed. Only Node.js v10 or later is supported, got 8.
org.sonarsource.nodejs.NodeCommandException: Only Node.js v10 or later is supported, got 8.

Please help to resolve it.

SQ Installed Version:
Developer Edition
Version 9.0.1 (build 46107)

Thanks,
Gopinath

Hi Gopinath,

What does that error mean to you?

 
Ann

Hi Ann,

I have updated the latest build wrapper, then the issue got disappear.

When i tried to run sonar-scanner, showing analysis was successful but i am unable to see SonarQube report in the server. Later i went trough the logs and observed “Zero files indexed”

Log Snippet:

INFO: Project configuration:
INFO:   Included sources: RB_1.5/sys/appl/cli/**, RB_1.5/sys/appl/cei-test/**
INFO: 0 files indexed
INFO: 17268 files ignored because of inclusion/exclusion patterns
INFO: ------------- Run sensors on module EXMUX_4500_PHASE_1.5

sonar-project.properties:

sonar.projectKey=EXMUX_4500_PHASE_1.5
sonar.projectName=EXMUX_4500_PHASE_1.5
#sonar.sources=RB_1.5/sys/
sonar.inclusions=RB_1.5/sys/appl/cli/**,RB_1.5/sys/appl/cei-test/**
sonar.scm.disabled=true
sonar.language=c, cpp
sonar.sourceEncoding=UTF-8
#sonar.cfamily.build-wrapper-output=RB_1.5/sys/sonar-output/
sonar.cfamily.build-wrapper-output=sonar-output/
sonar.cfamily.cache.enabled=false

sonar-scanner.properties:

sonar.host.url=************
sonar.login=********
sonar.password=********
sonar.projectKey=EXMUX_4500_PHASE_1.5
#----- Default source code encoding
sonar.sourceEncoding=UTF-8

Thanks,
Gopinath

Hi Gopinath,

Please open a new thread for this new question.

 
Ann

Same Error
ERROR: CSS rules were not executed. Only Node.js v10 or later is supported, got 8.
2 org.sonarsource.nodejs.NodeCommandException: Only Node.js v10 or later is supported, got 8.

How do we get rid of this error

Hi @Rambo,

Welcome to the community!

I’ll ask you the same question I asked the OP. What does that error message mean to you?

 
Ann

Hi Ann

we dont have any node js files in the repo yet. I tried exclusions of the js files but we don’t have any. But why is it necessary that it throws an exception and is failing in the quality gate

Hi,

The scanner uses Node.js to run the CSS rules. You’ll need to upgrade the version installed on your build agent.

 
HTH,
Ann

Hi

Can we remediate it during the run time?

Hi,

I don’t understand the question.

You need to upgrade the version of Node.js installed on the build agent.

Either that or exclude .css files - and .js/.ts files from the analysis.

 
Ann

Hi

we dont have .css .js/.ts files also in the repo. So is the only option to do it install Node.js version on the agent? No other way

Im sorry ill try to reframe the previous question.
Can I pass any arguments in the jenkins pipeline that can fix the version of nodejs while scanning without installing it on the agent coz I don’t have permissions to install anything on agents.

Hi,

Can you share your analysis log?

 
Ann

errorcss.txt (9.6 KB)
Hi Ann
attached log

Hi,

Please provide the entire log, starting from the analysis command.

 
Ann

Hi,

Your analysis is erroring out at the analysis of JavaScript, not CSS. Yes, there’s an error when the CSS sensor is run, but analysis continues past it to attempt JavaScript analysis.

I think you should re-examine this. Your analysis command line implies that you do:

'-Dsonar.javascript.lcov.reportPaths=coverage/apps/**/lcov.info'

There’s no need to pass in a JavaScript coverage report if you don’t have JavaScript files.

So, we’re back to needing to upgrade the Node.js version on your build agent.

 
:woman_shrugging:
Ann

1 Like

Thank you very much ann

Same error here.
Not supplying -Dsonar.javascript.lcov.reportPaths=coverage/apps/**/lcov.info

Also no css, .js, .ts files present in the repository.

Hi @Tmiple,

Please create a new thread and supply your versions and your full analysis log.

 
Ann