Closed InLaw closed 3 years ago
I ran into this as well.
- system: `"x86_64-darwin"`
- host os: `Darwin 19.2.0, macOS 10.15.2`
- multi-user?: `no`
- sandbox: `no`
- version: `nix-env (Nix) 2.3.2`
- channels(maximiliantagher): `"nixpkgs-20.03pre207249.7e8454fb856"`
- nixpkgs: `/Users/maximiliantagher/.nix-defexpr/channels/nixpkgs`
Version: 1.49.1
Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf
Date: 2020-09-16T23:21:17.533Z (1 wk ago)
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.2.0
One person I was helping troubleshoot a similar issue resolved it by first opening a workspace (i.e. folder) in VSCode, then trying to select a Nix environment.
I's expected behavior. The extension can't work if there no workspace.
Sorry, I'm getting this same bug and I'm in a workspace. This only started happening today after I updated from 0.1.2 to 1.0.2. Any idea what might be the problem?
Also, if I downgrade to 0.1.2 I get a different problem:
Command failed: nix-shell /Users/hjones/programming/citizennet/orders/default.nix --run env /bin/sh: nix-shell: command not found
Though that seems to be related to https://github.com/arrterian/nix-env-selector/issues/38
FWIW, I was able to work around this by installing the rubymaniac.vscode-direnv
Extension, downgrading this extension to 0.1.2, reload everything, then uninstall rubymaniac.vscode-direnv
. Something is definitely amiss, but I've no clue what.
@joneshf-cn I have couple of questions that can help me figure it out
- Does the error appears when you has already selected nix file in your config and want to select new one or only for blank config? (Or both?)
Both.
- Will the error still appear if you will wait for a minute before running the command?
Yes.
I just installed this extension, got an automatic detection picker, selected my shell.nix. Then nothing happened, I read the readme stating "restart vscode". I tried by just reloading. Still nothing, so I tried the command and now it always gives me:
Can you guys share the installed extensions list? Maybe there is some conflict. I should reproduce the bug in my system to be able to fix it.
@hedefalk what OS do you use?
@hedefalk what OS do you use?
MacOS
I have the same error. Used to work a week ago. My setup: VS Code running in windows, remoting to nixos via SSH.
Not letting me select a environment, folder with shell.nix
is open (the same way it was before). I've tried downgrading the extension - the same issue. I take the regression is after VSCode update and not the extension update. Downgrading to 0.1.2 works.
My remote env:
- system: `"x86_64-linux"`
- host os: `Linux 5.11.0, NixOS, 21.05pre272380.f6b5bfdb470 (Okapi)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.10`
- channels(andoriyu): `"home-manager"`
- channels(root): `"nixos-21.05pre274338.102eb68ceec"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
VSCode version: 1.54.1
@andoriyu Do you still get the error on v1.0.4
?
@andoriyu Do you still get the error on
v1.0.4
?
Somehow 20 minutes later it started working on 1.0.4.
I chose a flake.nix
file and the extension seem stuck with it, not allowing to change (displaying the same error as OP). The developer tools show the following:
abstractExtensionService.ts:718 Activating extension 'arrterian.nix-env-selector' failed: Command failed: nix-shell "/Users/.../flake.nix" --run export
error: --- UsageError --- nix-shell
nix-shell requires a single derivation
Try 'nix-shell --help' for more information.
.
_logMessageInConsole @ abstractExtensionService.ts:718
localProcessExtensionHost.ts:265 Extension Host
localProcessExtensionHost.ts:266 error: --- UsageError --- nix-shellnix-shell requires a single derivationTry 'nix-shell --help' for more information.
Maybe you could make the current chosen environment accessible in the extension settings? USers could then switch manually and maybe workaround the error?
Since the extension is stuck on my flake.nix
file, I've been modifying it and I now run into this error:
Activating extension 'arrterian.nix-env-selector' failed: Command failed: nix-shell "/Users/../my_repo/flake.nix" --run export
warning: Git tree '/Users/...my_repo' is dirty
.
_logMessageInConsole @ abstractExtensionService.ts:718
_logOrShowMessage @ abstractExtensionService.ts:732
$onExtensionActivationError @ mainThreadExtensionService.ts:64
_doInvokeHandler @ rpcProtocol.ts:417
_invokeHandler @ rpcProtocol.ts:402
_receiveRequest @ rpcProtocol.ts:318
_receiveOneMessage @ rpcProtocol.ts:245
(anonymous) @ rpcProtocol.ts:110
fire @ event.ts:622
fire @ ipc.net.ts:468
_receiveMessage @ ipc.net.ts:821
(anonymous) @ ipc.net.ts:660
fire @ event.ts:622
acceptChunk @ ipc.net.ts:241
(anonymous) @ ipc.net.ts:202
I @ ipc.net.ts:32
emit @ events.js:315
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:271
Readable.push @ _stream_readable.js:212
onStreamRead @ internal/stream_base_commons.js:186
localProcessExtensionHost.ts:265 Extension Host
localProcessExtensionHost.ts:266 warning: Git tree '/Users/../my_repo' is dirty
Then when trying to select the nix shell:
notificationsAlerts.ts:40 Command 'Nix-Env: Select environment' resulted in an error (command 'nixEnvSelector.selectEnv' not found)
Maybe warnings make the extension loading fail and results in the selectEnv
to not exist?
@jmatsushita seems that I know what is wrong now. It because unproper error handling for sync operation on extension load. Thanks a lot for your comment. I think I will fix it when will have I time soon.
@jmatsushita @InLaw added proper error handling. The problem should disappear in v1.0.6
@arrterian thanks, in my case it is working
Same here @arrterian it works. Thanks a ton!
1.0.6 also seemed to fix it for me. Thanks!
I just experienced this on a remote linux host on 1.0.7, then downgraded to 1.0.6 and it's working. EDIT: 1.0.6 worked for a remote-over-SSH situation but is failing locally. Problem seems to have come up starting from the recent 1.62.1 VS Code release (continuing on 1.62.2). If there's some info that would help pinpoint the issue please let me know.
If it helps, I also got success downgrading to 0.1.2. Then right away the chemical flask appears in the status bar and when I invoke the selectEnv it works. The chemical flask NEVER appears on the status bar in 1.0.6+. So maybe still a startup sequence error.
Hello it is back as well on my (new) setup,
Any idea to fix this?
continuous on 22.11:
Version: 1.73.1 Commit: 6261075646f055b99068d3688932416f2346dd3b Date: 2022-11-09T03:54:53.913Z Electron: 19.0.17 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Linux x64 5.15.86 Sandboxed: No
"x86_64-linux"
Linux 5.15.86, NixOS, 22.11 (Raccoon), 22.11.1611.a83ed85c14f
yes
yes
nix-env (Nix) 2.11.1
"nixos-22.11, nixos-hardware"
/nix/var/nix/profiles/per-user/root/channels/nixos
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Command 'Nix-Env: Select environment' resulted in an error (command 'extension.selectEnv' not found)
Expected behavior show .nix files in from the folder
Screenshots If applicable, add screenshots to help explain your problem.
Environment: nix-shell -p nix-info --run "nix-info -m"
Additional context