redhat-developer / vscode-server-connector

📦 Connects Visual Studio Code to your server adapters and run, deploy apps !!
Eclipse Public License 2.0
56 stars 26 forks source link

Cannot create new Server or use existing one within the Runtime Server Protocol UI #595

Closed Vrakoss closed 3 months ago

Vrakoss commented 9 months ago

Unable to run Server

Environment

OS: Mac 13.5.2 (22G91)

VS Code: Version: 1.82.2 Commit: abd2f3db4bdb28f9e95536dfa84d8479f1eb312d Date: 2023-09-14T05:59:47.790Z Electron: 25.8.1 ElectronBuildId: 23779380 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Darwin x64 22.6.0

Server Connector: v0.26.12 Runtime Server Protocol UI: v0.24.9

Problem Description

After installing the extensions I wanted to follow the guidlines and "create a new server" via the respective button within the "Servers" tab. However no matter which option I chose (Download server -> yes | No, use server on disk). It is unable to proceed and vs code shows following runtime exception: image "Unable to create the server: Extension backend error - unable to contact the rsp server".

Maybe also relevant to mention after installing within the Servers tab, the Red Hat Server Connector is stuck on "Starting". Terminating the RSP provider stops it, but it doesn't fix the issue with adding a server new or old in general. Screenshot as reference: image

I hope this issue description is understandable. If I find a solution on my own, I will update the issue accordingly.

Vrakoss commented 9 months ago

Actually I found the culprit even tho the error message from vs code was not really helpful in that matter.

Via the vs code command palette I opened the extensions log file Developer: Open Extensions Logs Folder. Within that file I have been able to see that it was looking for the java binary and that it was running into an EOENT error. Based on that I came to the conclusion that the problem might be caused by a wrong configuration of the java home path. So the solution was to put into the vs code settings.json following addition:

settings.json

{
    ...
    "rsp-ui.rsp.java.home": "/Volumes/DevTools/Java/jdk17/Contents/Home",
    ...
}
// Keep in mind that the path might differ for your own system.

This resolved the issue and theRed Hat Server Connector has been able to start. If possible the error message from the extension could be improved here to detect this kind of issue more easily. If you guys think this is somehow what not important then please feel free to close the issue again.

Thanks for the lovely extension!

robstryker commented 9 months ago

Anything that leaves our users confused is important to fix ;)

We'll see what we can do! :D

MarcosMoraes23 commented 3 months ago

Actually I found the culprit even tho the error message from vs code was not really helpful in that matter.

Via the vs code command palette I opened the extensions log file Developer: Open Extensions Logs Folder. Within that file I have been able to see that it was looking for the java binary and that it was running into an EOENT error. Based on that I came to the conclusion that the problem might be caused by a wrong configuration of the java home path. So the solution was to put into the vs code settings.json following addition:

settings.json

{
    ...
    "rsp-ui.rsp.java.home": "/Volumes/DevTools/Java/jdk17/Contents/Home",
    ...
}
// Keep in mind that the path might differ for your own system.

This resolved the issue and theRed Hat Server Connector has been able to start. If possible the error message from the extension could be improved here to detect this kind of issue more easily. If you guys think this is somehow what not important then please feel free to close the issue again.

Thanks for the lovely extension!

Worked for me! I just needed to set the bin folder at the end of the string.

"rsp-ui.rsp.java.home": "/Users/your-user/Library/Java/JavaVirtualMachines/corretto-11.0.18/Contents/Home/bin",
robstryker commented 3 months ago

When I have an invalid folder in the settings, this is the error I get:

image

When I have no vscode setting in place, but my JAVA_HOME environment variable has an invalid installation (specifically, the javac binary in the bin folder doesn't exist), this is the error I get:

image

When I have no vscode setting in place, but my JAVA_HOME environment variable has an invalid installation (specifically, the java binary in the bin folder doesn't exist), this is the error I get:

image

Seems the code has a hard-check on the existence of javac but not a hard check on the existence of java. I can fix this easily. Still, it seems weird that a folder would have a javac command and NOT have a java command.

robstryker commented 3 months ago

When attempting to run via the command pallete and using command create a new server, I see the following:

image

So far I'm unable to replicate the situation where we ONLY get the backend error and not some other more informative error. I'm not saying it's not happening, just that I can't get it to happen. Strange.

robstryker commented 3 months ago

Committed this partial change, but, again, I'm not able to replicate your actual situation.

robstryker commented 3 months ago

I've tried every code path I can, so, just to keep the issue tracker nice nad tidy, I'm going to close this. But if someone can come up with explicit steps to replicate receiving only the vague error and not the more in depth one, I'll be happy to re-open.