Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted. #909

Closed
DonJayamanne opened this issue Apr 8, 2019 · 11 comments
Assignees
Milestone

Comments

@DonJayamanne
Copy link

@chrisgix commented on Fri Apr 05 2019

  • VS Code version: 1.33.0
  • Extension version: 2019.3.6352
  • OS and version: Ubuntu 18.10, Kernel: 4.18.0-17-generic
  • Python version: 3.6.7

Expected behaviour

Python file opened, server starts with no crashes. Intellisense works properly

Actual behaviour

Python file opened. Python tools server crashes 5 times within 3 minutes and is not restarted anymore. Intellisense does not work

Steps to reproduce:

  1. Open python file with python extension installed

Logs

Starting Microsoft Python language server.
[Info - 1:42:18 PM] GetCurrentSearchPaths /usr/bin/python3
[Info - 1:42:18 PM] Python search paths:
[Info - 1:42:18 PM] /usr/lib/python3.6
[Info - 1:42:18 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:18 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:18 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:18 PM] /usr/lib/python3/dist-packages
[Info - 1:42:18 PM] Configuration search paths:
[Info - 1:42:18 PM] /usr/lib/python36.zip
[Info - 1:42:18 PM] /usr/lib/python3.6
[Info - 1:42:18 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:18 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:18 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:18 PM] /usr/lib/python3/dist-packages
[Info - 1:42:18 PM] /usr/bin
[Info - 1:42:19 PM] Microsoft Python Language Server version 0.2.43.0
[Info - 1:42:19 PM] Initializing for /usr/bin/python3

Unhandled Exception: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.b__22_0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ThreadPoolWorkQueue.Dispatch()
[Info - 1:42:20 PM] Connection to server got closed. Server will restart.
##########Linting Output - pylint##########


Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

[Info - 1:42:21 PM] GetCurrentSearchPaths /usr/bin/python3
[Info - 1:42:21 PM] Python search paths:
[Info - 1:42:21 PM] /usr/lib/python3.6
[Info - 1:42:21 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:21 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:21 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:21 PM] /usr/lib/python3/dist-packages
[Info - 1:42:21 PM] Configuration search paths:
[Info - 1:42:21 PM] /usr/lib/python36.zip
[Info - 1:42:21 PM] /usr/lib/python3.6
[Info - 1:42:21 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:21 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:21 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:21 PM] /usr/lib/python3/dist-packages
[Info - 1:42:21 PM] /usr/bin
[Info - 1:42:22 PM] Microsoft Python Language Server version 0.2.43.0
[Info - 1:42:22 PM] Initializing for /usr/bin/python3

Unhandled Exception: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.b__22_0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ThreadPoolWorkQueue.Dispatch()
[Info - 1:42:22 PM] Connection to server got closed. Server will restart.
[Info - 1:42:23 PM] GetCurrentSearchPaths /usr/bin/python3
[Info - 1:42:23 PM] Python search paths:
[Info - 1:42:23 PM] /usr/lib/python3.6
[Info - 1:42:23 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:23 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:23 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:23 PM] /usr/lib/python3/dist-packages
[Info - 1:42:23 PM] Configuration search paths:
[Info - 1:42:23 PM] /usr/lib/python36.zip
[Info - 1:42:23 PM] /usr/lib/python3.6
[Info - 1:42:23 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:23 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:23 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:23 PM] /usr/lib/python3/dist-packages
[Info - 1:42:23 PM] /usr/bin
[Info - 1:42:24 PM] Microsoft Python Language Server version 0.2.43.0
[Info - 1:42:24 PM] Initializing for /usr/bin/python3

Unhandled Exception: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.b__22_0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ThreadPoolWorkQueue.Dispatch()
[Info - 1:42:25 PM] Connection to server got closed. Server will restart.
[Info - 1:42:26 PM] GetCurrentSearchPaths /usr/bin/python3
[Info - 1:42:26 PM] Python search paths:
[Info - 1:42:26 PM] /usr/lib/python3.6
[Info - 1:42:26 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:26 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:26 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:26 PM] /usr/lib/python3/dist-packages
[Info - 1:42:26 PM] Configuration search paths:
[Info - 1:42:26 PM] /usr/lib/python36.zip
[Info - 1:42:26 PM] /usr/lib/python3.6
[Info - 1:42:26 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:26 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:26 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:26 PM] /usr/lib/python3/dist-packages
[Info - 1:42:26 PM] /usr/bin
[Info - 1:42:26 PM] Microsoft Python Language Server version 0.2.43.0
[Info - 1:42:26 PM] Initializing for /usr/bin/python3

Unhandled Exception: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.b__22_0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ThreadPoolWorkQueue.Dispatch()
[Info - 1:42:27 PM] Connection to server got closed. Server will restart.
[Info - 1:42:28 PM] GetCurrentSearchPaths /usr/bin/python3
[Info - 1:42:28 PM] Python search paths:
[Info - 1:42:28 PM] /usr/lib/python3.6
[Info - 1:42:28 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:28 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:28 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:28 PM] /usr/lib/python3/dist-packages
[Info - 1:42:28 PM] Configuration search paths:
[Info - 1:42:28 PM] /usr/lib/python36.zip
[Info - 1:42:28 PM] /usr/lib/python3.6
[Info - 1:42:28 PM] /usr/lib/python3.6/lib-dynload
[Info - 1:42:28 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 1:42:28 PM] /usr/local/lib/python3.6/dist-packages
[Info - 1:42:28 PM] /usr/lib/python3/dist-packages
[Info - 1:42:28 PM] /usr/bin
[Info - 1:42:29 PM] Microsoft Python Language Server version 0.2.43.0
[Info - 1:42:29 PM] Initializing for /usr/bin/python3

Unhandled Exception: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.b__22_0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ThreadPoolWorkQueue.Dispatch()
[Error - 1:42:29 PM] Connection to server got closed. Server will not be restarted.
##########Linting Output - pylint##########


Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

extensionHost.ts:311 [Extension Host] debugger listening on port 51568
extensionService.ts:802 Couldn't find message for key python.snippet.launch.unitTests.description.
_logMessageInConsole @ extensionService.ts:802
console.ts:134 [Extension Host] (node:7205) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:134
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */python
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Class name = f, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix/compile.py>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Class name = h, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix/compile.py>, Return Value: <Return value cannot be serialized for logging>
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python3.7 and args  failed
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown","displayName":"Python 3.6.7 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Interpreters returned by CondaEnvFileService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by PipEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by CondaEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by VirtualEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by WorkspaceVirtualEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Interpreters returned by KnownPathsService are of count 10
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}, Arg 2: <argument cannot be serialized for logging>, Return Value: true
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = exit
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking support of .NET, Class name = u, , Return Value: true
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix
console.ts:134 [Extension Host] Python Extension: Rule = windowsRegistry, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from windowsRegistry
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Interpreters returned by CurrentPathService are of count 5
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: true
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from currentPath, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown","displayName":"Python 3.6.7 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Get language server folder name, Class name = g, , Return Value: "languageServer.0.2.43"
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from system, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown","displayName":"Python 3.6.7 64-bit"}
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: Rule = currentPath, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from currentPath
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from cachedInterpreters
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Get language server folder name, Class name = g, , Return Value: "languageServer.0.2.43"
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix/compile.py
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown","displayName":"Python 3.6.7 64-bit"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: Rule = system, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from system
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/chris/Documents/CalPoly/CSC-476/lab-1-crgix>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: Get language server folder name, Class name = g, , Return Value: "languageServer.0.2.43"
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix/compile.py
console.ts:134 [Extension Host] Python Extension: Starting Language Server, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking support of .NET, Class name = u, , Return Value: true
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix/compile.py
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown","displayName":"Python 3.6.7 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}, Arg 2: <argument cannot be serialized for logging>, Return Value: true
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = exit
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Rule = windowsRegistry, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from windowsRegistry
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from currentPath, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */python
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Class name = f, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Class name = h, Arg 1: undefined, Return Value: <Return value cannot be serialized for logging>
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from system, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown","displayName":"Python 3.6.7 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown","displayName":"Python 3.6.7 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown","displayName":"Python 3.6.7 64-bit"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.7-final","major":3,"minor":6,"patch":7,"prerelease":["final"],"build":[],"version":"3.6.7-final"},"sysPrefix":"/usr","fileHash":"a58b0a2cdf3cb97ff7652e48a97fcd4a9afe0bfbbb4aaa6c4b547696792415d0bff37a1f11de23ebda15028aa400ee2ebba6a8e5faaca486f1d245bced17782c","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: Rule = currentPath, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from currentPath
console.ts:134 [Extension Host] Python Extension: Rule = system, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from system
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from cachedInterpreters
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Current value for rule workspaceEnvs is nothing
console.ts:134 [Extension Host] Python Extension: Interpreters returned by PipEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Interpreters returned by WorkspaceVirtualEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: true
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, Class name = p, , Return Value: undefined
notificationsAlerts.ts:40 The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted.
onDidNotificationChange @ notificationsAlerts.ts:40
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, extension-output-#3
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix/compile.py
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/chris/Documents/CalPoly/CSC-476/lab-1-crgix

