Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Uncaught Error: Connection is closed. #22

Closed
imp opened this issue Nov 15, 2017 · 10 comments
Closed

Uncaught Error: Connection is closed. #22

imp opened this issue Nov 15, 2017 · 10 comments

Comments

@imp
Copy link

imp commented Nov 15, 2017

[Enter steps to reproduce:]

Not, sure. I've got that on first save of Rust code (Cmd-S) after upgrading to ide-rust 0.6.0

Atom: 1.22.0 x64
Electron: 1.6.15
OS: Mac OS X 10.13.1
Thrown From: ide-rust package 0.6.0

Stack Trace

Uncaught Error: Connection is closed.

At /Users/imp/.atom/packages/ide-rust/node_modules/vscode-jsonrpc/lib/main.js:613

Error: Connection is closed.
    at /packages/ide-rust/node_modules/vscode-jsonrpc/lib/main.js:138:28)
    at throwIfClosedOrDisposed (/packages/ide-rust/node_modules/vscode-jsonrpc/lib/main.js:613:19)
    at Object.sendNotification (/packages/ide-rust/node_modules/vscode-jsonrpc/lib/main.js:667:13)
    at LanguageClientConnection._sendNotification (/packages/ide-rust/node_modules/atom-languageclient/build/lib/languageclient.js:242:15)
    at LanguageClientConnection.didChangeTextDocument (/packages/ide-rust/node_modules/atom-languageclient/build/lib/languageclient.js:131:10)
    at TextEditorSyncAdapter.sendIncrementalChanges (/packages/ide-rust/node_modules/atom-languageclient/build/lib/adapters/document-sync-adapter.js:200:24)
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at TextBuffer.module.exports.TextBuffer.emitDidChangeTextEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1675:28)
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:975:18)
    at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1687:32)
    at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1248:30
    at TextEditor.module.exports.TextEditor.mergeSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2635:24)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2597:41)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1246:25)
    at TextEditor.module.exports.TextEditor.insertText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1212:25)
    at TextEditorComponent.didTextInput (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:1627:30)

Commands

Non-Core Packages

atom-beautify 0.30.6 
atom-ide-ui 0.5.4 
atomatigit 1.5.5 
autocomplete-python 1.10.3 
browser-plus 0.0.98 
build 0.69.0 
build-cargo 2.0.0 
build-make 0.13.0 
busy 0.7.0 
busy-signal 1.4.3 
ide-rust 0.6.0 
imdone-atom 2.2.7 
imdone-atom-github 0.1.11 
intentions 1.1.5 
language-diff 0.7.0 
language-docker 1.1.8 
language-rust 0.4.12 
linter 2.2.0 
linter-pycodestyle 2.1.3 
linter-rust 0.8.1 
linter-ui-default 1.6.10 
merge-conflicts 1.4.5 
minimap 4.29.7 
minimap-git-diff 4.3.1 
project-manager 3.3.5 
python-tools 0.6.9 
racer-plus 2.0.0 
release-notes 0.53.0 
rust-api-docs-helper 0.5.1 
rusty-dark-syntax 0.7.0 
split-diff 1.5.1 
sync-settings 0.8.3 
tool-bar 1.1.0 
travis-ci-status 1.3.1 
@alexheretic
Copy link
Member

Could be that Rls collapsed somehow, this error can happen when the server process has ended. The stderr output of the Rls may help.

Can you try updating your Rls to latest nightly rustup update nightly and seeing if the error persists?
If so you can record the Rls stderr by overriding the Rls command.

# config.cson
  "ide-rust":
    rlsCommandOverride: "RUST_BACKTRACE=full rustup run nightly rls 2> ~/rls.log"

You may need to modify to get it working on mac, I'm not sure.

This should allow you to reproduce the error and look at rls.log, or wherever you routed the stderr.

Unfortunately the stderr output from Rls can be a bit noisy but it may help point to a problem in Rls.

@alexheretic
Copy link
Member

@imp did you get a chance to test this again? I can't reproduce this myself at the moment.

@imp
Copy link
Author

imp commented Dec 6, 2017

No, I never got a chance to reproduce that. Perhaps it has something to do with my Rust environment that has been changed since then.

@alexheretic
Copy link
Member

Ok thanks, I'm going to close this with the optimistic notion that this has been fixed upstream (atom-languageclient/rls). Please reopen if you start seeing it again.

@phisk
Copy link

phisk commented Dec 18, 2017

Bug is back:

[Enter steps to reproduce:]

  1. open atom
  2. edit any rust source file

Atom: 1.23.1 x64
Electron: 1.6.15
OS: win 10 1709 (Build 16299.125)
Thrown From: ide-rust package 0.8.0

Stack Trace

Uncaught Error: Connection is closed.

At C:\Users\p\.atom\packages\ide-rust\node_modules\vscode-jsonrpc\lib\main.js:613

Error: Connection is closed.
    at /packages/ide-rust/node_modules/vscode-jsonrpc/lib/main.js:138:28)
    at throwIfClosedOrDisposed (/packages/ide-rust/node_modules/vscode-jsonrpc/lib/main.js:613:19)
    at Object.sendNotification (/packages/ide-rust/node_modules/vscode-jsonrpc/lib/main.js:667:13)
    at LanguageClientConnection._sendNotification (/packages/ide-rust/node_modules/atom-languageclient/build/lib/languageclient.js:365:15)
    at LanguageClientConnection.didChangeWatchedFiles (/packages/ide-rust/node_modules/atom-languageclient/build/lib/languageclient.js:167:10)
    at ServerManager.projectFilesChanged (/packages/ide-rust/node_modules/atom-languageclient/build/lib/server-manager.js:248:33)
    at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.23.1/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.23.1/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at didChangeCallback (~/AppData/Local/atom/app-1.23.1/resources/app/src/project.js:350:28)
    at PathWatcher.onNativeEvents (~/AppData/Local/atom/app-1.23.1/resources/app/src/path-watcher.js:671:15)
    at ~/AppData/Local/atom/app-1.23.1/resources/app/src/path-watcher.js:567:31
    at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.23.1/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.23.1/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at NativeWatcher.onEvents (~/AppData/Local/atom/app-1.23.1/resources/app/src/path-watcher.js:448:26)
    at handler (~/AppData/Local/atom/app-1.23.1/resources/app/src/path-watcher.js:177:15)

Commands

     -2:25.3.0 core:move-left (input.hidden-input)
  4x -2:24.5.0 core:backspace (input.hidden-input)
     -2:23.5.0 core:save (input.hidden-input)

Non-Core Packages

atom-ide-ui 0.7.0 
atom-material-syntax 1.0.7 
atom-material-syntax-dark 1.0.0 
atom-material-syntax-light 0.4.6 
atom-material-ui 2.0.6 
ide-rust 0.8.0 
language-powershell 4.0.0 
language-rust 0.4.12 
minimap 4.29.7 

@imp
Copy link
Author

imp commented Dec 18, 2017

I concur - the issue is back. I've updated my Rust environment this morning and it pops up this backtrace window on the first keystroke in any window with Rust code.

 ➭ rustup show
Default host: x86_64-apple-darwin

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin

active toolchain
----------------

nightly-x86_64-apple-darwin (default)
rustc 1.24.0-nightly (dc39c3169 2017-12-17)

@alexheretic alexheretic reopened this Dec 18, 2017
@alexheretic
Copy link
Member

alexheretic commented Dec 18, 2017

I also get this with the latest nightly Rls (rust 2017-12-17), after building it falls over after a stderr message fatal runtime error: allocator memory exhausted. (Nice use of the new stderr logging though!)

Looks like this is a problem with Rls, which isn't too surprising as the build is failing over there at the moment.

We can use an earlier Rls until nightly is working, e.g. nightly-2017-12-12 works fine for me. Let me know if that's also the case for you guys.

@alexheretic
Copy link
Member

Btw logging/debugging is a little easier with the latest version see https://github.com/mehcode/atom-ide-rust#debugging

@phisk
Copy link

phisk commented Dec 18, 2017

changed to nightly-2017-12-12-x86_64-pc-windows-msvc and it works again. :)
thank you

@alexheretic
Copy link
Member

nightly Rls builds are back and working again

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants