-
Notifications
You must be signed in to change notification settings - Fork 133
The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted. #909
Comments
@chrisgix Can you update to the latest build, currently 0.2.47? microsoft/vscode-python#3977 |
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? |
@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. Unhandled Exception: System.ObjectDisposedException: The CancellationTokenSource has been disposed. |
@jakebailey I too just experienced this, unfortunately I didn't think twice about it and just reloaded VSC (using latest 0.2.47 version). |
I haven't been able to reproduce this yet, but I'm still trying. |
@jakebailey I have been able to reproduce it by having a file with just the line
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. |
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...).
@AlexanderSher This seems to be getting thrown in |
PR #919 seems to have fixed this for me; opening a file which just contains |
@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 "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. |
@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 |
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. |
@chrisgix commented on Fri Apr 05 2019
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:
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 theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)@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')
The text was updated successfully, but these errors were encountered: