openHAB VS Code Extension Firewall issue

Hello, I’m using OpenHAB on a Synology DS and I recently activated the Firewall on that device. I initially opened port 8080 already to be able to access the OpenHAB service, but as I did not test further I failed to notice that VSCode was not working as before anymore. after opening port 5007 as well I got rid of the “failed to access server” message, but that one has now been replaced by “[Error - 17:09:12] Request textDocument/hover failed”
I was able to narrow this down to the openHAB VS Code Extension, because disabling this will also resolve the error messages. disabling the firewall also solves the problem, so my conclusion for now is that I openHAB VS Code Extension does not use port 5007.

Any good advices is appriciated before I have to start playing the game “guess the port number”

thx

  • enable logging in your firewall. Doing that you should be able to filter the rejects based on the IP of your computer
  • you can check which ports are in listening mode on OH
sudo netstat -nltu|  grep -v 127.0.0.1

thanks for the prompt reply. Unfortunately it did not help. your first option is not a viable one on a synology NAS as the Firewall does not support notifications on rejected requests because of … reasons.

so I ended up adding all the port numbers that were reported by netstat tagged with LISTEN, but the problem persists for now. I’m now guessing that it may not be about a port, but rather about a service…

The extension does not user port 5007 for the hovering part.
That is just the lsp server checking for correct configuration.

The hovering come from a different programm part and uses the port and host you have set up in your settings.

I gave up on trying to figure out the root cause of my issue. As my openHAB install is on port 8080 and I can access all functionality, this is not where the problem is. I also created a firewall rule that allowed all traffic for all protocols and all services, but even then the problem persists. So even when I would find the reason, I will not be able to solve it. Anyway some more background on my issue:

[Error - 10:07:44] Request textDocument/hover failed.

  Message: Internal error.

  Code: -32603 

java.util.concurrent.CompletionException: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.FileNotFoundException: /y:/conf/rules/lights.rules (No such file or directory)

    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)

    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)

    at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:647)

    at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632)

    at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)

    at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)

    at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$run$0(ReadRequest.java:43)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

    at java.lang.Thread.run(Thread.java:748)

Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.FileNotFoundException: /y:/conf/rules/lights.rules (No such file or directory)

    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)

    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)

    at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:265)

    at org.eclipse.xtext.ide.server.ProjectManager.getResource(ProjectManager.java:174)

    at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:327)

    at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$hover$44(LanguageServerImpl.java:736)

    at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$run$0(ReadRequest.java:37)

The file name y:/conf/rules/lights.rules relates to the file that I opened for editing, so is definitely existing. it is just the firewall disallowing the extension to read from this file. I think I should consider this a bug in the Synology DS firewall. For now I will live with the fact that I have to disable using the NAS from outside my homenetwork and the firewall whenever I do maintenance on my files

[Error - 10:07:44] Request textDocument/hover failed.

I have to admit, that this looks indeed like the lsp server.
So it tries to work on hover too.
Not sure if we can simply configure it to forget about hovering.

We have a separate hover implementation that is completely independent from LSP part.