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

[BUG] VS Code extensions are not installing #1350

Closed
kcpevey opened this issue Jun 28, 2022 · 15 comments · Fixed by #1360
Closed

[BUG] VS Code extensions are not installing #1350

kcpevey opened this issue Jun 28, 2022 · 15 comments · Fixed by #1360
Assignees
Labels
needs: investigation 🔍 Someone in the team needs to find the root cause and replicate this bug type: bug 🐛 Something isn't working

Comments

@kcpevey
Copy link
Contributor

kcpevey commented Jun 28, 2022

OS system and architecture in which you are running QHub

GCP

Expected behavior

  • VS Code extensions should be installable by users
  • python extension should be installed by default

Actual behavior

  • Trying to install an extension fails

How to Reproduce the problem?

  1. Attempt to install any extension from VS Code Extensions

Command output

[2022-06-28 10:07:41.756] [window] [info] [Service Worker] registered
[2022-06-28 10:07:41.892] [window] [error] ["Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'","    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919","    at async Promise.all (index 1)","    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)"]
[2022-06-28 10:07:41.982] [window] [error] ["Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'","    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919","    at async Promise.all (index 1)","    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)"]
[2022-06-28 10:07:42.257] [window] [error] Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions': Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'
    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919
    at async Promise.all (index 1)
    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)
[2022-06-28 10:07:45.763] [window] [error] ["Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'","    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919","    at async Promise.all (index 1)","    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)"]
[2022-06-28 10:07:45.945] [window] [error] ["Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'","    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919","    at async Promise.all (index 1)","    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)"]
[2022-06-28 10:07:46.001] [window] [error] ["Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'","    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919","    at async Promise.all (index 1)","    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)"]
[2022-06-28 10:07:46.030] [window] [error] Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions': Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'
    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919
    at async Promise.all (index 0)
    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)
[2022-06-28 10:08:07.310] [window] [error] ["Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'","    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919","    at async Promise.all (index 1)","    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)"]
[2022-06-28 10:08:09.031] [window] [error] ["Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'","    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919","    at async Promise.all (index 1)","    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)"]
[2022-06-28 10:08:16.412] [window] [error] ["Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'","    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919","    at async Promise.all (index 1)","    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)","    at async U.getAllDepsAndPackExtensionsToInstall (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:108:9171)","    at async U.installExtension (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:108:5108)","    at async U.installFromGallery (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:108:3035)"]
[2022-06-28 10:08:16.439] [window] [error] Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions': Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'
    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919
    at async Promise.all (index 1)
    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)
    at async U.getAllDepsAndPackExtensionsToInstall (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:108:9171)
    at async U.installExtension (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:108:5108)
    at async U.installFromGallery (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:108:3035)
[2022-06-28 10:08:16.526] [window] [error] Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions': Internal: Unable to resolve nonexistent file '/opt/conda/envs/default/share/code-server/extensions'
    at /opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:78919
    at async Promise.all (index 1)
    at async i.scanExtensions (/opt/conda/envs/default/share/code-server/lib/vscode/out/vs/server/node/server.main.js:146:79033)
  • /opt/conda/envs/default/share/code-server/extensions doesn't exist.
  • /opt/conda/envs/default/share/code-server/ exists, but my user doesn't have permission to create a new folder herer


### Versions and dependencies used.

_No response_

### Compute environment

GCP

### Integrations

_No response_

### Anything else?

Something may have changed recently because I think extensions used to be stored in `~/.local/share/code-server/extensions`
@kcpevey kcpevey added the type: bug 🐛 Something isn't working label Jun 28, 2022
@viniciusdc
Copy link
Contributor

viniciusdc commented Jun 28, 2022

I think this can be achived by seting VSCODE_EXTENSIONS env variable in the user space, and point that to /home/<user>/.local/code-server/extensions)

@trallard trallard added the needs: investigation 🔍 Someone in the team needs to find the root cause and replicate this bug label Jun 30, 2022
@trallard
Copy link
Member

  1. @kcpevey to try setting the VSCode extension env variable
  2. @viniciusdc will look into a fix as well

@kcpevey
Copy link
Contributor Author

kcpevey commented Jun 30, 2022

This directory does not exist: /home/[email protected]/.local/code-server

@viniciusdc
Copy link
Contributor

Hi, @kcpevey I will open a PR to try adding the env and creating the directory... were you able to test the environment in your namespace?

@kcpevey
Copy link
Contributor Author

kcpevey commented Jul 4, 2022

As far as I can tell, there is no way for me to access setting an env var in the shell where vscode is launched. I don't have permissions to edit .bashrc or .profile.

I can set an env var in a terminal, but that won't be the context from which vs code is launched.

Is there some other way to get into the context from which its launched? Actually, I don't even know where its launched from...

@viniciusdc
Copy link
Contributor

viniciusdc commented Jul 4, 2022

Ok, so the issue is that the current way we are installing the vscode server into qhub, uses a post-build installation process during build on conda-forge (which is responsible for setting the installation path to be the same path as conda shared dir).

This will need to be moved to a future release as a proper fix will require us to re-think the installation process for the server and drop the conda package for more granularity control

@kcpevey
Copy link
Contributor Author

kcpevey commented Jul 5, 2022

Is there a workaround? This is a huge issue if users can't use vscode (the python extension isn't installed so we can't use the IDE to run/debug python)

@dharhas
Copy link
Member

dharhas commented Jul 5, 2022

You can change the location by launching VS Code with the --extensions-dir

command-line option. Some other ways are discussed here.

@dharhas
Copy link
Member

dharhas commented Jul 5, 2022

The default location for linux is supposed to be ~/.vscode/extensions

we might want to explicitely set both of the following:

--extensions-dir=
--user-data-dir=

@viniciusdc
Copy link
Contributor

We can't pass the --extensions-dir to it because it's already set during build in here

@viniciusdc
Copy link
Contributor

viniciusdc commented Jul 5, 2022

We can roll back to how it was implemented before as a quick shortcut (at least we know that it worked)

@trallard
Copy link
Member

trallard commented Jul 5, 2022

Agreed - to rollback to the previous implementation @viniciusdc and @costrouc please work on this

@viniciusdc
Copy link
Contributor

Just met with @costrouc, I will soon submit a PR to fix this.

@dharhas
Copy link
Member

dharhas commented Jul 5, 2022

@viniciusdc can we also open an issue on the conda-forge feedstock about this to start a discussion assuming long term we want to use the conda-package.

@viniciusdc
Copy link
Contributor

@viniciusdc can we also open an issue on the conda-forge feedstock about this to start a discussion assuming long term we want to use the conda-package.

Hi, @dharhas I've done that already (see here), but I think that will take a while to get answered, I talked a bit with Chris this afternoon and we found a way to overlook that setting. For now, we will switch back to how we used to install code-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: investigation 🔍 Someone in the team needs to find the root cause and replicate this bug type: bug 🐛 Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

5 participants