Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught Error: Connection is closed. #29

Closed
markedup opened this issue Sep 25, 2017 · 10 comments
Closed

Uncaught Error: Connection is closed. #29

markedup opened this issue Sep 25, 2017 · 10 comments

Comments

@markedup
Copy link

markedup commented Sep 25, 2017

  1. Clean install of Atom Beta
  2. Installed ide-java package; restarted Atom Beta
  3. Error on open

Atom: 1.21.0-beta1 x64
Electron: 1.6.9
OS: Mac OS X 10.12.6
Thrown From: ide-java package 0.6.0

Stack Trace

Uncaught Error: Connection is closed.

At /Users/pete/.atom/packages/ide-java/node_modules/vscode-jsonrpc/lib/main.js:604

Error: Connection is closed.
    at /packages/ide-java/node_modules/vscode-jsonrpc/lib/main.js:129:28)
    at throwIfClosedOrDisposed (/packages/ide-java/node_modules/vscode-jsonrpc/lib/main.js:604:19)
    at Object.sendNotification (/packages/ide-java/node_modules/vscode-jsonrpc/lib/main.js:658:13)
    at LanguageClientConnection._sendNotification (/packages/ide-java/node_modules/atom-languageclient/build/lib/languageclient.js:231:15)
    at LanguageClientConnection.didChangeTextDocument (/packages/ide-java/node_modules/atom-languageclient/build/lib/languageclient.js:124:10)
    at TextEditorSyncAdapter.sendFullChanges (/packages/ide-java/node_modules/atom-languageclient/build/lib/adapters/document-sync-adapter.js:183:22)
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at /Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:626:38
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:141:34)
    at DisplayLayer.emitDidChangeSyncEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/display-layer.js:823:24)
    at decorationLayerDisposable.textDecorationLayer.onDidInvalidateRange (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/display-layer.js:161:20)
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at TokenizedBuffer.module.exports.TokenizedBuffer.tokenizeNextChunk (/Applications/Atom Beta.app/Contents/Resources/app/src/tokenized-buffer.js:241:28)
    at /Applications/Atom Beta.app/Contents/Resources/app/src/tokenized-buffer.js:206:32
    at /Applications/Atom Beta.app/Contents/Resources/app/node_modules/underscore/underscore.js:666:53

Commands

Non-Core Packages

atom-ide-ui 0.3.3 
ide-java 0.6.0 
ide-typescript 0.6.1 
@rsese
Copy link

rsese commented Sep 25, 2017

Thanks for the report! I just installed ide-java on macOS 10.12.6 with 1.21.0-beta0 but couldn't reproduce - is the error reproducible for you @markedup?

@damieng
Copy link
Contributor

damieng commented Sep 25, 2017

Hopefully if you get this again with the latest version of ide-java v0.6.2 an error message should be displayed with information that will help us further diagnose what went wrong.

@markedup
Copy link
Author

Thanks, I'll try upgrading the package and seeing what happens.

@markedup
Copy link
Author

markedup commented Sep 26, 2017

Prompted to upgrade to the following packages:

  1. atom-ide 0.4.0 [amended]
  2. ide-java 0.6.2

Restarted Atom when prompted, still getting the same "Connection is closed" error.

@markedup
Copy link
Author

markedup commented Sep 26, 2017

Tried a clean reinstall as follows:

  1. Removed Atom Beta v1.21.0-beta1 x64 using AppCleaner (all choices/traces selected)
  2. Wiped all Atom user preferences via Terminal: rm -rf ~/.atom
  3. Restarted macOS (because why not)
  4. Installed fresh download of Atom Beta v1.21.0-beta1 x64
  5. Installed atom-ide v0.4.0 package via Atom Beta UI; quit and relaunched Atom Beta
  6. Open file within project, no error
  7. Installed ide-java v0.6.2 package via Atom Beta UI; quit and relaunched Atom Beta
  8. Open file within project, no error

So whatever wrinkle was in my system seems to have been fixed in the above steps.

@markedup markedup reopened this Sep 26, 2017
@markedup
Copy link
Author

markedup commented Sep 26, 2017

Ah ha! So I just enabled "Show Indent Guide" in Atom's preferences, and ide-java instantly threw the same error again.

And it seems to be continuously throwing this same error on file open now, regardless of whether the option is enabled or not.

Something to do with syntax parsing maybe?

@damieng
Copy link
Contributor

damieng commented Sep 26, 2017

Just tried toggling it several times and haven't crashed.

Once the server crashes you'll get the "connection is closed" error until you restart Atom. We need better error recovery there although obviously I'd really like to find out exactly what is causing the language server to crash in the first place.

Have you enabled atom.config.get('core.debugLSP', true) ? If so you can see more detailed information in the dev tools window - there might be some useful information in there around the time things start failing. It will also be useful to see the "pid" number on the "starting server" message to see if it's still running - will indicate if the background process actually crashes or whether the connection closed independently for some other reason.

Thanks for bearing with us in these early releases!

@hellonico
Copy link

the server never starts for me, Eclipse JDT is always stopped.
Windows 10, x86_64

Tried uninstall, clean re-install etc... to no avail.
I was looking for a log file but can't seem to be able to find one.
Any possible hint to start helping?

@blalan
Copy link

blalan commented Nov 6, 2017

This error is also displaying for me, to the effect that I can no longer edit a file. All key presses add another error to the side and block editing. Here is the stack trace:

Atom: 1.22.0-beta2 x64
Electron: 1.6.15
OS: Microsoft Windows 10 Home
Thrown From: ide-java package 0.6.7

Stack Trace

Uncaught Error: Connection is closed.

At C:\Users\ {Username} \.atom\packages\ide-java\node_modules\vscode-jsonrpc\lib\main.js:606

Error: Connection is closed.
    at /packages/ide-java/node_modules/vscode-jsonrpc/lib/main.js:131:28)
    at throwIfClosedOrDisposed (/packages/ide-java/node_modules/vscode-jsonrpc/lib/main.js:606:19)
    at Object.sendNotification (/packages/ide-java/node_modules/vscode-jsonrpc/lib/main.js:660:13)
    at LanguageClientConnection._sendNotification (/packages/ide-php/node_modules/atom-languageclient/build/lib/languageclient.js:244:15)
    at LanguageClientConnection.didChangeTextDocument (/packages/ide-php/node_modules/atom-languageclient/build/lib/languageclient.js:133:10)
    at TextEditorSyncAdapter.sendFullChanges (/packages/ide-php/node_modules/atom-languageclient/build/lib/adapters/document-sync-adapter.js:183:22)
    at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at ~/AppData/Local/atom/app-1.22.0-beta2/resources/app/src/text-editor.js:641:38
    at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at DisplayLayer.emitDidChangeSyncEvent (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/text-buffer/lib/display-layer.js:825:24)
    at ~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/text-buffer/lib/text-buffer.js:780:35
    at Map.forEach (native)
    at TextBuffer.module.exports.TextBuffer.emitDidChangeEvent (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/text-buffer/lib/text-buffer.js:779:47)
    at TextBuffer.module.exports.TextBuffer.applyChange (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/text-buffer/lib/text-buffer.js:762:18)
    at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/text-buffer/lib/text-buffer.js:1001:22)
    at TextBuffer.module.exports.TextBuffer.transact (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/text-buffer/lib/text-buffer.js:955:20)
    at TextEditor.module.exports.TextEditor.transact (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/src/text-editor.js:1687:32)
    at ~/AppData/Local/atom/app-1.22.0-beta2/resources/app/src/text-editor.js:1248:30
    at TextEditor.module.exports.TextEditor.mergeSelections (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/src/text-editor.js:2631:49)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/src/text-editor.js:2597:41)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/src/text-editor.js:1246:25)
    at TextEditor.module.exports.TextEditor.insertText (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/src/text-editor.js:1212:25)
    at TextEditor.object.(anonymous function) [as insertText] (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
    at TextEditorComponent.didTextInput (~/AppData/Local/atom/app-1.22.0-beta2/resources/app/src/text-editor-component.js:1630:30)

Commands

  6x -2:21.5.0 core:move-right (input.hidden-input)
     -2:16.2.0 core:delete (input.hidden-input)
     -2:12.7.0 core:move-right (input.hidden-input)
 17x -2:11.9.0 core:select-right (input.hidden-input)
  2x -2:09.0 core:delete (input.hidden-input)
     -2:05.6.0 core:move-right (input.hidden-input)
     -2:04.7.0 core:move-left (input.hidden-input)
     -2:02.7.0 core:backspace (input.hidden-input)
     -2:00.7.0 core:save (input.hidden-input)
     -1:44.9.0 emmet:insert-formatted-line-break-only (input.hidden-input)
     -1:44.9.0 editor:newline (input.hidden-input)
     -1:32.1.0 core:save (input.hidden-input)
     -1:28.3.0 emmet:insert-formatted-line-break-only (input.hidden-input)
     -1:28.3.0 editor:newline (input.hidden-input)
     -1:15.5.0 editor:toggle-soft-wrap (div.tool-panel.tree-view)
     -0:02.4.0 core:focus-next (a.btn-copy-report.icon.icon-clippy)

Non-Core Packages

apex-syntax 0.2.0 
apex-ui 1.0.2 
atom-ide-ui 0.5.4 
dash-syntax 0.4.1 
dash-ui 0.4.4 
emmet 2.4.3 
ide-java 0.6.7 
ide-json 0.1.0 
ide-php 0.6.9 
ide-python 0.2.3 
ide-typescript 0.6.2 
language-vue-component 0.5.0 
vue2-autocomplete 0.1.0-alpha.4 

@damieng
Copy link
Contributor

damieng commented Feb 27, 2018

Various improvements behind the scenes should have resolved these kinds of issues. Please let us know if that's not the case.

@damieng damieng closed this as completed Feb 27, 2018
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

5 participants