SonarLint 10.8.0.79133 not working anymore in PHPStorm with the latest version

[2024-08-08T10:47:36.036] [SonarLint Server RPC request executor] ERROR sonarlint - No file to analyze

The version 10.7 works as expected

Please provide

  • Operating system:
  • SonarLint plugin version: 10.8.0.79133
  • IntelliJ version: 2024.1.5 - Build #PS-241.18968.24, built on August 3, 2024
  • Programming language you’re coding in: PHP
  • Is connected mode used: no
    • Connected to SonarCloud or SonarQube (and which version): no

And a thorough description of the problem / question:

Hi @widderconsulting ,

We are aware of this issue and will work on a fix soon.

Thank you

Any date when this will be available? The latest version 10.8.1 is not working as well

Hello @widderconsulting, could you please share your SonarLint logs with us, including the moment SonarLint starts and after an analysis is run?

Also, we would appreciate it if you could share a dummy project reproducing this issue.

1 Like

log.txt (11.1 KB)

Here you go.

BTW: I upgraded PHPStrom to the latest version and the issue persists.

This is my IDE info:

PhpStorm 2024.2
Build #PS-242.20224.361, built on August 10, 2024
Runtime version: 21.0.3+13-b509.4 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.6.1
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2304M
Cores: 12
Metal Rendering is ON
Registry:
debugger.new.tool.window.layout=true
run.processes.with.pty=TRUE
ide.experimental.ui=true
terminal.new.ui=true
Non-Bundled Plugins:
com.jetbrains.space (242.20224.155)
rocks.blackcat.vcl (0.7.2)
com.godwin.json.parser (1.7.1)
com.intellij.ideolog (242.20224.361)
ru.adelf.idea.dotenv (2024.2)
de.espend.idea.php.annotation (11.0.1)
com.github.copilot (1.5.17.6356)
com.crunch42.openapi (1.83)
org.sonarlint.idea (10.8.1.79205)

The log file you shared does not contain enough information. Could you please share the entire logs from the moment you started SonarLint?

Also, an explanation of your project’s structure would help, as we are unaware of such an issue and cannot reproduce it.

Thank you.

log.txt (44.0 KB)

Here is the log. The issues seems to be a permission issue, but I doubt, as the former version works as expected.

org.sonar.api.utils.command.CommandException: java.io.IOException: Cannot run program "/opt/homebrew/opt/node": error=13, Permission denied
	at org.sonar.api.utils.command.CommandExecutor.execute(CommandExecutor.java:102)
	at org.sonarsource.sonarlint.core.nodejs.NodeJsHelper.runSimpleCommand(NodeJsHelper.java:155)
	at org.sonarsource.sonarlint.core.nodejs.NodeJsHelper.readNodeVersion(NodeJsHelper.java:86)
	at org.sonarsource.sonarlint.core.nodejs.NodeJsHelper.detect(NodeJsHelper.java:67)
	at org.sonarsource.sonarlint.core.analysis.NodeJsService.getClientForcedNodeJs(NodeJsService.java:92)
	at org.sonarsource.sonarlint.core.analysis.NodeJsService.getActiveNodeJs(NodeJsService.java:70)
	at org.sonarsource.sonarlint.core.analysis.NodeJsService.getActiveNodeJsVersion(NodeJsService.java:74)
	at org.sonarsource.sonarlint.core.plugin.PluginsService.loadPlugins(PluginsService.java:148)
	at org.sonarsource.sonarlint.core.plugin.PluginsService.getEmbeddedPlugins(PluginsService.java:82)
	at org.sonarsource.sonarlint.core.analysis.AnalysisEngineCache.getOrCreateStandaloneEngine(AnalysisEngineCache.java:83)

Node seems to be properly configured:

Ok. The permission error is there with the “old” version as well, but it runs properly. See the log:
log-old-version.txt (54.6 KB)

I fixed the permission issue by changing the Node.js configuration:

but the issue persists. The project has a very straightforward structure - nothing special:

1 Like

Hi @widderconsulting

Could you create a “PhpStorm Workshop Project” using the template under new project options, go to the “1.1_Basic_Completion.php” file, and check if it works?

Could you also share the node.js version you were using while doing that and share it with us, as well as logs if it is also not working?

Thank you

Hi,

works in the Workshop Project, so it seemst to be related to the project settings. Any idea?

Any idea, why it works with version 10.7.0 and not with 10.8.1 - there seems to be a change, which causes the plugin not to work with my project, which it did before

Hi @widderconsulting,

Could you share the node.js version you were using, as well as the logs?

 
Thx,
Ann

The logs are available above and the versions as well - see the screenshots above.

Node 22.6.0 and npm 10.8.2

1 Like

Hi @widderconsulting

As Nicolas mentioned, a minimal reproducing project would be really helpful(especially if we can find it on a public GitHub repository)

If it is not possible,

Could you verify with me that the plugin is not working with every file, not just specific ones under specific folders?

Could you also try deleting the “PhpStorm Workshop Project” contents or any simple project currently working on your machine, deleting everything inside, and then copying the contents of your current original project folder by folder to this new one? Can you share with me if the same issue starts to appear and if so at which point?

Thank you.

Hi Eray

nope - it’s the code of our DigitalSignage software, so I can’t share it.

It’s not working at all, but works fine with the versions before 10.8.0 - so it is related to the changes in that release.

So maybe the issue could be related to the fact, that 3 git repositories are included in the project? If I just copy over the source to a vanilla project, the code works, but copying the files is not moving the .git folder - right?

We have a known error on our side, where if a .gitignore file has rules that contradict each other, some files end up being ignored when they should not. I suspect this might be the root cause here. Could you check if you have .gitignore file, and if the content might be the source of the issue?

Yes, there are several .gitignore files, as there are a bunch of composer libraries with .gitignore files, and all of three projects are having a .gitignore file as well:

/var/
/htdocs/media/
/htdocs/css/custom.css
/htdocs/js/preload.js
/htdocs/fonts/
.idea
/var/
services
var
.idea/*

This is the directory tree:

Does this help?

My guess is, that the “services” entry could be the reason. I will try to remove that entry.

Is there any timeline for a bugfix?

Yes, removing the “services” entry in the .gitignore which is marked on the screenshot solves the issue. Thanks for figuring out. Will it be fixed in a future release?

The fix should be planned for the release next month; you can follow the progress on the ticket. Sorry for the inconvenience.