Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vscode hangs if an unbuilt local workspace extension is installed #212105

Closed
Tracked by #212907
AndrewNolte opened this issue May 6, 2024 · 10 comments · Fixed by #212693
Closed
Tracked by #212907

Vscode hangs if an unbuilt local workspace extension is installed #212105

AndrewNolte opened this issue May 6, 2024 · 10 comments · Fixed by #212693
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions insiders-released Patch has been released in VS Code Insiders
Milestone

Comments

@AndrewNolte
Copy link

AndrewNolte commented May 6, 2024

Steps to reproduce:

  1. Open vscode over ssh
  2. Make a fresh clone of this repo (or git clean -fdx to remove the node_modules/ from the local workspace extension, and uninstall it if installed)
  3. Install the vscode-selfhost-test-provider local workspace extension
  4. Reload window, it should hang

When doing this locally, I get Cannot activate, becase ./out/extension.js not found. It's not clear from the docs that the extension needs to be built. However over ssh it gets vscode into a bad state.

Proposals:

@sandy081
Copy link
Member

sandy081 commented May 7, 2024

It is unclear and confusing to me what you are asking for. Summary and Description are not matching.
Summary says VS Code is unusable and I do not see anything related to that in the description.

@sandy081 sandy081 added the info-needed Issue requires more information from poster label May 7, 2024
@AndrewNolte AndrewNolte changed the title Vscode is unusable if an unbuilt local workspace extension is installed Vscode hangs if an unbuilt local workspace extension is installed May 7, 2024
@AndrewNolte
Copy link
Author

Updated the issue! Sorry I was trying to be concise. After the reload is when it happens. And I did a bit more testing, this only happens over ssh. I was able to install a local extension over ssh when it was built though, so this only happens when it's not built

@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions and removed info-needed Issue requires more information from poster labels May 8, 2024
@sandy081 sandy081 added this to the May 2024 milestone May 8, 2024
@pcasdf
Copy link

pcasdf commented May 8, 2024

Updated the issue! Sorry I was trying to be concise. After the reload is when it happens. And I did a bit more testing, this only happens over ssh. I was able to install a local extension over ssh when it was built though, so this only happens when it's not built

Do you mean that if the extension's .vsix is in the extension dir, then the workspace will load?

A bunch of devs at my company ran into this too and our code-workspace got into a broken state. We have a few custom extensions in the .vscode/ directory at the root of our monorepo, and I moved them to .vscode/extensions, but it's just the source code and no .vsix. Although https://code.visualstudio.com/updates/v1_88#_local-workspace-extensions implies that this feature is opt-in, on Insiders only, with the extensions.experimental.supportWorkspaceExtensions config, none of which are true for us, we were still prompted to install workspace extensions. After doing so and reloading the extension host, the workspace never loads over SSH. Even after reverting the change and restoring the extensions back to their original location, e.g. .vscode/hello-world-extension, and removing the .vscode/extensions dir, the workspace still wouldn't load. I discovered that I had to rm -rf ~/Library/Application\ Support/Code/CachedConfigurations locally in order to be able to load the workspace again.

@AndrewNolte
Copy link
Author

No I never made a vsix, just the compiled out/ dir needs to be there for local workspace extensions. It doesn't rely on a vsix at all, but I wish it had the option for it since not every repo has a node build system as part of its normal setup

@AndrewNolte
Copy link
Author

Also @pcasdf, it's no longer insiders only https://code.visualstudio.com/updates/v1_89#_local-workspace-extensions

@pcasdf
Copy link

pcasdf commented May 8, 2024

Also @pcasdf, it's no longer insiders only https://code.visualstudio.com/updates/v1_89#_local-workspace-extensions

Oops, I need to read the release notes more carefully 😇 well that's unfortunate since it doesn't seem ready to be on stable.

sandy081 added a commit that referenced this issue May 14, 2024
@sandy081
Copy link
Member

Thanks for filing the issue and sharing your feedback. This is a bug in remote set up which I fixed it.

Thanks.

@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label May 14, 2024
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 15, 2024
@NoReasonKen
Copy link

NoReasonKen commented May 16, 2024

Is there a workaround to fix this issue by myself ? I cannot access server with remote-ssh now.

I deleted the .vscode/extensions folder under my workspace, yet the issue still remain.

I suppose there shall be a way to delete the installed workspace extensions by myself to prevent the issue hang remote server ?

@AndrewNolte
Copy link
Author

Same, I tried running rm -rf ~/Library/Application\ Support/Code/CachedConfigurations locally like @pcasdf mentioned, but mine still hangs

@NoReasonKen
Copy link

NoReasonKen commented May 17, 2024

I have fixed this.

  1. Search the .vscdb file of the remote-ssh session in local.
    For example: I connect to remote from windows, and vscode store files under %appdata%\Code\User\workspaceStorage. There are many hashed name folder, you can connect remote-ssh session (of course, hanging) and close, then the most recent modified folder shall be the target. Remember check the workspace.json in the folder to ensure that.
  2. Use any sqlitebrowser open the .vscdb file, and filter key with "workspaceExtension", there should a nearly matched record and it's value is those workspace extensions you installed.
    Sorry I have delete the record hence cannot remember the exact key name.
    Remember to close any vscode connection to the remote before opening the db file, vscode will cache one while connecting remote, so any modifications to db files is useless if any connection to the target remote exists.
  3. Remove the record and commit your change to db file, re-connect to remote and it should no longer hang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions insiders-released Patch has been released in VS Code Insiders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants