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

Couldn't start client cpptools #1345

Closed
almini opened this issue Dec 13, 2017 · 9 comments
Closed

Couldn't start client cpptools #1345

almini opened this issue Dec 13, 2017 · 9 comments
Assignees
Labels
bug Language Service more info needed The issue report is not actionable in its current state

Comments

@almini
Copy link

almini commented Dec 13, 2017

I have NixOS 17.09 running, but am unable to get this extension working.
After installation and reload I get the error:
[Error - 10:41:56 AM] Starting client failed Launching server using command /home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/bin/Microsoft.VSCode.CPP.Extension.linux failed.

This is the log from developer tools:

shell.ts:459 [ms-vscode.cpptools] Cannot read property 'message' of null: TypeError: Cannot read property 'message' of null
	at fs.rename (/home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/out/src/main.js:232:101)
	at FSReqWrap.oncomplete (fs.js:114:15)
e.onUnexpectedError @ shell.ts:459
(anonymous) @ shell.ts:419
e.onUnexpectedError @ errors.ts:119
o @ errors.ts:138
e.$onUnexpectedError @ mainThreadErrors.ts:26
e.invoke @ abstractThreadService.ts:41
e._invokeHandler @ rpcProtocol.ts:109
e._receiveOneMessage @ rpcProtocol.ts:96
(anonymous) @ rpcProtocol.ts:32
(anonymous) @ rpcProtocol.ts:157
e.invoke @ callbackList.ts:36
e.fire @ event.ts:123
(anonymous) @ ipc.net.ts:82
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
console.ts:123 [Extension Host] activating extension
console.ts:123 [Extension Host] starting language server
messageService.ts:126 Couldn't start client cpptools: mbed-test
e.doShow @ messageService.ts:126
e.show @ messageService.ts:105
e._showMessage @ mainThreadMessageService.ts:72
n.Class.derive._oncancel @ winjs.base.raw.js:1641
e._showMessage @ mainThreadMessageService.ts:42
e.$showMessage @ mainThreadMessageService.ts:36
e.invoke @ abstractThreadService.ts:41
e._invokeHandler @ rpcProtocol.ts:109
e._receiveOneMessage @ rpcProtocol.ts:96
(anonymous) @ rpcProtocol.ts:32
(anonymous) @ rpcProtocol.ts:157
e.invoke @ callbackList.ts:36
e.fire @ event.ts:123
(anonymous) @ ipc.net.ts:82
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
shell.ts:459 spawn /home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/bin/Microsoft.VSCode.CPP.Extension.linux ENOENT: Error: spawn /home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/bin/Microsoft.VSCode.CPP.Extension.linux ENOENT
	at exports._errnoException (util.js:1050:11)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
	at onErrorNT (internal/child_process.js:367:16)
	at _combinedTickCallback (internal/process/next_tick.js:80:11)
	at process._tickCallback (internal/process/next_tick.js:104:9)
e.onUnexpectedError @ shell.ts:459
(anonymous) @ shell.ts:419
e.onUnexpectedError @ errors.ts:119
o @ errors.ts:138
e.$onUnexpectedError @ mainThreadErrors.ts:26
e.invoke @ abstractThreadService.ts:41
e._invokeHandler @ rpcProtocol.ts:109
e._receiveOneMessage @ rpcProtocol.ts:96
(anonymous) @ rpcProtocol.ts:32
(anonymous) @ rpcProtocol.ts:157
e.invoke @ callbackList.ts:36
e.fire @ event.ts:123
(anonymous) @ ipc.net.ts:82
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
2console.ts:123 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:123
t._logExtensionHostMessage @ extensionHost.ts:377
(anonymous) @ extensionHost.ts:202
emitTwo @ events.js:106
emit @ events.js:194
process.nextTick @ internal/child_process.js:766
_combinedTickCallback @ internal/process/next_tick.js:73
_tickCallback @ internal/process/next_tick.js:104
shell.ts:459 [ms-vscode.cpptools] Cannot read property 'sendNotification' of undefined: TypeError: Cannot read property 'sendNotification' of undefined
	at notifyWhenReady (/home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/out/src/LanguageServer/client.js:422:32)
	at onReadyPromise.then (/home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/out/src/LanguageServer/client.js:257:44)
	at <anonymous>
e.onUnexpectedError @ shell.ts:459
(anonymous) @ shell.ts:419
e.onUnexpectedError @ errors.ts:119
o @ errors.ts:138
e.$onUnexpectedError @ mainThreadErrors.ts:26
e.invoke @ abstractThreadService.ts:41
e._invokeHandler @ rpcProtocol.ts:109
e._receiveOneMessage @ rpcProtocol.ts:96
(anonymous) @ rpcProtocol.ts:32
(anonymous) @ rpcProtocol.ts:157
e.invoke @ callbackList.ts:36
e.fire @ event.ts:123
(anonymous) @ ipc.net.ts:82
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
shell.ts:459 [ms-vscode.cpptools] Cannot read property 'sendNotification' of undefined: TypeError: Cannot read property 'sendNotification' of undefined
	at notifyWhenReady (/home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/out/src/LanguageServer/client.js:434:55)
	at onReadyPromise.then (/home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/out/src/LanguageServer/client.js:257:44)
	at <anonymous>
e.onUnexpectedError @ shell.ts:459
(anonymous) @ shell.ts:419
e.onUnexpectedError @ errors.ts:119
o @ errors.ts:138
e.$onUnexpectedError @ mainThreadErrors.ts:26
e.invoke @ abstractThreadService.ts:41
e._invokeHandler @ rpcProtocol.ts:109
e._receiveOneMessage @ rpcProtocol.ts:96
(anonymous) @ rpcProtocol.ts:32
(anonymous) @ rpcProtocol.ts:157
e.invoke @ callbackList.ts:36
e.fire @ event.ts:123
(anonymous) @ ipc.net.ts:82
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
@bobbrow
Copy link
Member

bobbrow commented Dec 13, 2017

An interesting bunch of errors.

  1. The "cannot read property 'message' of null" error from the log can be worked around by manually deleting /home/almin/.vscode/extensions/ms-vscode.cpptools-0.14.4/bin/OpenDebugAD7.exe.config. It is strange that the exception doesn't have a .message property.
  2. The "cannot read property 'sendNotification' of undefined" error surprises me because that code shouldn't be running when the promise is rejected.

I can fix these two, but the underlying issue is that the extension process isn't running on your system and unfortunately, this log doesn't tell us why it failed to launch. You can try running that executable directly to see what error you get. There may be a dependency missing.

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Dec 13, 2017

I've never heard of the NixOS distro before, so that might be an issue. As mentioned by @bobbrow already, what does it say when you run the Microsoft.VSCode.CPP.Extension.linux process (and the .IntelliSense.Msvc one) from the command line at (~/.vscode/extensions/ms-vscode.cpptools-<version>/bin) ?

@juliendehos
Copy link

I have the same error with nixos-17.09 and nixos-unstable.
When running, ~/.vscode/extensions/ms-vscode.cpptools-0.15.0/bin/Microsoft.VSCode.CPP.Extension.linux it says
bash: /home/.../.vscode/extensions/ms-vscode.cpptools-0.15.0/bin/Microsoft.VSCode.CPP.Extension.linux: No such file or directory.

Nixos does not rely on the Filesystem Hierarchy Standard. Packages are stored in /nix/store and user profiles are created using symbolic links. This implies that binaries must be relinked to libraries in the /nix/store. For example, vim is linked to /nix/store/d54amiggq6bw23jw6mdsgamvs6v1g3bh-glibc-2.25-123/lib/ld-linux-x86-64.so.2:

$ file /nix/store/qvp61g6j4hbbfi8z7dzay051srwn00fr-vim_configurable-8.0.1257/bin/vim
/nix/store/qvp61g6j4hbbfi8z7dzay051srwn00fr-vim_configurable-8.0.1257/bin/vim: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/d54amiggq6bw23jw6mdsgamvs6v1g3bh-glibc-2.25-123/lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, stripped

but the cpptools are still linked to /lib64/ld-linux-x86-64.so.2 (which does not exist in nixos):

$ file ~/.vscode/extensions/ms-vscode.cpptools-0.15.0/bin/Microsoft.VSCode.CPP.Extension.linux 
/home/.../.vscode/extensions/ms-vscode.cpptools-0.15.0/bin/Microsoft.VSCode.CPP.Extension.linux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=4ab2b1c13cd195245e581b35901048f97acd1dda, not stripped

I think this is more a packaging problem so I opened an issue in the nixpkgs repo (NixOS/nixpkgs#35088).

@ftpman
Copy link

ftpman commented Apr 20, 2018

I had this problem on Raspbian Desktop and, I solved it by installing AMD64 version of libc (sudo apt-get install libc6-dev:amd64), because uname -r returned 4.9.0-4-amd64, but libc was i386, VS Code was i386 and cpptools extension is amd64.

Before I only had /lib/ld-linux.so.2 and now I have /lib64/ld-linux-x85-64.so.2

@jcrben
Copy link

jcrben commented May 11, 2018

If you run into this, check out my comment on the related nixpkgs issue: NixOS/nixpkgs#35088 (comment)

@bobbrow
Copy link
Member

bobbrow commented May 11, 2018

Is there still something we need to do to address this issue, or can it be closed?

@jcrben
Copy link

jcrben commented May 12, 2018

The solution I described is not ideal for me, as it seems that I need to package all my vscode extensions with nix if I go this route. But that's probably something the nixpkgs project could work out.

Ideally, there would be a way for you to ship this binary without expecting that this linker is at this hardcoded location, but not sure how to do that short of not using any dynamically linked libraries.

So I suppose you could close this.

@sean-mcmanus
Copy link
Collaborator

@tanvit8250 Our binaries are not compiled for ARM.

@danbst
Copy link

danbst commented Jan 3, 2019

@bobbrow @sean-mcmanus this is clearly NixOS packaging issue, so can be closed. Linked issue (NixOS/nixpkgs#35088) contains more links/details.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Language Service more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

7 participants