Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insiders: "Cannot read property 'adapter' of undefined" #66322

Closed
DanTup opened this issue Jan 10, 2019 · 14 comments
Closed

Insiders: "Cannot read property 'adapter' of undefined" #66322

DanTup opened this issue Jan 10, 2019 · 14 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@DanTup
Copy link
Contributor

DanTup commented Jan 10, 2019

In the current insiders, when I run a debug session I see this:

  ERR Cannot read property 'adapter' of undefined: TypeError: Cannot read property 'adapter' of undefined
	at e._withAdapter (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:548:1001)
	at e.$provideCodeActions (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:553:816)
	at t._doInvokeHandler (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:637:547)
	at t._invokeHandler (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:637:219)
	at t._receiveRequest (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:635:801)
	at t._receiveOneMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:634:790)
	at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:632:675
	at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:38:994
	at e.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:44:76)
	at a (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:168:881)
	at Socket.f._socketDataListener (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:169:95)
	at Socket.emit (events.js:182:13)
	at addChunk (_stream_readable.js:279:12)
	at readableAddChunk (_stream_readable.js:264:11)
	at Socket.Readable.push (_stream_readable.js:219:10)
	at Pipe.onread (net.js:636:20)

This doesn't happen in stable. I'm running a Dart debug session, though I don't know if matters (the stack doesn't look like it's the extension code, but the stack traces are often misleading).

@vscodebot
Copy link

vscodebot bot commented Jan 10, 2019

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues bug Issue identified by VS Code Team member as probable bug and removed bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Jan 10, 2019
@weinand weinand assigned jrieken and unassigned weinand Jan 10, 2019
@weinand
Copy link
Contributor

weinand commented Jan 10, 2019

The "adapter" property refers to something in extHostLanguageFeatures.ts and is unrelated to "debug adapters".

@DanTup
Copy link
Contributor Author

DanTup commented Jan 10, 2019

Ah, I see - it occurred while I was trying to debug so I assumed it was related. I see now it says provideCodeActions in the stack.

Let me know if this may be extension dependent and what info would be useful to track it down.

@jrieken jrieken added the info-needed Issue requires more information from poster label Jan 10, 2019
@jrieken
Copy link
Member

jrieken commented Jan 10, 2019

Do you have some more steps here? Is this a dart-file?

@DanTup
Copy link
Contributor Author

DanTup commented Jan 10, 2019

Yep, it's a Dart file. I don't seem to be able to repro doing what I think is the same now - any ideas what sort of thing could go wrong to cause this that might help reproduce it?

(it's also possible my Insiders updated, though I think that happened before I was hitting this)

@jrieken
Copy link
Member

jrieken commented Jan 10, 2019

This could happen when registering and unregistering a provider without us knowing, e.g. while a request is active. Could that be?

@DanTup
Copy link
Contributor Author

DanTup commented Jan 10, 2019

I guess that's possible - everything is generally registered in activate, though we have some conditional ones that are registered "later" once the server is up and we know it's version:

screenshot 2019-01-10 at 1 18 56 pm

We also dispose them when we perform a "silent restart" of the language server and then re-register them.

This shouldn't happen much during normal use, but I guess it's possible (since I was trying to repro something) that I opened the project and hit F5 while the code shown above was still going on.

If it was that - is this a bug, or should I only register at certain times?

(btw, if you specifically meant a code action provider, then as far as I can tell, they've only activated synchronously in the activate method)

@jrieken
Copy link
Member

jrieken commented Jan 10, 2019

If it was that - is this a bug, or should I only register at certain times?

No, you should be able to do this any time. It's a bug on our end.

@jrieken jrieken assigned mjbvz and unassigned jrieken Jan 10, 2019
@jrieken jrieken removed the info-needed Issue requires more information from poster label Jan 10, 2019
@jrieken
Copy link
Member

jrieken commented Jan 10, 2019

@mjbvz the code action provider regsitry (CodeActionProviderRegistry) has a onDidChange event which should then cancel pending requests. That should/could fix this

@weinand weinand changed the title Insiders debugging: "Cannot read property 'adapter' of undefined" Insiders: "Cannot read property 'adapter' of undefined" Jan 10, 2019
@mjbvz mjbvz added this to the December/January 2019 milestone Jan 10, 2019
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Jan 10, 2019
@mjbvz mjbvz closed this as completed in 31d776b Jan 10, 2019
@aeschli
Copy link
Contributor

aeschli commented Feb 1, 2019

@jrieken Can you verify?

@roblourens roblourens added the verified Verification succeeded label Feb 2, 2019
@svipas
Copy link
Contributor

svipas commented Feb 14, 2019

This error still exists in 1.31.1 (Stable).

I got it today and I don't know if it's related but one of my file syntax colorings is broken. I didn't use a debugger, just updated VS Code and after some time run into this issue.

Broken coloring

screenshot 2019-02-14 at 14 04 10

I'm using Default Dark+ theme.


Log (Window)

[2019-02-14 09:57:03.218] [renderer1] [error] Cannot read property 'adapter' of undefined: TypeError: Cannot read property 'adapter' of undefined
	at e._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:553:140)
	at e.$provideHover (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:556:796)
	at t._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:644:118)
	at t._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:643:744)
	at t._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:642:256)
	at t._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:641:155)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:638:960
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:38:994
	at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44:113)
	at a (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:170:213)
	at Socket.f._socketDataListener (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:170:434)
	at Socket.emit (events.js:182:13)
	at addChunk (_stream_readable.js:279:12)
	at readableAddChunk (_stream_readable.js:264:11)
	at Socket.Readable.push (_stream_readable.js:219:10)
	at Pipe.onread (net.js:636:20)
