Operating system (Host): Microsoft Windows 10 Enterprise / Version 10.0.19045 Build 19045
WSL : Ubuntu 22.04.3 LTS / Release: 22.04
SonarLint plugin version: 10.9.0.79423
IntelliJ version: 2024.2.0.2 (Ultimate Edition)
Programming language you’re coding in: Java / JS
Is connected mode used: No (planning to use connected mode)
My cloned code and local server are in WSL, IntelliJ is able to read my code from the WSL, but for some reason, when I try to analyse an individual file, I receive the error below. For JavaScript files, I don’t get this error, but I don’t get any results.
[2024-09-24T14:37:35.501] [SonarLint Server RPC request executor] WARN sonarlint - Node.js could not be automatically detected, has to be configured manually in the SonarLint preferences!
Hi, I could share it privately, but that’s happening for simple files as well, the files are in the WSL, so I feel it’s something related to that. Please, let me know how you want to move forward.
I have updated to the latest sonarlint for intellij and still having issues with my project. I have created a simple project with a java file and sonarlint worked fine. However, with my main project, which is a monolith code base (sap commerce-hybris), with java and web files, it doesn’t work, same error for Java files, and for JS I’m getting errors and exceptions.
My team is actually trying to evaluate SonarLint with the connected mode, but since it doesn’t work with an “offline” mode, we can’t move forward to the connected mode.
Please, let me know what else could I try, some settings or properties in IntelliJ specific to SonarLint or something like that.
Thanks for checking. I’m going to flag this for the language team since this seems to be related specifically to Java files. Yes, I know you mentioned JS too, but I suspect we have multiple things going on here. So let’s start with Java & see where that gets us.
Hey @brilliant-dolby, I apologize for asking again, but could you try again with the latest version, 10.11? We fixed some issues regarding the loading of Node.js in some specific scenarios.
I do not necessarily expect the issue to be fixed based on what you said, so could you also please share the SonarLint logs with us?
Hi @nicolas.quinquenel, I have updated the version, still no luck. Please, let me know how can I privately share the logs with you and also where can I find these logs file or would it be just a copy/paste of what I have in IntelliJ console. Many Thanks!
Thank you, @brilliant-dolby; just to keep you updated, I received the logs and am continuing the investigation. I’m able to analyze Java files on WSL2, so I’m still unsure about the root cause of your issue.
Regarding the Node.js issue, we do not support running a Linux binary on Windows. Could you try setting a Node.js installed on your Windows or your WSL environment? For example, you could simply extract the Windows binary in the WSL environment and use it within SonarLint. Also, please restart SonarLint if you change your Node.js version to ensure it has been taken into account.
Hey @brilliant-dolby,
I am trying to understand the issue on the Java side, and I have a couple of questions.
What is the size of the file you are trying to analyze (both in terms of LoC and size on disk)? From what I am reading in the logs, I see that the file takes a few seconds (3 to 4 seconds) to fail before parsing.
Are you using Java preview features? The analysis seems to be targeting Java 17, and I would like to clarify whether preview features may be interfering with the parsing.
Thanks, I think I have said that, yes, with a simple java project the sonarlint is working fine. The problem is that when I load my work project, which is a large code base, I get this error, ECJ : Unable to parse file.
Hi @Dorian_Burihabwa / @nicolas.quinquenel / @ganncamp , just as an update, I have created a new project with the same code base but without using the plugin SAP-Commerce-Developers-Toolset EPAM Systems and the SonarLint worked without giving me the error. There might be some conflict, restriction or settings on this plugin that is causing this issue. I also use the jRebel plugin and both are MUST-have for SAP Commerce projects.
Hi @Dorian_Burihabwa / @nicolas.quinquenel , it looks like the SAP Commerce Tool plugin is not all at fault. After trying not to use the plugin, I’m still facing the error for some files.
Hey @brilliant-dolby,
Thank you for coming back to the topic. Unfortunately, it is going to be difficult for me to investigate the Java issue further without the file or a code sample that would trigger the issue.
Would it be possible for you to share that file with us using the link shared above?