loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.74k stars 328 forks source link

Many popups to easily cancel and get stuck into bad state during provisioning #1274

Closed doctorpangloss closed 1 day ago

doctorpangloss commented 1 week ago

What happened?
While starting a workspace for the first time on a macOS device, using IntelliJ and Kubernetes, the configuration on the backend goes smoothly.

Sometimes, automation steps on the macOS device create a bunch of popups that take the foreground focus. macOS does not debounce inputs when this occurs, so it is easy to accidentally cancel something. In my case, there was a Verifying (the dmg)... popup which took focus, occurred quickly, and then the next popup from JetBrains (now in the foreground) was:

Screenshot 2024-09-19 at 11 30 24 AM

The window I accidentally cancelled

Then I cancelled this by accident by hitting spacebar.

Now, provisioning seems to never get past showing the JetBrains Gateway icon in the dock. It abruptly quits with no log messages.

I stopped the workspace, deleted JetBrains Gateway.app, downloaded JetBrains Gateway, deleted the workspace, recreated it, and it appears to be recovering correctly.

What did you expect to happen instead?
Provisioning has ansible-module like behavior: it would be recoverable from errors like these.

How can we reproduce the bug? (as minimally and precisely as possible)

  1. Create a JetBrains IDE based workspace.
  2. Click "Cancel" while the gateway is downloading the remote copy of the IDE.
  3. Observe the workspace is now irrecoverably broken.

Local Environment:

DevPod Provider:

Client Version: v1.28.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.7+k0s

Anything else we need to know?
I am shocked at how easy and straightforward everything was, including inferring the dev container for a vanilla Python project. This is like SkyPilot - once people understand the problem it solves they will choose it.

bkneis commented 1 week ago

Hey @doctorpangloss, I'm glad you like devpod and found it easy to get started with your python project. Can you tell me a bit more about what you want changed exactly? Looking through the code that installs / launches the IDE, I can't see how we will be able to control the OS behaviour or intilliJ behaviour. Once installing intilliJ I don't think we can control pop ups from another application. If there is anything specific we can do to help with this use case please let me know, otherwise I can't think of anything to update

doctorpangloss commented 1 week ago

If any one of those little steps fails, is there a better way to recover than recreating the workspace? Once I cancelled the popup, clicking run would not do anything. It just hung.

bkneis commented 1 week ago

@doctorpangloss Unfortunately I don't see a better way of handling this. When we launch the IDE we do not get status updates where we can define where the install left off. Not in a way that is generic across all the IDEs we support anyways. So I think the best we can do is to rebuild the workspace and perform a fresh set up to ensure the workspace is set up correctly. If the image has already been built this should not be a long process