From cf24372405946f58324098960becd321b22e118c Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Fri, 14 Feb 2020 08:36:01 -0800 Subject: [PATCH 1/5] More logging for kernelspec problems --- src/client/datascience/jupyter/interpreter/jupyterCommand.ts | 1 + .../interpreter/jupyterInterpreterDependencyService.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/datascience/jupyter/interpreter/jupyterCommand.ts b/src/client/datascience/jupyter/interpreter/jupyterCommand.ts index 567fefe25218..7e701dbabfcd 100644 --- a/src/client/datascience/jupyter/interpreter/jupyterCommand.ts +++ b/src/client/datascience/jupyter/interpreter/jupyterCommand.ts @@ -224,6 +224,7 @@ export class InterpreterJupyterKernelSpecCommand extends InterpreterJupyterComma const defaultAction = () => { if (exception) { + traceError(`Exception attempting to enumerate kernelspecs: `, exception); throw exception; } return output; diff --git a/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts b/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts index d229ac181f7f..d89cd5416dc3 100644 --- a/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts +++ b/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts @@ -8,6 +8,7 @@ import { CancellationToken } from 'vscode'; import { IApplicationShell } from '../../../common/application/types'; import { Cancellation, createPromiseFromCancellation, wrapCancellationTokens } from '../../../common/cancellation'; import { ProductNames } from '../../../common/installer/productNames'; +import { traceError } from '../../../common/logger'; import { IInstaller, InstallerResponse, Product } from '../../../common/types'; import { Common, DataScience } from '../../../common/utils/localize'; import { noop } from '../../../common/utils/misc'; @@ -302,7 +303,8 @@ export class JupyterInterpreterDependencyService { return command .exec(['--version'], { throwOnStdErr: true }) .then(() => true) - .catch(() => { + .catch(e => { + traceError(`Kernel spec not found: `, e); sendTelemetryEvent(Telemetry.KernelSpecNotFound); return false; }); From 7dae94f21c0ec0730e563fbc03cd4f79175ce2b4 Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Fri, 14 Feb 2020 08:44:15 -0800 Subject: [PATCH 2/5] Actually capture the exception on the new code --- src/client/datascience/jupyter/interpreter/jupyterCommand.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/datascience/jupyter/interpreter/jupyterCommand.ts b/src/client/datascience/jupyter/interpreter/jupyterCommand.ts index 7e701dbabfcd..a3ef34379608 100644 --- a/src/client/datascience/jupyter/interpreter/jupyterCommand.ts +++ b/src/client/datascience/jupyter/interpreter/jupyterCommand.ts @@ -244,10 +244,10 @@ export class InterpreterJupyterKernelSpecCommand extends InterpreterJupyterComma try { if (args.join(' ').toLowerCase() === 'list --json') { // Try getting kernels using python script, if that fails (even if there's output in stderr) rethrow original exception. - return this.getKernelSpecList(interpreter, options); + output = await this.getKernelSpecList(interpreter, options); } else if (args.join(' ').toLowerCase() === '--version') { // Try getting kernelspec version using python script, if that fails (even if there's output in stderr) rethrow original exception. - return this.getKernelSpecVersion(interpreter, options); + output = await this.getKernelSpecVersion(interpreter, options); } } catch (innerEx) { traceError('Failed to get a list of the kernelspec using python script', innerEx); From 0d1d23afb0cbe3430b115919fe97dbe6b7f1f5bd Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Fri, 14 Feb 2020 08:45:23 -0800 Subject: [PATCH 3/5] Not actually using output if first exception still there. --- src/client/datascience/jupyter/interpreter/jupyterCommand.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/datascience/jupyter/interpreter/jupyterCommand.ts b/src/client/datascience/jupyter/interpreter/jupyterCommand.ts index a3ef34379608..3849124382f6 100644 --- a/src/client/datascience/jupyter/interpreter/jupyterCommand.ts +++ b/src/client/datascience/jupyter/interpreter/jupyterCommand.ts @@ -249,6 +249,7 @@ export class InterpreterJupyterKernelSpecCommand extends InterpreterJupyterComma // Try getting kernelspec version using python script, if that fails (even if there's output in stderr) rethrow original exception. output = await this.getKernelSpecVersion(interpreter, options); } + return output; } catch (innerEx) { traceError('Failed to get a list of the kernelspec using python script', innerEx); } From c4fb9d6ce676ed1add225d7fda6b5f32abc31617 Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Fri, 14 Feb 2020 08:54:46 -0800 Subject: [PATCH 4/5] Actually only return output on one of the expected calls. --- src/client/datascience/jupyter/interpreter/jupyterCommand.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/datascience/jupyter/interpreter/jupyterCommand.ts b/src/client/datascience/jupyter/interpreter/jupyterCommand.ts index 3849124382f6..49e5a970bd82 100644 --- a/src/client/datascience/jupyter/interpreter/jupyterCommand.ts +++ b/src/client/datascience/jupyter/interpreter/jupyterCommand.ts @@ -245,11 +245,12 @@ export class InterpreterJupyterKernelSpecCommand extends InterpreterJupyterComma if (args.join(' ').toLowerCase() === 'list --json') { // Try getting kernels using python script, if that fails (even if there's output in stderr) rethrow original exception. output = await this.getKernelSpecList(interpreter, options); + return output; } else if (args.join(' ').toLowerCase() === '--version') { // Try getting kernelspec version using python script, if that fails (even if there's output in stderr) rethrow original exception. output = await this.getKernelSpecVersion(interpreter, options); + return output; } - return output; } catch (innerEx) { traceError('Failed to get a list of the kernelspec using python script', innerEx); } From 529429c02be559ae914ccfb8d3387d704d551ddf Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Fri, 14 Feb 2020 10:23:03 -0800 Subject: [PATCH 5/5] Fix nightly flake --- src/test/datascience/variableexplorer.functional.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/datascience/variableexplorer.functional.test.tsx b/src/test/datascience/variableexplorer.functional.test.tsx index bf0e2a8d8f54..f8b1e4e6cd5e 100644 --- a/src/test/datascience/variableexplorer.functional.test.tsx +++ b/src/test/datascience/variableexplorer.functional.test.tsx @@ -301,7 +301,7 @@ myDict = {'a': 1}`; { name: 'mySet', value: undefined, - supportsDataExplorer: true, + supportsDataExplorer: false, type: 'set', size: 54, shape: '',