@chrisgix commented on Sun Apr 07 2019

I was able to find the cause of the error. I discovered that it only happened in a certain project I had, so I went through and tried deleting files to see if they were the cause. And I ended up deleting the content of my python file, and then the server would start. This is the entirety of the file.

`print("section .text")
print("global our_code_starts_here")
print("our_code_starts_here:")

myFile = open('input.txt', 'r')

line = myFile.readline()

myList = line.split(" ")

num1 = myList[0]

if (len(myList) == 1):
print(" mov eax, " + num1)
print (" ret")
else:
num2 = myList[2]
print(" mov eax, " + num1)
print(" mov ebx, " + num2)
print(" add eax, ebx")
print(" ret")`

This somehow causes the server to crash

Edit: It is this line in particular that is causing it. (I went through one by one uncommenting to find the bad line)

myFile = open('input.txt', 'r')

@jakebailey
Copy link
Member

@chrisgix Can you update to the latest build, currently 0.2.47? microsoft/vscode-python#3977

@yozlet
Copy link

yozlet commented Apr 8, 2019

I'm also getting this (same exception), and I'm on 0.2.47, using Python 3.6.8 on MacOS.

UPDATE: I tried closing files and windows, then reopening, and haven't been able to repro. It's possible that I haven't yet reopened the file that caused the problem, though. Will keep at it and let you know if it reappears. I'm also hitting this Code Helper problem - is it possible that the high CPU/memory usage of that bug made this one more likely?

@chloyster
Copy link

@jakebailey I am still getting the error. Also in addition to @yozlet getting the bug on Mac, I was able to reproduce it on a friend's mac as well. They have MacOS High Sierra 10.13.6 with Python 3.7.3, Extension version 2019.3.6352 and server updated to 0.2.47. However on theirs it gave the error a couple times and eventually worked before giving up. Here is the output from my most recent attempt on Ubuntu. It looks the same as before.

Starting Microsoft Python language server.
[Info - 9:37:58 PM] GetCurrentSearchPaths /usr/bin/python3
[Info - 9:37:58 PM] Python search paths:
[Info - 9:37:58 PM] /usr/lib/python3.6
[Info - 9:37:58 PM] /usr/lib/python3.6/lib-dynload
[Info - 9:37:58 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 9:37:58 PM] /usr/local/lib/python3.6/dist-packages
[Info - 9:37:58 PM] /usr/lib/python3/dist-packages
[Info - 9:37:58 PM] Configuration search paths:
[Info - 9:37:58 PM] /usr/lib/python36.zip
[Info - 9:37:58 PM] /usr/lib/python3.6
[Info - 9:37:58 PM] /usr/lib/python3.6/lib-dynload
[Info - 9:37:58 PM] /home/chris/.local/lib/python3.6/site-packages
[Info - 9:37:58 PM] /usr/local/lib/python3.6/dist-packages
[Info - 9:37:58 PM] /usr/lib/python3/dist-packages
[Info - 9:37:58 PM] /usr/bin
[Info - 9:37:59 PM] Microsoft Python Language Server version 0.2.47.0
[Info - 9:37:59 PM] Initializing for /usr/bin/python3

Unhandled Exception: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.b__22_0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ThreadPoolWorkQueue.Dispatch()

@DonJayamanne
Copy link
Author

DonJayamanne commented Apr 9, 2019

@jakebailey I too just experienced this, unfortunately I didn't think twice about it and just reloaded VSC (using latest 0.2.47 version).
FYI - working on a a small workspace with one new python package - behave (tiny package)

@jakebailey jakebailey self-assigned this Apr 9, 2019
@jakebailey jakebailey added this to the April 2019.1 milestone Apr 9, 2019
@jakebailey
Copy link
Member

I haven't been able to reproduce this yet, but I'm still trying.

@chloyster
Copy link

@jakebailey I have been able to reproduce it by having a file with just the line

myFile = open("input.txt, "w")

One thing however is it doesn't crash if I open a file, let the server start, and then put that line in. There is no issue there. The problem arises when I have it in the file and then try and start the server. Hopefully that will help you replicate it.

@jakebailey
Copy link
Member

That did it, I can reproduce this on my Linux machine, but not on Windows (which is unfortunate because that's where my debugger is...).

[Info  - 1:37:17 PM] GetCurrentSearchPaths /home/jake/wtfpy/venv/bin/python3.7 
[Info  - 1:37:18 PM] Python search paths:
[Info  - 1:37:18 PM]     /home/jake/wtfpy/venv/lib/python3.7
[Info  - 1:37:18 PM]     /home/jake/wtfpy/venv/lib/python3.7/lib-dynload
[Info  - 1:37:18 PM]     /usr/lib64/python3.7
[Info  - 1:37:18 PM]     /usr/lib/python3.7
[Info  - 1:37:18 PM]     /home/jake/wtfpy/venv/lib/python3.7/site-packages
[Info  - 1:37:18 PM] Configuration search paths:
[Info  - 1:37:18 PM]     /home/jake/wtfpy/venv/lib/python37.zip
[Info  - 1:37:18 PM]     /home/jake/wtfpy/venv/lib/python3.7
[Info  - 1:37:18 PM]     /home/jake/wtfpy/venv/lib/python3.7/lib-dynload
[Info  - 1:37:18 PM]     /usr/lib64/python3.7
[Info  - 1:37:18 PM]     /usr/lib/python3.7
[Info  - 1:37:18 PM]     /home/jake/wtfpy/venv/lib/python3.7/site-packages
[Info  - 1:37:18 PM]     /home/jake/wtfpy/venv/bin
[Info  - 1:37:18 PM] Microsoft Python Language Server version 1.0.0.0
[Info  - 1:37:18 PM] Initializing for /home/jake/wtfpy/venv/bin/python3.7
Opening document file:///home/jake/issue909/main.py
Analysis of main(User) queued
Analysis version 2 of 1 entries has started.
Import:  io /home/jake/wtfpy/venv/lib/python3.7/io.py 

Unhandled Exception: Analysis of main(User) queued
Analysis of main(User) completed in 45.9239 ms.
Analysis version 2 of 1 entries has been completed in 46.2411 ms.
Analysis version 3 of 1 entries has started.
Analysis of main(User) completed in 1.5194 ms.
Analysis version 3 of 1 entries has been completed in 1.8687 ms.
Analysis of io(Library) queued
Analysis of io(Stub) queued
Import:  abc /home/jake/wtfpy/venv/lib/python3.7/abc.py 
Create built-in compiled (scraped) module:  _io /home/jake/wtfpy/venv/bin/python3.7 
Analysis version 5 of 3 entries has started.
Analysis of _io(CompiledBuiltin) queued
System.ObjectDisposedException: The CancellationTokenSource has been disposed.
   at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
   at System.Threading.CancellationTokenSource.get_Token()
   at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerSession.<Start>b__22_0() in /home/jake/nobackup/python-language-server/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs:line 100
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Python.Core.TaskExtensions.<>c.<DoNotWaitThreadContinuation>b__4_0(Object s) in /home/jake/nobackup/python-language-server/src/Core/Impl/Extensions/TaskExtensions.cs:line 79
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
[Error - 1:37:19 PM] Connection to server got closed. Server will not be restarted.

@AlexanderSher This seems to be getting thrown in Analyze; does that function need to catch disposed as well or is this a bug somewhere?

@jakebailey
Copy link
Member

PR #919 seems to have fixed this for me; opening a file which just contains myFile = open("input.txt", "w") does not crash at startup and everything seems to be working.

@jakebailey
Copy link
Member

@chrisgix @yozlet The build containing #919 is now in the daily channel as 0.2.49, if you'd like to try it out. You should be able to set the following in your settings.json and reload the editor to trigger an update:

"python.analysis.downloadChannel": "daily"

Afterwards, you can remove that line then perform the steps in microsoft/vscode-python#3977 to go back to the stable build (as the daily build isn't guaranteed to be 100% stable), if you so choose.

@chloyster
Copy link

@jakebailey I tried out 0.2.49 and it seems to have solved the issue. I restarted vscode multiple times with the line containing the open call and never got a crash.

@jakebailey
Copy link
Member

That's good to hear. I tried the same and couldn't get it to crash either. I'm going to close this for now as fixed, and it should make it into a future stable release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants