redhat-developer / vscode-server-connector

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

Server does not persist (consistently) across VS Code restarts. Neither do deployments. #448

Closed ryno1234 closed 3 years ago

ryno1234 commented 4 years ago

I'm having an issue where my configured server does not persist across VS Code restarts. This is inconsistent too. Sometimes I can restart VS Code and my configured "Wildfly" server exists under the "Red Hat Server Connector" list item. Other times there will be no server configured.

Additionally, when no server is configured, I can go to add a new server (on disk server), I receive no errors yet the server does not show configured after I go through the Add Server process. A series of VS Code restarts will eventually yield the configured server.

Finally, a similar behavior also happens with configured deployments. Sometimes the server configuration will be retained across restarts, but my deployment file that I configured is no longer listed and I have to re-add it as a deployment.

This is new to me within the last ~6 months or so (I'm guessing on the timing here). I didn't have these problems until recently. Previously the whole server connector and deployment piece were rock-solid and never gave me issues.

Attached is an image that may help determine what's going on. It seems that a server is in fact configured under the name "Wildfly" (which is what my server was called), but the UI clearly does not show the server existing.

I'm running JDK 11 if that matters.

Red Hat Server Connector

robstryker commented 4 years ago

I haven't been able to replicate this, but I'll have my QE give it a try. In the meantime, you can do a few things if you wish to help debug.

First, the folder where the servers are stored is yourhomedir/.rsp/redhat-server-connector/servers/ where you should be able to verify that despite restarting vscode, your server file still exists in that folder?

Also, another option is to verify that the rsp is actually running, and with what flags it was started. After your vscode extension starts the rsp automatically (or manually), you can check your running process list for one containing felix.jar in the command line. If we can verify that the rsp is actually running, that would help determine if this is an error in the rsp or if the UI is incorrectly out of sync with the rsp (ie maybe the rsp isn't running but hte UI says it is).

Another idea is to manually stop and start the rsp in the UI yourself and see if that fixes it. You shouldn't need to restart vscode, but only right-click on the redhat-server-connector in the view and stop the rsp and hten start the rsp again.

Let me know if any of this helps.

ryno1234 commented 4 years ago

Thanks for the quick reply @robstryker.

I did a series of VS Code restarts. The server appeared as expected multiple times until the 4th or 5th restart where the server no longer appear. I checked the directory you mentioned and the server configuration file existed there. I also checked my running processes and did see a java.exe process running with felix.jar in the command line.

Attached is a screenshot of the UI along with stderr output. The error seems to happen regardless of whether or not the server appears as expected thus it seems inconsequential.

Red Hat Server Connector - Error 2

robstryker commented 4 years ago

That error seems to occur randomly on apache felix and can be ignored (I believe?) https://issues.apache.org/jira/browse/FELIX-5765

It could turn out that there's some UI race condition where we are not properly updating the UI model with what we receive from the server. I can maybe add a 'refresh' action which might help. When this issue occurs, did you try stopping and starting the rsp again (not the extension or vscode... but the rsp... ie right-click on redhat-server-connector in the UI and stop rsp / start rsp?) ? Does that fix the issue?

ryno1234 commented 4 years ago

Starting and stopping RSP does not correct the UI.

robstryker commented 4 years ago

This is new to me within the last ~6 months or so (I'm guessing on the timing here). I didn't have these problems until recently. Previously the whole server connector and deployment piece were rock-solid and never gave me issues.

So looking at the commit history, on January 7th we added the activity bar section which includes a duplicate view for people who don't want the servers in the same main tab as their project workspace.

The release history of rsp-ui is as follows:   | rsp-ui-0.22.0-197.vsix | 10-Jan-2020 15:40 | 289K |     | rsp-ui-0.22.7-276.vsix | 30-Mar-2020 17:04 | 289K |  

So it was released January 10th, which is just about 6 months ago plus or minus a week ;)

Since then we've opened two issues where people have reported inconsistency:

https://github.com/redhat-developer/vscode-rsp-ui/issues/106 https://github.com/redhat-developer/vscode-rsp-ui/issues/112

We're considering removing the 2nd view in the hopes that it removes these errors. The timeline seems to match up.

ryno1234 commented 4 years ago

Thanks @robstryker. I was totally guessing on that timeframe, so I'm surprised it matched up as well as it did. :)

Have a great day. Let me know if you need any help, testing, etc.

robstryker commented 3 years ago

The second view was removed. Please re-open if this is still reproducable.