Sonar-scanner fails to uncompress JRE (ERR_FS_EISDIR)?

Hi,

Supporting a team that uses node:latest, install the scanner and now it fails with the log below. Will soon do some testing as well on my side but could it be a general issue ?

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.<anonymous> (/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 }
```'

Seems to be an issue with the newly released Node.js 23.1.

I asked them to use FROM node:22 rather than FROM node:latest.

Hello @Patrice_Scribe ,

Thank you a lot for your report,

Indeed, I could reproduce the issue when running the latest NPM Scanner with NodeJS 23+. I’ve created a ticket SCANNPM-55 so we can track this bug and we will fix it in the upcoming days.

For information, the issue encountered by the Original Poster was due to a bug in Node.js 23:

The bug has since been fixed.

If you encounter the issue, please upgrade your version of Node.js to at least 23.2.