Skip to content

Node.js 23.1 breaks sonar-scanner ? #55621

@ghost

Description

Version

23.1

Platform

No response

Subsystem

No response

What steps will reproduce the bug?

Using this docker file:

Define build arguments

ARG SONAR_PROJECT_KEY=****
ARG SONAR_ORGANIZATION_KEY=***
ARG SONAR_HOST_URL=https://sonarcloud.io
ARG SONAR_TOKEN=***
#FROM node:22 as node
FROM node:latest as node

ARG SONAR_PROJECT_KEY
ARG SONAR_ORGANIZATION_KEY
ARG SONAR_HOST_URL
ARG SONAR_TOKEN

WORKDIR /usr/local/app
#COPY ./ /usr/local/app/
#RUN npm ci

Install SonarScanner

RUN npm install -g sonarqube-scanner

Start SonarCloud analysis

RUN sonar-scanner
-Dsonar.host.url=$SONAR_HOST_URL
-Dsonar.projectKey=$SONAR_PROJECT_KEY
-Dsonar.organization=$SONAR_ORGANIZATION_KEY
-Dsonar.token=$SONAR_TOKEN

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

The scanner is downloading JRE and then runs

What do you see instead?

It is causing now a ERR_FS_EISDIR error. Below the log show by tool:

2024-10-28T10:47:55.6170505Z #14 0.463 [INFO] Bootstrapper: Retrieving info from "package.json" file
2024-10-28T10:47:55.7711877Z #14 0.465 [INFO] Bootstrapper: Platform: linux x64
2024-10-28T10:47:55.7712771Z #14 0.467 [INFO] Bootstrapper: Server URL: https://sonarcloud.io/
2024-10-28T10:47:55.7713528Z #14 0.467 [INFO] Bootstrapper: Version: 4.2.5
2024-10-28T10:47:55.7713752Z #14 0.467 [INFO] Bootstrapper: JRE provisioning is supported
2024-10-28T10:47:55.9226160Z #14 0.769 [INFO] Bootstrapper: No Cache found for JRE
2024-10-28T10:47:56.0989337Z #14 0.794 [INFO] Bootstrapper: Download starting...
2024-10-28T10:47:56.2442195Z #14 1.090 [INFO] Bootstrapper: Download complete
2024-10-28T10:47:56.3973876Z #14 1.093 [INFO] Bootstrapper: Downloaded JRE to /root/.sonar/cache/bcb1b7b8ad68c93093f09b591b7cb17161d39891f7d29d33a586f5a328603707/OpenJDK17U-jre_x64_linux_hotspot_17.0.11_9.tar.gz
2024-10-28T10:47:56.4086852Z #14 1.255 node:internal/fs/streams:340
2024-10-28T10:47:56.4087568Z #14 1.255 validatePath(this.path, 'path', { expectFile: true, syscall: 'write' });
2024-10-28T10:47:56.4087803Z #14 1.255 ^
2024-10-28T10:47:56.4088035Z #14 1.255
2024-10-28T10:47:56.4089720Z #14 1.255 SystemError [ERR_FS_EISDIR]: Path is a directory: write returned ERR_FS_EISDIR (is a directory) /root/.sonar/cache/bcb1b7b8ad68c93093f09b591b7cb17161d39891f7d29d33a586f5a328603707/OpenJDK17U-jre_x64_linux_hotspot_17.0.11_9.tar.gz_extracted/jdk-17.0.11+9-jre/
2024-10-28T10:47:56.4090225Z #14 1.255 at WriteStream (node:internal/fs/streams:340:5)
2024-10-28T10:47:56.4090715Z #14 1.255 at new WriteStream (/usr/local/lib/node_modules/sonarqube-scanner/node_modules/graceful-fs/graceful-fs.js:322:29)
2024-10-28T10:47:56.4091473Z #14 1.255 at Object.createWriteStream (/usr/local/lib/node_modules/sonarqube-scanner/node_modules/graceful-fs/graceful-fs.js:345:12)
2024-10-28T10:47:56.4091959Z #14 1.255 at Extract. (/usr/local/lib/node_modules/sonarqube-scanner/build/src/file.js:67:48) {
2024-10-28T10:47:56.4095048Z #14 1.255 code: 'ERR_FS_EISDIR',
2024-10-28T10:47:56.4095285Z #14 1.255 info: {
2024-10-28T10:47:56.4095565Z #14 1.255 code: 'ERR_FS_EISDIR',
2024-10-28T10:47:56.4095818Z #14 1.255 message: 'is a directory',
2024-10-28T10:47:56.4096368Z #14 1.255 path: '/root/.sonar/cache/bcb1b7b8ad68c93093f09b591b7cb17161d39891f7d29d33a586f5a328603707/OpenJDK17U-jre_x64_linux_hotspot_17.0.11_9.tar.gz_extracted/jdk-17.0.11+9-jre/',
2024-10-28T10:47:56.4096751Z #14 1.255 syscall: 'write',
2024-10-28T10:47:56.4097608Z #14 1.255 errno: [class NodeError extends SystemError] {
2024-10-28T10:47:56.4097873Z #14 1.255 HideStackFramesError: [class HideStackFramesError extends NodeError]
2024-10-28T10:47:56.4098090Z #14 1.255 }
2024-10-28T10:47:56.4098235Z #14 1.255 },
2024-10-28T10:47:56.4098417Z #14 1.255 errno: [Getter/Setter],
2024-10-28T10:47:56.4098618Z #14 1.255 syscall: [Getter/Setter],
2024-10-28T10:47:56.4098814Z #14 1.255 path: [Getter/Setter]
2024-10-28T10:47:56.4098986Z #14 1.255 }
2024-10-28T10:47:56.4099142Z #14 1.255
2024-10-28T10:47:56.4099305Z #14 1.255 Node.js v23.1.0

Additional information

I repported also the issue to the Sonar support forum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions