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
Language service fails when using Python 2.7 interpreter #2017
changed the title [-]Language service fails when opening PTVSd project with Python 2.7 interpreter[/-][+]Language service fails when opening PTVSD project with Python 2.7 interpreter[/+]on Jun 20, 2018
changed the title [-]Language service fails when opening PTVSD project with Python 2.7 interpreter[/-][+]Language service fails when using Python 2.7 interpreter[/+]on Jun 20, 2018
I have a project (under an NDA unfortunately) where I can trigger this with 100% success (or, should I say, 100% failure). I'll try to isolate a package that triggers it or trace the ptvs code if time permits.
If you can, attach to dotnet.exe from VSC (.NET Core Attach in C# extension), as in /CONTRIBUTING%20-%20PYTHON_ANALYSIS.md@master#debugging-c-code-in-python-analysis-engine.
Object reference not set to an instance of an object.: Error: Object reference not set to an instance of an object.
at new ResponseError (/Users/patrys/.vscode-insiders/extensions/ms-python.python-2018.6.0/node_modules/vscode-jsonrpc/lib/messages.js:46:28)
at handleResponse (/Users/patrys/.vscode-insiders/extensions/ms-python.python-2018.6.0/node_modules/vscode-jsonrpc/lib/main.js:430:48)
at processMessageQueue (/Users/patrys/.vscode-insiders/extensions/ms-python.python-2018.6.0/node_modules/vscode-jsonrpc/lib/main.js:258:17)
at Immediate.<anonymous> (/Users/patrys/.vscode-insiders/extensions/ms-python.python-2018.6.0/node_modules/vscode-jsonrpc/lib/main.js:242:13)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
Value cannot be null.
Parameter name: type: Error: Value cannot be null.
Parameter name: type
at new ResponseError (/Users/patrys/.vscode-insiders/extensions/ms-python.python-2018.6.0/node_modules/vscode-jsonrpc/lib/messages.js:46:28)
at handleResponse (/Users/patrys/.vscode-insiders/extensions/ms-python.python-2018.6.0/node_modules/vscode-jsonrpc/lib/main.js:430:48)
at processMessageQueue (/Users/patrys/.vscode-insiders/extensions/ms-python.python-2018.6.0/node_modules/vscode-jsonrpc/lib/main.js:258:17)
at Immediate.<anonymous> (/Users/patrys/.vscode-insiders/extensions/ms-python.python-2018.6.0/node_modules/vscode-jsonrpc/lib/main.js:242:13)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
[Error - 12:45:42] System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.PythonTools.Analysis.Values.BuiltinNamespace`1.Equals(Object obj)
at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
at Microsoft.PythonTools.Analysis.AnalysisValue.Microsoft.PythonTools.Analysis.IAnalysisSet.Union(IEnumerable`1 items, Boolean canMutate)
at Microsoft.PythonTools.Analysis.AnalysisValueSetExtensions.GetMember(IAnalysisSet self, Node node, AnalysisUnit unit, String name)
at Microsoft.PythonTools.Analysis.Values.LazyValueInfo.ResolveOnce(AnalysisUnit unit, ResolutionContext context, Boolean& cacheResult)
at Microsoft.PythonTools.Analysis.Values.LazyValueInfo.Resolve(AnalysisUnit unit, ResolutionContext context)
at Microsoft.PythonTools.Analysis.AnalysisValueSetExtensions.Resolve(IAnalysisSet self, AnalysisUnit unit, ResolutionContext context, Boolean& changed)
at Microsoft.PythonTools.Analysis.Values.LazyValueInfo.Resolve(AnalysisUnit unit, ResolutionContext context)
at Microsoft.PythonTools.Analysis.AnalysisValueSetExtensions.Resolve(IAnalysisSet self, AnalysisUnit unit, ResolutionContext context, Boolean& changed)
at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluator.AssignTo(Node assignStmt, Expression left, IAnalysisSet values)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(AssignmentStatement node)
at Microsoft.PythonTools.Parsing.Ast.AssignmentStatement.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.Walk(TryStatement node)
at Microsoft.PythonTools.Parsing.Ast.TryStatement.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.FunctionAnalysisUnit.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)
Hyunghun Cho, Ph.D. (@hyunghunny) Your workaround works by effectively removing the python.jediEnabled setting. That's all you need to do, no need to delete entire folders. Unfortunately it does not fix anything, it just no longer uses the new language service (where the bug used to live).
Based on your last message regarding "python.jediEnabled", I have just inserted the following statement into User Settings and Workspace Settings and I still get the error message:
{
"python.pythonPath": "C:\Program Files\IronPython 2.7\ipy.exe",
"python.jediEnabled": false,
"python.linting.pylintEnabled": false
}
Any more news on a fix for this problem?
Thanks.
Update:
After the changes to User Settings and Workspace Settings I found that the debugger would not start, so I removed "python.jediEnabled": false, which made the debugger work again. Very strange!
This still fails for me even if I have removed my languageServer directory and forced the language server to be redownloaded. Is that expected? Maybe the version of the LS vscode-python is downloading doesn't incorporate those changes yet.
Don't know if this will work for others, but I turned the jediEnabled setting off and then on(so first to false and then back to true) and now it is working. Good luck!
Reacted by Vu Anh Duc, Eloy Adonis Colell, Shang Li and Greg Gaughan
For people bumping up against this issue, if you install a development build of the extension then it will download a newer version of the language server which should have a fix in it.
(Even if you already have a development build installed, please uninstall it and install a newer copy as we updated the URL that the language server is downloaded from.)
Reacted by Istvan SZALAÏ, qyloxe, John Hany, Rustan Corpuz and Bertrand Croq
Activity
[-]Language service fails when opening PTVSd project with Python 2.7 interpreter[/-][+]Language service fails when opening PTVSD project with Python 2.7 interpreter[/+][-]Language service fails when opening PTVSD project with Python 2.7 interpreter[/-][+]Language service fails when using Python 2.7 interpreter[/+]MikhailArkhipov commentedon Jun 20, 2018
Specific Python? Works on Windows & Ubuntu. Might be threading issue - is it consistent when you flip between interpreters? If you can, attach to dotnet.exe from VSC (.NET Core Attach in C# extension), as in https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING%20-%20PYTHON_ANALYSIS.md#debugging-c-code-in-python-analysis-engine.
patrys commentedon Jun 20, 2018
I have a project (under an NDA unfortunately) where I can trigger this with 100% success (or, should I say, 100% failure). I'll try to isolate a package that triggers it or trace the ptvs code if time permits.
DonJayamanne commentedon Jun 20, 2018
todo Don Jayamanne (@DonJayamanne)
MilkyHearts commentedon Jun 26, 2018
Works prefect in Python3 but not 2.7 >.<
patrys commentedon Jun 27, 2018
JS stack trace
DonJayamanne commentedon Jun 27, 2018
Mikhail Arkhipov (@MikhailArkhipov) Does this work on Python 2.7 for you?
patrys commentedon Jul 11, 2018
C# stack trace
27 remaining items
patrys commentedon Aug 3, 2018
Please vote on the issue instead of writing "me too".
MikhailArkhipov commentedon Aug 6, 2018
Patryk Zawadzki (@patrys) - if you uncomment
// #define WAIT_FOR_DEBUGGERin AnalysisVsc/Program.cs the process will wait until you attach the debugger.
hyunghunny commentedon Aug 7, 2018
The same issue happened to me. I've tried to fix it and finally I know that how can it be resolved:
I thought that the previous setting for Python is not compatible with the latest one.
Hope above is helpful to someone who suffers from the same issue.
patrys commentedon Aug 7, 2018
Hyunghun Cho, Ph.D. (@hyunghunny) Your workaround works by effectively removing the
python.jediEnabledsetting. That's all you need to do, no need to delete entire folders. Unfortunately it does not fix anything, it just no longer uses the new language service (where the bug used to live).PeterSorrell commentedon Aug 7, 2018
Based on your last message regarding "python.jediEnabled", I have just inserted the following statement into User Settings and Workspace Settings and I still get the error message:
{
"python.pythonPath": "C:\Program Files\IronPython 2.7\ipy.exe",
"python.jediEnabled": false,
"python.linting.pylintEnabled": false
}
Any more news on a fix for this problem?
Thanks.
PeterSorrell commentedon Aug 7, 2018
Update:
After the changes to User Settings and Workspace Settings I found that the debugger would not start, so I removed "python.jediEnabled": false, which made the debugger work again. Very strange!
albireox commentedon Aug 8, 2018
This still fails for me even if I have removed my
languageServerdirectory and forced the language server to be redownloaded. Is that expected? Maybe the version of the LS vscode-python is downloading doesn't incorporate those changes yet.brettcannon commentedon Aug 8, 2018
José Sánchez-Gallego (@albireox) it doesn't have any fixes yet.
PeterSorrell do realize we don't have official support for IronPython.
MikhailArkhipov commentedon Aug 9, 2018
Brett Cannon (@brettcannon) - fix is in LS, we can rev up insiders build.
norheim commentedon Aug 10, 2018
Don't know if this will work for others, but I turned the jediEnabled setting off and then on(so first to false and then back to true) and now it is working. Good luck!
MikhailArkhipov commentedon Aug 10, 2018
norheim - the bug was a thread race condition so it may work sometimes. If it was consistent, we'd seen it before :-)
brettcannon commentedon Aug 10, 2018
For people bumping up against this issue, if you install a development build of the extension then it will download a newer version of the language server which should have a fix in it.
(Even if you already have a development build installed, please uninstall it and install a newer copy as we updated the URL that the language server is downloaded from.)
qyloxe commentedon Aug 14, 2018
confirm: after installation of development build (vsix) the problem disappeared. GJ!