You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New language server seems to be frozen at analyzing workspace for more than 30 minutes #2297
Relatedly, my vscode is currently in a state where it is not analyzing the workspace, vscode is idle, but Microsoft.Python.LanguageServer.exe is using 22% CPU. So while Analyzing workspace, ${n} items remaining... is one indicator of the issue, it's not the only indicator, and sometimes the language server can spin on its own.
changed the title [-]New language server seems to frozen at analyzing workspace for more than 30 minutes[/-][+]New language server seems to be frozen at analyzing workspace for more than 30 minutes[/+]on Aug 3, 2018
Here too. Not sure if it is helpful, but I'm also having this pop up in the OUTPUT tab:
[Error - 07:34:56] System.NullReferenceException: Object reference not set to an instance of an object.
at System.Object.GetType()
at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateWorker(Node node)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(ClassDefinition node)
at Microsoft.PythonTools.Parsing.Ast.ClassDefinition.Walk(PythonWalker walker)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node)
at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.WalkBody(Node node, AnalysisUnit unit)
at Microsoft.PythonTools.Analysis.ClassAnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval)
at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.Worker(Object threadStarted)
(and Don Jayamanne (@DonJayamanne) has Microsoft taken over the vscode-python repo? IOW, is this the main repo to track and report issues to?)
I've encountered the same problem in my ubuntu 18.04 64bit with vscode 1.27.1, vscode-python 2018.8.0 and python 3.6.5
here is the trace output log:
output log
Starting Microsoft Python language server.
Initializing for /usr/bin/python3
Loading files from /home/allenyl/anaconda3/lib/python3.6/site-packages/jieba
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/_compat.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__main__.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_emit.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/__init__.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_trans.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/viterbi.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/char_state_tab.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_start.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/tfidf.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/__init__.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/textrank.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/analyzer.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_emit.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/__init__.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_trans.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_start.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/_compat.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/_compat.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__main__.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__main__.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_emit.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_emit.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/__init__.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/__init__.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_trans.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_trans.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/viterbi.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/viterbi.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/char_state_tab.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/char_state_tab.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_start.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_start.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/tfidf.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/tfidf.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/__init__.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/__init__.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/textrank.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/textrank.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/analyzer.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/analyzer.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_emit.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_emit.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/__init__.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/__init__.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_trans.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_trans.py
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_start.py at version -1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_start.py
Opening document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py
Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py
Waiting for parsing to complete
Parsing complete. Waiting for analysis entries to enqueue
Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py at version 1
Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py
Enqueue complete. Waiting for analysis to complete
[Error - 下午7:50:09] System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.PythonTools.Analysis.ModuleResolver.GetModuleFullName(String originatingModule, String relativePath)
at Microsoft.PythonTools.Analysis.ModuleResolver.ResolvePotentialModuleNames(String importingFromModuleName, String importingFromFilePath, String relativeModuleName, Boolean absoluteImports)+MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.TryImportModule(String modName, Boolean forceAbsolute, ModuleReference& moduleRef, IReadOnlyList`1& remainingParts)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(FromImportStatement node)
at Microsoft.PythonTools.Parsing.Ast.FromImportStatement.Walk(PythonWalker walker)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node)
at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker)
at Microsoft.PythonTools.Parsing.Ast.PythonAst.Walk(PythonWalker walker)
at Microsoft.PythonTools.Analysis.AnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval)
at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.HandleAnalyzable(IAnalyzable item, AnalysisPriority priority, CancellationToken cancellationToken)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.ConsumerLoop()
and the result of top command:
Although CPU has idled while this small project, the memory consumption seems too high.
Remaining items in the status bar may be UI issue if CPU load is low. If LS was restarted b/c of exception (most probable cause is microsoft/python-language-server#72) then UI just shows string from the previous instance.
One thing I noticed here is some symlink folder structures can cause really deep parsing queues to form.
Recursive/looping symlinks can end up propagating pretty deeply and if there's actual content anywhere along the way it will take a long time. For example, given a simple folder structure like this:
Symlink could cause it... I have tons of them (I use zc.buildout, with an extension (omelette) that makes all the eggs used by the project available in the same tree, using symlinks).
I'm not the only one using it... in Zope/Plone world is quite usual that devs use these tools.
I wondered if it is processing my ./.venv pipenv package folder or some other temporary sub-folder. The number of items it said it was processing seemed much larger than my code base.
True, I didn't take into account that virtualenv also uses symlinks... don't know about pipenv, but I guess it also does it. So, there's a major problem then that might affect the vast majority of people.
Activity
xobs commentedon Aug 2, 2018
I'm experiencing this issue as well.
Relatedly, my vscode is currently in a state where it is not analyzing the workspace, vscode is idle, but
Microsoft.Python.LanguageServer.exeis using 22% CPU. So whileAnalyzing workspace, ${n} items remaining...is one indicator of the issue, it's not the only indicator, and sometimes the language server can spin on its own.DonJayamanne commentedon Aug 3, 2018
Happened again today (on a Mac):

derekwallace commentedon Aug 3, 2018
I experience this issue aswell.
[-]New language server seems to frozen at analyzing workspace for more than 30 minutes[/-][+]New language server seems to be frozen at analyzing workspace for more than 30 minutes[/+]ijstokes commentedon Aug 4, 2018
Here too. Not sure if it is helpful, but I'm also having this pop up in the
OUTPUTtab:(and Don Jayamanne (@DonJayamanne) has Microsoft taken over the vscode-python repo? IOW, is this the main repo to track and report issues to?)
ijstokes commentedon Aug 4, 2018
ijstokes commentedon Aug 4, 2018
DonJayamanne commentedon Aug 7, 2018
MikhailArkhipov commentedon Aug 7, 2018
Steve Dower (@zooba) may be interested in microsoft/vscode#55815 as well.
16 remaining items
sneridagh commentedon Sep 13, 2018
Same here, CPU spinning to 100% "Analyzing workspace". I have a large one, but who that works at a professional level doesn't?
What did it "analyze"?
allenyllee commentedon Sep 13, 2018
I've encountered the same problem in my ubuntu 18.04 64bit with vscode 1.27.1, vscode-python 2018.8.0 and python 3.6.5
here is the trace output log:
output log
and the result of top command:
Although CPU has idled while this small project, the memory consumption seems too high.
the project is https://github.com/fxsjy/jieba
MikhailArkhipov commentedon Sep 13, 2018
Remaining items in the status bar may be UI issue if CPU load is low. If LS was restarted b/c of exception (most probable cause is microsoft/python-language-server#72) then UI just shows string from the previous instance.
MikhailArkhipov commentedon Sep 13, 2018
microsoft/python-language-server#92
richardwb commentedon Sep 14, 2018
One thing I noticed here is some symlink folder structures can cause really deep parsing queues to form.
Recursive/looping symlinks can end up propagating pretty deeply and if there's actual content anywhere along the way it will take a long time. For example, given a simple folder structure like this:
And
test.pyis simply "import folder.lib" so we start traversing the tree, I see the following trace output:I managed to work around this by just adding the suspect symlinks to my VSCode excludes.
There's also some other odd behavior with dead symlinks, but it doesn't seem to act as poorly.
Add telemetry collection for analysis reporting complete.
sneridagh commentedon Sep 17, 2018
Symlink could cause it... I have tons of them (I use zc.buildout, with an extension (omelette) that makes all the eggs used by the project available in the same tree, using symlinks).
I'm not the only one using it... in Zope/Plone world is quite usual that devs use these tools.
It would be great if we can fix it somehow.
samuelpcabral commentedon Sep 17, 2018
Same thing here! Windows 10, with Python 2.7

and it looks like it's consuming far more memory than it should.
mungojam commentedon Sep 17, 2018
I wondered if it is processing my ./.venv pipenv package folder or some other temporary sub-folder. The number of items it said it was processing seemed much larger than my code base.
sneridagh commentedon Sep 17, 2018
True, I didn't take into account that virtualenv also uses symlinks... don't know about pipenv, but I guess it also does it. So, there's a major problem then that might affect the vast majority of people.
xobs commentedon Sep 17, 2018
It's happening on Windows as well, which doesn't use symlinks for virtualenv (that I know of). Also, my project doesn't use virtualenv.
However, it does use environment variables and mess with
PYTHONPATH, which may be related to the cause.Add telemetry collection for analysis reporting complete.
MikhailArkhipov commentedon Sep 17, 2018
microsoft/python-language-server#96