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

Attempt to handle pixi error more gracefully #23937

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

anthonykim1
Copy link

@anthonykim1 anthonykim1 commented Aug 12, 2024

For: #23911 and #23906

(For virtual/remote scenario) Locating pixi environment, regardless of presence of pixi environment, is leading to crash. Hoping to address this and handle errors more gracefully so program does not terminate.

/cc @baszalmstra

@anthonykim1 anthonykim1 self-assigned this Aug 12, 2024
@anthonykim1 anthonykim1 added bug Issue identified by VS Code Team member as probable bug area-environments Features relating to handling interpreter environments labels Aug 12, 2024
@anthonykim1 anthonykim1 added this to the August 2024 milestone Aug 12, 2024
@anthonykim1 anthonykim1 added the skip tests Updates to tests unnecessary label Aug 12, 2024
@anthonykim1 anthonykim1 marked this pull request as ready for review August 12, 2024 17:53
@anthonykim1 anthonykim1 merged commit f417024 into microsoft:main Aug 12, 2024
41 of 42 checks passed
@karthiknadig karthiknadig mentioned this pull request Aug 16, 2024
anthonykim1 added a commit that referenced this pull request Aug 20, 2024
In addition to first PR
#23937

I've been able to repro aggressive errors of 
```
2024-08-12 13:59:21.087 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
```

```
2024-08-12 13:59:20.794 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/anthonykim/Desktop/vscode-python/.pixi/envs'
	at Object.readdirSync (node:fs:1509:26)
	at t.readdirSync (node:electron/js2c/node_init:2:11418)
	at /Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:583006
	at /Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:583197
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:582915)
	at async d.ensureWatchersReady (/Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:539326)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/anthonykim/Desktop/vscode-python/.pixi/envs'
}
```

even when I dont have pixi in my workspace. Changing the log level on
this and adding more wraps around that should give necessary
hint/message when needed without crashing program.

---------

Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
anthonykim1 added a commit to anthonykim1/vscode-python that referenced this pull request Sep 13, 2024
In addition to first PR
microsoft#23937

I've been able to repro aggressive errors of 
```
2024-08-12 13:59:21.087 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
```

```
2024-08-12 13:59:20.794 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/anthonykim/Desktop/vscode-python/.pixi/envs'
	at Object.readdirSync (node:fs:1509:26)
	at t.readdirSync (node:electron/js2c/node_init:2:11418)
	at /Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:583006
	at /Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:583197
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:582915)
	at async d.ensureWatchersReady (/Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:539326)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/anthonykim/Desktop/vscode-python/.pixi/envs'
}
```

even when I dont have pixi in my workspace. Changing the log level on
this and adding more wraps around that should give necessary
hint/message when needed without crashing program.

---------

Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug skip tests Updates to tests unnecessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants