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

Snap: Built-in devcontainer CLI path uses old version #5629

Open
Clockwork-Muse opened this issue Sep 23, 2021 · 3 comments
Open

Snap: Built-in devcontainer CLI path uses old version #5629

Clockwork-Muse opened this issue Sep 23, 2021 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers

Comments

@Clockwork-Muse
Copy link

  • VSCode Version: 1.60.2: 7f6ab5485bbc008386c4386d08766667e155244e
  • Local OS Version: Ubuntu 20.04
  • Remote Extension/Connection Type: N/A

Steps to Reproduce:

  1. Install remote extension pack
  2. Verify the path has a snap package version in the saved path. File paths include
  • ~/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin/vscode-path
  • ~/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin/vscode-app-root

When VSCode is installed as a snap, there are two paths: A versioned path (such as /snap/code/75/usr/share/code/code) and "current" path (/snap/code/current/usr/share/code/code) which is symlinked to a versioned path. The problem is that the remote container extension seems to capture the versioned path, which eventually disappears as snap updates VSCode (snap seems to keep the current and one previous release by default). These paths are used for - at minimum - driving the devcontainer cli, which means that after snap updates a mismatched version of the cli may be used (or simply no longer exist, which is how I discovered this).

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Sep 23, 2021
@chrmarti chrmarti self-assigned this Sep 27, 2021
@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Sep 27, 2021
@chrmarti chrmarti changed the title devcontainer cli path uses old version when code installed as a snap Snap: Built-in devcontainer CLI path uses old version Dec 13, 2022
@StefanBrand
Copy link

StefanBrand commented Feb 2, 2024

Is there a workaround? I've tried to replace 147 by current in the above files. This does nothing here.

Running which code > ~/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin/vscode-path does something, but only opens code normally, without starting the devcontainer.

PS.: which code points to /snap/bin/code here.

@losnappas
Copy link

@StefanBrand your editor possibly added a newline at the end of the file while you did that, which breaks it.

Doing $ echo -n '/snap/code/current/usr/share/code/code' > vscode-path ; echo -n '/snap/code/current/usr/share/code/resources/app' > vscode-app-root fixed it for me.

@i-ky
Copy link

i-ky commented Jun 20, 2024

Doing $ echo -n '/snap/code/current/usr/share/code/code' > vscode-path ; echo -n '/snap/code/current/usr/share/code/resources/app' > vscode-app-root fixed it for me.

Thank you, this worked for me!

Let me just make paths absolute and reformat it so it is easier to copy-paste:

echo -n '/snap/code/current/usr/share/code/code' > ~/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin/vscode-path
echo -n '/snap/code/current/usr/share/code/resources/app' > ~/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin/vscode-app-root

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 containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

5 participants