添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
SCANNER_HOME = tool 'RED SonarQube Scanner 4.0' BRANCH = 'master' JAVA_HOME = tool 'openjdk17' steps { withSonarQubeEnv(installationName: '****', credentialsId: '******') { sh ''' $SCANNER_HOME/bin/sonar-scanner \ -Dsonar.java.binaries=. -Dsonar.branch.name=$BRANCH \ -Dsonar.projectKey=raq -Dsonar.sources=. \ -Dsonar.organization=raq\ -Dsonar.exclusions=dist/,.sonar/,.scannerwork/,node_modules/,.git/,nginx/,src/*/.spec.ts,src/*/.spec.tsx \
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • 15:01:24 15:01:23.860 DEBUG: Skipping node deploy. Deployed node has latest version.
    15:01:24 15:01:23.861 DEBUG: Launching command /home/jenkins/.sonar/js/node-runtime/node -v
    15:01:24 15:01:23.864 ERROR: /home/jenkins/.sonar/js/node-runtime/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (**required by /home/jenkins/.sonar/js/node-runtime/node)
    15:01:24 15:01:23.866 WARN: Embedded Node.js failed to deploy. Will fallback to host Node.js.
    15:01:24 org.sonar.plugins.javascript.nodejs.NodeCommandException: Failed to determine the version of Node.js, exit value 1. Executed: '/home/jenkins/.sonar/js/node-runtime/node -v'
    15:01:25    at org.sonar.plugins.javascript.nodejs.NodeVersion.getVersion(NodeVersion.java:59)
    15:01:25    at org.sonar.plugins.javascript.bridge.EmbeddedNode.deploy(EmbeddedNode.java:192)
    15:01:25    at org.sonar.plugins.javascript.bridge.BridgeServerImpl.deploy(BridgeServerImpl.java:173)
    15:01:25    at org.sonar.plugins.javascript.bridge.BridgeServerImpl.startServerLazily(BridgeServerImpl.java:299)
    15:01:24 15:01:24.351 ERROR: Error during SonarQube Scanner execution
    15:01:24 java.lang.IllegalStateException: Error while running Node.js. A supported version of Node.js is required for running the analysis of JS/TS files. Please make sure a supported version of Node.js is available in the PATH**. Alternatively, you can exclude JS/TS files from your analysis using the 'sonar.exclusions' configuration property. See the docs for configuring the analysis environment: https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/languages/javascript-typescript-css/
    15:01:25    at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:91)
    

    Below are the output from jenkins VM

    node -v
    v10.24.1
    /home/jenkins/.sonar/js/node-runtime/node -v
    /home/jenkins/.sonar/js/node-runtime/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /home/jenkins/.sonar/js/node-runtime/node)
    
  • Steps to reproduce
  • we can rerun the script

  • Potential workaround
  • query 1 >> How to fix this error. i think i need to upgrade node.js version. ??

    query2 >> If we need to upgrade node.js . we do not need to upgrade on VM level. we need to control through jenkins plugin and Global Tool configuration. ? and use the specific version for this jenkin scanner only. Please help me with the complete process.

    Could you share your build agent architecture? It looks like you’re running Linux on an x86 machine?

    And yes, you’ll need to upgrade Node to a supported version. The current Node.js LTS version is 20.

    Unfortunately, I can’t help with the exact mechanics of doing that.

    Hi G Ann Campbell .
    Thanks for your Reply

    Linux 5.4.0-1109-azure #115~18.04.1-Ubuntu SMP Mon May 22 20:06:37 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

    I dont want to upgrade Node after manually login to server… how can i install specific upgraded node version from jenkins plugin or Global Tool configuration and use only for this specific pipeline.

    Kindly suggest the plugin name that shoud be downloaded to do this analysis.

    my application uses Below command to build

    RUN dotnet build “prod.REupdate.API.csproj” -c Release -o /app/build

    Hi @masroora,

    The analysis requires node 18 or 20 to run. It seems your host only has version 10, which is not supported. The scan embeds node 20 for most Linux distributions (the ones shipping with glibc), but it seems yours does not have glibc (probably using Alpine Linux?).

    The scanner will fallback finding a supported Node version in the host. Sorry but I have no experience with Jenkins, so I cannot tell you how to do that. Node.js instructions say to use apk package manager on Alpine, if that is your distribution.

    Cheers,
    Victor

    17:43:53 14:43:53.639 DEBUG: Launching command /home/jenkins/.sonar/js/node-runtime/node -v 17:43:53 14:43:53.642 ERROR: /home/jenkins/.sonar/js/node-runtime/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28’ not found (required by /home/jenkins/.sonar/js/node-runtime/node)

    still facing same issue . update node.js to 16 but still same problem . pipeline itself picking it own node.js .
    tools {
    jdk ‘openjdk17’
    nodejs ‘nodejs16’
    //nodejs ‘system’

    environment {
    SCANNER_HOME = tool ‘RED SonarQube Scanner 4.0’
    JAVA_HOME = tool ‘openjdk17’
    BRANCH = ‘master’
    NODEJS_HOME = tool ‘nodejs16’
    change the parameter but still same issue it is picking its own node.js

    **17:55:38** + /home/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/RED_SonarQube_Scanner_4.0/bin/sonar-scanner -Dsonar.java.binaries=. -Dsonar.branch.name=master -Dsonar.projectKey=raqmanah_snippet-managment -Dsonar.sources=. -Dsonar.organization=raqmanah -Dsonar.exclusions=dist/,.sonar/,.scannerwork/,node_modules/,.git/,nginx/,src/*/.spec.ts,src/*/.spec.tsx -X **17:55:38** 14:55:37.861 INFO: Scanner configuration file: /home/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/RED_SonarQube_Scanner_4.0/conf/sonar-scanner.properties **17:55:38** 14:55:37.874 INFO: Project root configuration file: NONE **17:55:38** 14:55:37.897 INFO: SonarScanner 5.0.1.3006 **17:55:38** 14:55:37.897 INFO: Java 17 Oracle Corporation (64-bit) **17:55:38** 14:55:37.898 INFO: Linux 5.4.0-1095-azure amd64 **17:55:38** 14:55:38.052 DEBUG: keyStore is : **17:55:38** 14:55:38.053 DEBUG: keyStore type is : pkcs12 **17:55:38** 14:55:38.053 DEBUG: keyStore provider is : **17:55:38** 14:55:38.053 DEBUG: init keystore **17:55:38** 14:55:38.053 DEBUG: init keymanager of type SunX509 **17:55:38** 14:55:38.150 DEBUG: Create: /home/jenkins/.sonar/cache **17:55:38** 14:55:38.151 INFO: User cache: /home/jenkins/.sonar/cache **17:55:38** 14:55:38.151 DEBUG: Create: /home/jenkins/.sonar/cache/_tmp **17:55:38** 14:55:38.153 DEBUG: Extract sonar-scanner-api-batch in temp... **17:55:38** 14:55:38.156 DEBUG: Get bootstrap index... **17:55:38** 14:55:38.156 DEBUG: Download: https://sonarcloud.io/batch/index **17:55:38** 14:55:38.979 DEBUG: Get bootstrap completed **17:55:39** 14:55:38.981 DEBUG: Create isolated classloader... **17:55:39** 14:55:38.991 DEBUG: Start temp cleaning... **17:55:39** 14:55:38.994 DEBUG: Temp cleaning done **17:55:39** 14:55:38.994 INFO: Analyzing on SonarCloud **17:55:39** 14:55:38.994 INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent) **17:55:39** 14:55:38.995 DEBUG: Work directory: /home/jenkins/workspace/sc_Snippet_Managment/.scannerwork **17:55:39** 14:55:38.996 DEBUG: Execution execute **17:55:39** 14:55:39.225 DEBUG: Scanner max available memory: 14747172864 **17:55:39** 14:55:39.236 DEBUG: SonarCloud 10.3.0.1951 **17:55:58** 14:55:57.984 INFO: 0 source files to be analyzed **17:55:58** 14:55:58.063 INFO: 0/0 source files have been analyzed **17:55:58** 14:55:58.063 INFO: Sensor IaC AzureResourceManager Sensor [iac] (done) | time=83ms **17:55:58** 14:55:58.063 INFO: Sensor JavaScript inside YAML analysis [javascript] **17:55:58** 14:55:58.083 INFO: No input files found for analysis **17:55:58** 14:55:58.083 INFO: Hit the cache for 0 out of 0 **17:55:58** 14:55:58.085 INFO: Miss the cache for 0 out of 0 **17:55:58** 14:55:58.085 INFO: Sensor JavaScript inside YAML analysis [javascript] (done) | time=22ms **17:55:58** 14:55:58.085 INFO: Sensor JavaScript inside HTML analysis [javascript] **17:55:58** 14:55:58.086 DEBUG: Deploying bundle **17:55:58** 14:55:58.086 DEBUG: Deploying the bridge server into /home/jenkins/workspace/sc_Snippet_Managment/.scannerwork/.sonartmp/bridge-bundle **17:56:01** 14:56:00.502 DEBUG: Deploying bundle (done) | time=2416ms **17:56:01** 14:56:00.502 INFO: Detected os: Linux arch: amd64 alpine: false. Platform: LINUX_X64 **17:56:01** 14:56:00.504 DEBUG: Currently installed Node.js version: v20.9.0. Available version in analyzer: v20.9.0 **17:56:01** 14:56:00.504 DEBUG: Skipping node deploy. Deployed node has latest version. **17:56:01** 14:56:00.505 DEBUG: Launching command /home/jenkins/.sonar/js/node-runtime/node -v **17:56:01** 14:56:00.511 ERROR: /home/jenkins/.sonar/js/node-runtime/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /home/jenkins/.sonar/js/node-runtime/node) **17:56:01** 14:56:00.514 WARN: Embedded Node.js failed to deploy. Will fallback to host Node.js. **17:56:01** org.sonar.plugins.javascript.nodejs.NodeCommandException: Failed to determine the version of Node.js, exit value 1. Executed: '/home/jenkins/.sonar/js/node-runtime/node -v' **17:56:01** at org.sonar.plugins.javascript.nodejs.NodeVersion.getVersion(NodeVersion.java:59) **17:56:01** at org.sonar.plugins.javascript.bridge.EmbeddedNode.deploy(EmbeddedNode.java:192) **17:56:01** at org.sonar.plugins.javascript.bridge.BridgeServerImpl.deploy(BridgeServerImpl.java:173) **17:56:01** at org.sonar.plugins.javascript.bridge.BridgeServerImpl.startServerLazily(BridgeServerImpl.java:299) **17:56:01** at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:78) **17:56:01** at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48) **17:56:01** at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:185) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:181) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:152) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.bootstrap.ScannerContainer.doAfterStart(ScannerContainer.java:397) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:125) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:57) **17:56:01** at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:51) **17:56:01** at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) **17:56:01** at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) **17:56:01** at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) **17:56:01** at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) **17:56:01** at java.base/java.lang.reflect.Method.invoke(Method.java:568) **17:56:01** at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) **17:56:01** at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source) **17:56:01** at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) **17:56:01** at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) **17:56:01** at org.sonarsource.scanner.cli.Main.execute(Main.java:126) **17:56:01** at org.sonarsource.scanner.cli.Main.execute(Main.java:81) **17:56:01** at org.sonarsource.scanner.cli.Main.main(Main.java:62) **17:56:01** **17:56:01** 14:56:00.515 DEBUG: Deploying custom rules bundle jar:file:/home/jenkins/.sonar/cache/91ab6512fd5d7f04f34afa1cedc7714f/sonar-securityjsfrontend-plugin.jar!/js-vulnerabilities-rules-1.0.0.tgz to /home/jenkins/workspace/sc_Snippet_Managment/.scannerwork/.sonartmp/bridge-bundle/package/custom-rules9470037959180292823 **17:56:01** 14:56:00.519 DEBUG: Starting server **17:56:01** 14:56:00.521 DEBUG: Creating Node.js process to start the bridge server on port 35939 **17:56:01** 14:56:00.523 INFO: Using Node.js executable: 'node'. **17:56:01** 14:56:00.524 DEBUG: Checking Node.js version **17:56:01** 14:56:00.524 DEBUG: Launching command node -v **17:56:01** 14:56:00.529 ERROR: node: --openssl-legacy-provider is not allowed in NODE_OPTIONS **17:56:01** 14:56:00.531 ERROR: Failed to determine the version of Node.js, exit value 9. Executed: 'node -v' **17:56:01** org.sonar.plugins.javascript.nodejs.NodeCommandException: Failed to determine the version of Node.js, exit value 9. Executed: 'node -v' **17:56:01** at org.sonar.plugins.javascript.nodejs.NodeVersion.getVersion(NodeVersion.java:59) **17:56:01** at org.sonar.plugins.javascript.nodejs.NodeCommandBuilderImpl.checkNodeCompatibility(NodeCommandBuilderImpl.java:180) **17:56:01** at org.sonar.plugins.javascript.nodejs.NodeCommandBuilderImpl.build(NodeCommandBuilderImpl.java:153) **17:56:01** at org.sonar.plugins.javascript.bridge.BridgeServerImpl.initNodeCommand(BridgeServerImpl.java:264) **17:56:01** at org.sonar.plugins.javascript.bridge.BridgeServerImpl.startServer(BridgeServerImpl.java:192) **17:56:01** at org.sonar.plugins.javascript.bridge.BridgeServerImpl.startServerLazily(BridgeServerImpl.java:304) **17:56:01** at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:78) **17:56:01** at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48) **17:56:01** at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:185) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:181) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:152) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.bootstrap.ScannerContainer.doAfterStart(ScannerContainer.java:397) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:125) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:57) **17:56:01** at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:51) **17:56:01** at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) **17:56:01** at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) **17:56:01** at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) **17:56:01** at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) **17:56:01** at java.base/java.lang.reflect.Method.invoke(Method.java:568) **17:56:01** at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) **17:56:01** at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source) **17:56:01** at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) **17:56:01** at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) **17:56:01** at org.sonarsource.scanner.cli.Main.execute(Main.java:126) **17:56:01** at org.sonarsource.scanner.cli.Main.execute(Main.java:81) **17:56:01** at org.sonarsource.scanner.cli.Main.main(Main.java:62) **17:56:01** **17:56:01** 14:56:00.532 INFO: Hit the cache for 0 out of 0 **17:56:01** 14:56:00.532 INFO: Miss the cache for 0 out of 0 **17:56:01** 14:56:01.160 INFO: ------------------------------------------------------------------------ **17:56:01** 14:56:01.161 INFO: EXECUTION FAILURE **17:56:01** 14:56:01.161 INFO: ------------------------------------------------------------------------ **17:56:01** 14:56:01.161 INFO: Total time: 23.326s **17:56:01** 14:56:01.199 INFO: Final Memory: 26M/216M **17:56:01** 14:56:01.199 INFO: ------------------------------------------------------------------------ **17:56:01** 14:56:01.199 ERROR: Error during SonarScanner execution **17:56:01** java.lang.IllegalStateException: Error while running Node.js. A supported version of Node.js is required for running the analysis of JS in HTML files. Please make sure a supported version of Node.js is available in the PATH. Alternatively, you can exclude JS in HTML files from your analysis using the 'sonar.exclusions' configuration property. See the docs for configuring the analysis environment: https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/languages/javascript-typescript-css/ **17:56:01** at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:91) **17:56:01** at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66) **17:56:01** at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48) **17:56:01** at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:185) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:181) **17:56:01** at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:152) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.bootstrap.ScannerContainer.doAfterStart(ScannerContainer.java:397) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:125) **17:56:01** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) **17:56:01** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) **17:56:01** at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:57) **17:56:01** at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:51) **17:56:01** at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) **17:56:01** at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) **17:56:01** at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) **17:56:01** at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) **17:56:01** at java.base/java.lang.reflect.Method.invoke(Method.java:568) **17:56:01** at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) **17:56:01** at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source) **17:56:01** at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) **17:56:01** at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) **17:56:01** at org.sonarsource.scanner.cli.Main.execute(Main.java:126) **17:56:01** at org.sonarsource.scanner.cli.Main.execute(Main.java:81) **17:56:01** at org.sonarsource.scanner.cli.Main.main(Main.java:62) **17:56:01** Caused by: org.sonar.plugins.javascript.nodejs.NodeCommandException: Failed to determine the version of Node.js, exit value 9. Executed: 'node -v' **17:56:01** at org.sonar.plugins.javascript.nodejs.NodeVersion.getVersion(NodeVersion.java:59) **17:56:01** at org.sonar.plugins.javascript.nodejs.NodeCommandBuilderImpl.checkNodeCompatibility(NodeCommandBuilderImpl.java:180) **17:56:01** at org.sonar.plugins.javascript.nodejs.NodeCommandBuilderImpl.build(NodeCommandBuilderImpl.java:153) **17:56:01** at org.sonar.plugins.javascript.bridge.BridgeServerImpl.initNodeCommand(BridgeServerImpl.java:264) **17:56:01** at org.sonar.plugins.javascript.bridge.BridgeServerImpl.startServer(BridgeServerImpl.java:192) **17:56:01** at org.sonar.plugins.javascript.bridge.BridgeServerImpl.startServerLazily(BridgeServerImpl.java:304) **17:56:01** at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:78) **17:56:01** ... 33 more **17:56:01** [Pipeline] } **17:56:01** WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed? **17:56:01** [Pipeline] // withSonarQubeEnv **17:56:01** [Pipeline] } **17:56:01** [Pipeline] // withEnv **17:56:01** [Pipeline] } **17:56:01** [Pipeline] // withEnv **17:56:01** [Pipeline] } **17:56:01** [Pipeline] // stage **17:56:01** [Pipeline] } **17:56:01** [Pipeline] // node **17:56:01** [Pipeline] End of Pipeline **17:56:01** ERROR: script returned exit code 1 **17:56:01** Finished: FAILURE

    18:56:08 15:56:08.187 DEBUG: Extracting embedded node to /home/jenkins/.sonar/js/node-runtime/node 18:56:12 15:56:11.779 DEBUG: Launching command /home/jenkins/.sonar/js/node-runtime/node -v 18:56:12 15:56:11.789 ERROR: /home/jenkins/.sonar/js/node-runtime/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28’ not found (required by /home/jenkins/.sonar/js/node-runtime/node) 18:56:12 15:56:11.792 WARN: Embedded Node.js failed to deploy. Will fallback to host Node.js. 18:56:12 org.sonar.plugins.javascript.nodejs.NodeCommandException: Failed to determine the version of Node.js, exit value 1. Executed: ‘/home/jenkins/.sonar/js/node-runtime/node -v’ 18:56:12 at org.sonar.plugins.javascript.nodejs.NodeVersion.getVersion(NodeVersion.java:59) 18:56:12 at org.sonar.plugins.javascript.bridge.EmbeddedNode.deploy(EmbeddedNode.java:192) 18:56:12 at org.sonar.plugins.javascript.bridge.BridgeServerImpl.deploy(BridgeServerImpl.java:173) 18:56:12 at org.sonar.plugins.javascript.bridge.BridgeServerImpl.startServerLazily(BridgeServerImpl.java:299) 18:56:12 at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:78) 18:56:12 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62) 18:56:12 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75) 18:56:12 at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48) 18:56:12 at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66) 18:56:12 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48) 18:56:12 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64) 18:56:12 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) 18:56:12 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) 18:56:12 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:185) 18:56:12 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:181) 18:56:12 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:152) 18:56:12 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) 18:56:12 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) 18:56:12 at org.sonar.scanner.bootstrap.ScannerContainer.doAfterStart(ScannerContainer.java:397) 18:56:12 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) 18:56:12 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) 18:56:12 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:125) 18:56:12 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123) 18:56:12 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109) 18:56:12 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:57) 18:56:12 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:51) 18:56:12 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) 18:56:12 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 18:56:12 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) 18:56:12 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 18:56:12 at java.base/java.lang.reflect.Method.invoke(Method.java:568) 18:56:12 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) 18:56:12 at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source) 18:56:12 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) 18:56:12 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) 18:56:12 at org.sonarsource.scanner.cli.Main.execute(Main.java:126) 18:56:12 at org.sonarsource.scanner.cli.Main.execute(Main.java:81) 18:56:12 at org.sonarsource.scanner.cli.Main.main(Main.java:62) 18:56:12 18:56:12 15:56:11.793 DEBUG: Deploying custom rules bundle jar:file:/home/jenkins/.sonar/cache/91ab6512fd5d7f04f34afa1cedc7714f/sonar-securityjsfrontend-plugin.jar!/js-vulnerabilities-rules-1.0.0.tgz to /home/jenkins/workspace/sc_Snippet_Managment/.scannerwork/.sonartmp/bridge-bundle/package/custom-rules3659435495298510849 18:56:12 15:56:11.798 DEBUG: Starting server 18:56:12 15:56:11.800 DEBUG: Creating Node.js process to start the bridge server on port 35159 18:56:12 15:56:11.801 INFO: Using Node.js executable /home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node from property sonar.nodejs.executable. 18:56:12 15:56:11.801 DEBUG: Checking Node.js version 18:56:12 15:56:11.801 DEBUG: Launching command /home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node -v 18:56:12 15:56:11.806 ERROR: /home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS 18:56:12 15:56:11.807 ERROR: Failed to determine the version of Node.js, exit value 9. Executed: ‘/home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node -v’ 18:56:12 org.sonar.plugins.javascript.nodejs.NodeCommandException: Failed to determine the version of Node.js, exit value 9. Executed: ‘/home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node -v’ 18:56:12 at org.sonar.plugins.javascript.nodejs.NodeVersion.getVersion(NodeVersion.java:59)

    ldd --version
    ldd (Ubuntu GLIBC 2.27-3ubuntu1.5) 2.27
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Roland McGrath and Ulrich Drepper.

    ~/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin$ ./node --version
    v16.15.1

    Thanks for that detail.

    The reason I ask is that we’ve recently rolled out embedded Node.js distributions. I was trying to understand whether your build agent should have been supported. The answer is “yes and no”. Ubuntu is supported, but not a version as old as yours.

    So how should you proceed?

    The choices, as I see them:

  • upgrade to a more recent version of Ubuntu - embedded Node.js will “just work” for you
  • remove all existing Node.js distros from your build agent, reinstall a current version of Node.js and make sure it’s the OS’s default version.
  • That’s assuming you want/need to analyze JS / TS / CSS. Your other option is to add **/*.js,**/*.ts,**/*.css to your exclusions.

    strong text

    unfortuanately i dont want to install dotnet on jenkins host as i need different different dotnet version for compiling different set of projects

    uploading jenkins snip. from where i am controlling the node.js installation.

    and i am able to install opn below path
    jenkins@jenkins-cluster-slave-01:~/.sonar/js$ cd /home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin
    jenkins@jenkins-cluster-slave-01:~/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin$ ./node --version
    v16.15.1

    and if you see my logs sonarscanner after picking its version trying to pick this version but failing with weired error

    DEBUG: Launching command /home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node -v 18:56:12 15:56:11.806 ERROR: /home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS 18:56:12 15:56:11.807 ERROR: Failed to determine the version of Node.js, exit value 9. Executed: ‘/home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node -v’ 18:56:12 org.sonar.plugins.javascript.nodejs.NodeCommandException: Failed to determine the version of Node.js, exit value 9. Executed: ‘/home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin/node -v’

    To be clear, we’re talking about Node.js, not .NET.

    Your screenshot shows an installer named “nodejs20” that installs Node.js v16.

    Yes sorry (ignore .Net ) i mean we do not have a specific node.js version on host level.

    and please don’t confuse by name “nodejs20” it is nodejs16

    ./node --version
    v16.15.1

    upgraded to nodejs 20

    ./node --version
    ./node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28’ not found (required by ./node)

    So the underlying cause of the earlier failure was not a problem on our side with your old version of Unbuntu, but Node.js’s.

    Masroor Ahmad:

    jenkins@jenkins-cluster-slave-01:~/.sonar/js$ cd /home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin
    jenkins@jenkins-cluster-slave-01:~/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs20/bin$ ./node --version
    v16.15.1

    it does not look like you are executing it from the path, but from the current directory.

    Please make sure that node v16 binary is available in the PATH, and keep in mind v16 will be dropped soon. To upgrade to node18, you will need to upgrade OS. Node.js themselves are not supporting Ubuntu 18 for versions higher than Node16.

    Cheers