[2019-02-14 13:46:06.244] [renderer1] [error] An unknown error occurred. Please consult the log for more details.

Log (Extension Host)

[2019-02-14 13:46:06.242] [exthost] [error] [vscode.typescript-language-features] provider FAILED
[2019-02-14 13:46:06.242] [exthost] [error] {"label":"Acquiring typings...","detail":"Acquiring typings definitions for IntelliSense."}

Toggle Developer Tools (Warnings)

[Extension Host] INVALID text edit -> must have at least a label
[e2e] potential listener LEAK detected, having 175 listeners already. MOST frequent listener (1):
 at s (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1874:428)
    at Object.t.attachBadgeStyler (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1874:713)
    at e.renderTemplate (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5255:459)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:874:798
    at Array.map (<anonymous>)
    at e.renderTemplate (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:874:773)
    at e.alloc (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:177:207)
    at e.insertItemInDOM (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:428:686)
    at e.render (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:427:854)
    at e.onScroll (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:434:185)
    at e.fire (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:81:332)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:404:911
    at e.fire (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:81:312)
    at t._setState (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:212:817)
    at t.setScrollDimensions (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:210:923)
    at t.setScrollDimensions (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:407:198)
    at e.layout (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:427:294)
    at i.e.layout (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:884:135)
    at t.layoutBody (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5266:492)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5264:75
    at e.fire (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:81:312)
    at t.layout (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:949:145)
    at t.layoutBody (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5266:396)
    at t.e.layout (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:492:340)
    at Object.layout (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:445:146)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:453:153
    at Array.forEach (<anonymous>)
    at t.layoutViews (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:453:124)
    at t.relayout (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:447:520)
    at t.addView (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:446:268)
    at t.addPanel (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:496:263)
    at t.addPanel (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4995:747)
    at t.addPanels (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4994:940)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5275:313
    at Array.forEach (<anonymous>)
    at t.onSelectionChange (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5275:291)
    at e.fire (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:81:332)
    at t.onListSelectionChange (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5254:372)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:75:996
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:83:744
    at e.fire (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:81:312)
    at e.set (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:860:131)
    at i.e.setSelection (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:884:316)
    at t.restoreSelection (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5254:624)
    at t.onListSelectionChange (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5254:271)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:75:996
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:83:730
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:83:899
    at Array.forEach (<anonymous>)
    at e.bufferEvents (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:83:872)
    at i.e.splice (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:883:42)
    at t.splice (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5253:238)
    at t.onDidChangeVisibility (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5253:6)
    at e.fire (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:81:332)
    at t.setVisible (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2668:974)
    at t.setVisible (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5273:145)
    at o.t.showComposite (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5329:967)
    at o.t.doOpenComposite (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5327:626)
    at o.t.openComposite (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5327:123)
    at o.doOpenViewlet (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5393:335)
    at o.openViewlet (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:5392:657)
    at t.run (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4988:80)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2587:698
e.check @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:79
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1536   ERR An unknown error occurred. Please consult the log for more details.

/cc @roblourens @mjbvz @weinand @jrieken @aeschli

@roblourens
Copy link
Member

That's a different stack (provideHover vs provideCodeActions) but related. You could open a new issue for colorization.

@svipas
Copy link
Contributor

svipas commented Feb 15, 2019

@roblourens Okay, thanks, already opened a issue: #68764

@DanTup
Copy link
Contributor Author

DanTup commented Feb 21, 2019

Saw this in documentSymbols just now. I've opened #69147. This time it's certainly what @jrieken suggested:

This could happen when registering and unregistering a provider without us knowing, e.g. while a request is active. Could that be?

I had just changed the Dart SDK path, which results in us disposing and re-creating the providers that have references to the language server (which changes with the SDK).

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants