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

[process] ERROR TypeError [ERR_INVALID_ARG_TYPE]: The "err" argument must be of type number. Received type undefined #6654

Open
kittaakos opened this issue Nov 28, 2019 · 6 comments
Assignees
Labels
bug bugs found in the application process issues related to the process extension

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Nov 28, 2019

Description

I have the changes from #6595, I have a LS running in the electron-based application. The error happens when I close the app. See here: #6595 (comment)

Related comment:

// node's child_process exit sets the unused parameter to null,
// but we want it to be undefined instead.

Console log:

root INFO Changed application state from 'ready' to 'closing_window'.
root INFO >>> Storing the layout...
root INFO <<< The layout has been successfully stored.
root ERROR TypeError [ERR_INVALID_ARG_TYPE]: The "err" argument must be of type number. Received type undefined
    at validateNumber (internal/validators.js:130:11)
    at Object.getSystemErrorName (util.js:1435:3)
    at errnoException (internal/errors.js:303:21)
    at ChildProcess.kill (internal/child_process.js:430:26)
    at Object.<anonymous> (C:\Users\kittaakos\dev\my-project\node_modules\@theia\core\lib\node\messaging\ipc-connect
ion-provider.js:55:101)
    at Object.disposable.dispose (C:\Users\kittaakos\dev\my-project\node_modules\@theia\core\lib\common\disposable.j
s:95:13)
    at DisposableCollection.dispose (C:\Users\kittaakos\dev\my-project\node_modules\@theia\core\lib\common\disposabl
e.js:72:40)
    at DisposableCollection.disposable.dispose (C:\Users\kittaakos\dev\my-project\node_modules\@theia\core\lib\commo
n\disposable.js:95:13)
    at DisposableCollection.dispose (C:\Users\kittaakos\dev\my-project\node_modules\@theia\core\lib\common\disposabl
e.js:72:40)
    at FileSystemWatcherServerClient.dispose (C:\Users\kittaakos\dev\my-project\node_modules\@theia\filesystem\lib\n
ode\filesystem-watcher-client.js:55:24)
root INFO >>> Disposing my service...
root INFO <<< Disposed my service.
root ERROR TypeError [ERR_INVALID_ARG_TYPE]: The "err" argument must be of type number. Received type undefined
    at validateNumber (internal/validators.js:130:11)
    at Object.getSystemErrorName (util.js:1435:3)
    at errnoException (internal/errors.js:303:21)
    at ChildProcess.kill (internal/child_process.js:430:26)
    at RawProcess.kill (C:\Users\kittaakos\dev\my-project\node_modules\@theia\process\lib\node\raw-process.js:137:26
)
    at C:\Users\kittaakos\dev\my-project\node_modules\@theia\languages\lib\node\language-server-contribution.js:135:
151
    at Object.dispose (C:\Users\kittaakos\dev\my-project\node_modules\vscode-ws-jsonrpc\lib\server\connection.js:31:
24)
    at Object.clientConnection.onClose [as dispose] (C:\Users\kittaakos\dev\my-project\node_modules\vscode-ws-jsonrp
c\lib\server\connection.js:12:53)
    at DisposableCollection.dispose (C:\Users\kittaakos\dev\my-project\node_modules\vscode-ws-jsonrpc\lib\disposable
.js:15:36)
    at reader.onClose (C:\Users\kittaakos\dev\my-project\node_modules\vscode-ws-jsonrpc\lib\server\connection.js:18:
41)
Done in 363.54s.

Can you please look into this @marechal-p?

Reproduction Steps

OS and Theia version:

Diagnostics:

@kittaakos kittaakos added bug bugs found in the application process issues related to the process extension labels Nov 28, 2019
@akosyakov
Copy link
Member

@marechal-p Could you have a look please?

@paul-marechal
Copy link
Member

The following 3 stack items make me think that this is not related to my change, since it comes from ipc-connection-provider, that uses bare child processes:

    at ChildProcess.kill (internal/child_process.js:430:26)
    at Object.<anonymous> (C:\Users\kittaakos\dev\my-project\node_modules\@theia\core\lib\node\messaging\ipc-connect
ion-provider.js:55:101)
    at Object.disposable.dispose (C:\Users\kittaakos\dev\my-project\node_modules\@theia\core\lib\common\disposable.j
s:95:13)

const toCancelStop = toStop.push(Disposable.create(() => childProcess.kill()));

But I am looking into it.

@paul-marechal
Copy link
Member

Opened nodejs/node#30702, might have to move it to Electron depending on the reason of the error.

@marcdumais-work
Copy link
Contributor

@marechal-p were you able to determine if this issue is related to your recent PR (#6595)?

@paul-marechal
Copy link
Member

paul-marechal commented Nov 28, 2019

@marcdumais-work It seems to come from a place that uses bare child processes (the ones from Node directly), so I think it is not related indeed. But maybe some side effect is at play? No clue.

@kittaakos
Copy link
Contributor Author

think it is not related

Yeah, perhaps the issue was always there, and your changes have revealed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application process issues related to the process extension
Projects
None yet
Development

No branches or pull requests

4 participants