facebook / flow

Adds static typing to JavaScript to improve developer productivity and code quality.
https://flow.org/
MIT License
22.08k stars 1.86k forks source link

error: Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file #5640

Open villesau opened 6 years ago

villesau commented 6 years ago

This happens at least with Flow 0.63.1 when using with IntelliJ or Webstorm and macOS 10.13.2 High Sierra:

Jan 10 15:47:20.320 [info] argv=/path/to/project/node_modules/flow-bin/flow-osx-v0.63.1/flow server /path/to/project
Jan 10 15:47:20.320 [info] Creating a new Flow server
Jan 10 15:47:50.393 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file
Jan 10 15:47:50.394 [error] backtrace:
Jan 10 15:47:50.394 [error] Raised at file "map.ml", line 122, characters 16-25
Jan 10 15:47:50.394 [error] Called from file "src/unix/lwt_engine.ml", line 309, characters 8-36
Jan 10 15:47:50.394 [error] 
Jan 10 15:47:50.394 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
Jan 10 15:48:20.405 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file
Jan 10 15:48:20.405 [error] backtrace:
Jan 10 15:48:20.405 [error] Raised at file "map.ml", line 122, characters 16-25
Jan 10 15:48:20.405 [error] Called from file "src/core/lwt.ml", line 802, characters 20-60
Jan 10 15:48:20.405 [error] 
Jan 10 15:48:20.406 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
Jan 10 15:48:50.415 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file
Jan 10 15:48:50.415 [error] backtrace:
Jan 10 15:48:50.415 [error] Raised at file "map.ml", line 122, characters 16-25
Jan 10 15:48:50.415 [error] Called from file "src/core/lwt.ml", line 802, characters 20-60
Jan 10 15:48:50.415 [error] 
Jan 10 15:48:50.415 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
Jan 10 15:49:21.716 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file
Jan 10 15:49:21.716 [error] backtrace:
Jan 10 15:49:21.716 [error] Raised at file "map.ml", line 122, characters 16-25
Jan 10 15:49:21.716 [error] Called from file "src/unix/lwt_engine.ml", line 309, characters 8-36
Jan 10 15:49:21.716 [error] 
Jan 10 15:49:21.716 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
JCMais commented 6 years ago

Same issue here

brennan-nc commented 6 years ago

I'm seeing the same thing with Webstorm and macOS 10.13.1 High Sierra.

Liu-Young commented 6 years ago

same issue here

mike1808 commented 6 years ago

WebStrom 2017.3.3

$ uname -a
Linux ** 4.13.0-26-generic #29~16.04.2-Ubuntu SMP Tue Jan 9 22:00:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
felippepuhle commented 6 years ago

Same (tested with flow 64 too)

abhishek199-dhn commented 6 years ago

same issue here(flow-bin@0.65.0)

omerbenamram commented 6 years ago

same (webstorm + high sierra + flow-bin@0.65.0)

sibelius commented 6 years ago

same here

mkarazin commented 6 years ago

I was experiencing this issue on WebStorm 2017.1, flow-bin@0.65.0, and macOS Sierra 10.12.6.

After updating WebStorm to 2017.3, the issue has gone away and flowjs intregration is working as expected.

eluchsinger commented 6 years ago

Same here (IntelliJ Ultimate 2017.3.4 + Windows 10 + flow-bin@0.68.0)

dford07 commented 6 years ago

flow, 64bit windows 10 - vscode Closing connection 'server #1' due to uncaught exception in read loop: Unix.Unix_error

gesa commented 6 years ago

flow-bin/flow-osx-v0.66.0; JetBrains IDEA 2018.1; macOS High Sierra 10.13.3

``` Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file ``` ``` Mar 30 11:14:06.232 [info] Creating a new Flow server Mar 30 11:14:37.608 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file Mar 30 11:14:37.608 [error] backtrace: Mar 30 11:14:37.608 [error] Raised at file "map.ml", line 130, characters 10-25 Mar 30 11:14:37.608 [error] Called from file "src/core/lwt.ml", line 817, characters 20-60 Mar 30 11:14:37.608 [error] Mar 30 11:14:37.608 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "") Mar 30 11:14:37.608 [error] backtrace: Mar 30 11:14:37.608 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 1533, characters 2-38 Mar 30 11:14:37.608 [error] Called from file "src/monitor/socketAcceptor.ml", line 180, characters 18-49 Mar 30 11:14:37.608 [error] Mar 30 11:15:40.232 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file Mar 30 11:15:40.232 [error] backtrace: Mar 30 11:15:40.232 [error] Raised at file "map.ml", line 130, characters 10-25 Mar 30 11:15:40.232 [error] Called from file "src/core/lwt.ml", line 817, characters 20-60 Mar 30 11:15:40.232 [error] Mar 30 11:15:40.232 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "") Mar 30 11:15:40.232 [error] backtrace: Mar 30 11:15:40.232 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 1533, characters 2-38 Mar 30 11:15:40.232 [error] Called from file "src/monitor/socketAcceptor.ml", line 180, characters 18-49 Mar 30 11:15:40.232 [error] ```
alaboudi commented 6 years ago

same here

jcham commented 6 years ago

Also still getting this, running latest version of RubyMine.

/Users/jcham/.nvm/versions/node/v6.10.3/bin/node /Users/jcham/Git/CB/calmanac/node_modules/flow-bin/cli.js server /Users/jcham/Git/CB/calmanac
Apr 23 08:10:30.078 [info] argv=/Users/jcham/Git/CB/calmanac/node_modules/flow-bin/flow-osx-v0.65.0/flow server /Users/jcham/Git/CB/calmanac
Apr 23 08:10:30.078 [info] Creating a new Flow server
Apr 23 08:11:00.214 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file
Apr 23 08:11:00.215 [error] backtrace:
Apr 23 08:11:00.215 [error] Raised at file "map.ml", line 130, characters 10-25
Apr 23 08:11:00.215 [error] Called from file "src/core/lwt.ml", line 817, characters 20-60
Apr 23 08:11:00.215 [error] 
Apr 23 08:11:00.215 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
Apr 23 08:11:00.215 [error] backtrace:
Apr 23 08:11:00.215 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 1533, characters 2-38
Apr 23 08:11:00.215 [error] Called from file "src/monitor/socketAcceptor.ml", line 173, characters 18-49
Apr 23 08:11:00.215 [error] 
Apr 23 08:11:30.199 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file
Apr 23 08:11:30.199 [error] backtrace:
Apr 23 08:11:30.199 [error] Raised at file "map.ml", line 130, characters 10-25
Apr 23 08:11:30.199 [error] Called from file "src/core/lwt.ml", line 817, characters 20-60
Apr 23 08:11:30.199 [error] 
Apr 23 08:11:30.199 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
Apr 23 08:11:30.199 [error] backtrace:
Apr 23 08:11:30.199 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 1533, characters 2-38
Apr 23 08:11:30.199 [error] Called from file "src/monitor/socketAcceptor.ml", line 173, characters 18-49
Apr 23 08:11:30.199 [error] 
Apr 23 08:12:00.219 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file
Apr 23 08:12:00.219 [error] backtrace:
Apr 23 08:12:00.219 [error] Raised at file "map.ml", line 130, characters 10-25
Apr 23 08:12:00.219 [error] Called from file "src/core/lwt.ml", line 817, characters 20-60
Apr 23 08:12:00.219 [error] 
Apr 23 08:12:00.219 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
Apr 23 08:12:00.219 [error] backtrace:
Apr 23 08:12:00.219 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 1533, characters 2-38
Apr 23 08:12:00.219 [error] Called from file "src/monitor/socketAcceptor.ml", line 173, characters 18-49
Apr 23 08:12:00.219 [error] 
unscriptable commented 6 years ago

Run flow check and it will tell you which file is crashing flow. Add this file to the [ignore] section of .flowconfig (or fix the error if it's your code) and run flow check again. Repeat until flow runs without crashing.

developer239 commented 6 years ago

This one is still not fixed. 😞

gesa commented 6 years ago

Yeah that's not the solution to this problem, if only it were that straightforward.

v0lume commented 6 years ago

same here

hsinlei commented 6 years ago

same here

mrkev commented 6 years ago

https://github.com/facebook/flow/issues/6424 seems to be the same issue, also with Webstorm.

"same here" doesn't help solve this issue. Please comment your version of flow, editor, and any other information that might help reproduce the error if you have it

zdrazil commented 6 years ago

Same here: flow-bin/flow-osx-v0.74.0; WebStorm 2018.1.5; macOS High Sierra 10.13.6

Any other info I can provide?

mrkev commented 6 years ago

@zdrazil that's good, thanks! Out of curiosity, when did the problem start? Was it there from the beginning or did it come once your project reached a certain size / you imported some package / etc?

mrkev commented 6 years ago

Also curious-- has anyone submitted this bug report to WebStorm and got a response? I haven't seen reports for this bug pertaining to VSCode or Atom, so I'm almost certain this is an issue with the editor.

prigara commented 6 years ago

@mrkev the issue is logged as https://youtrack.jetbrains.com/issue/WEB-30296 on the WebStorm tracker. There’s a comment above mentioning the problem occurring in VS Code as well. To our knowledge, the problem lies on the Flow side. It seems that WebStorm uses some Flow’s methods in its integration with the Flow service that trigger the problem. Probably other editors don’t use these methods as much as we do, but we can’t say for sure what exactly should be changed on our side to work around the problem. We are considering re-implementing the integration using the new LSP APIs introduced in Flow recently. And we hope that it will help us resolve this issue. Please note that we haven’t started working on that yet and we don’t know the state of the new API.

loginov-rocks commented 6 years ago

Same here, details:

IntelliJ IDEA 2018.2.2 (Ultimate Edition) Build #IU-182.4129.33, built on August 21, 2018 Windows 10 10.0

"flow-bin": "^0.80.0"

.flowconfig in the project root:

[ignore]
<PROJECT_ROOT>/.idea/.*
<PROJECT_ROOT>/android/.*
<PROJECT_ROOT>/docs/.*
<PROJECT_ROOT>/ios/.*
<PROJECT_ROOT>/node_modules/.*
<PROJECT_ROOT>/plugins/.*

[include]

[libs]

[lints]

[options]

[strict]

Also Flow console reports about Sep 3 20:28:59.101 [info] File watcher reported 19 files changed when only one file has been changed as in #6424

villesau commented 5 years ago

Similar problem still happens with 0.84.0:

/Users/path/to/project/node_modules/flow-bin/vendor/flow server /Users/path/to/project
Nov  2 11:29:11.758 [info] argv=/Users/path/to/project/node_modules/flow-bin/flow-osx-v0.84.0/flow server /Users/path/to/project
Nov  2 11:29:11.759 [info] Creating a new Flow server
Nov  2 11:29:24.421 [info] File watcher reported 4 files changed
Nov  2 11:29:41.854 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: End_of_file
Nov  2 11:29:41.854 [error] backtrace:
Nov  2 11:29:41.854 [error] Raised at file "map.ml", line 130, characters 10-25
Nov  2 11:29:41.854 [error] Called from file "src/unix/lwt_engine.ml", line 318, characters 8-36
Nov  2 11:29:41.854 [error] 
Nov  2 11:29:41.854 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
Nov  2 11:29:41.854 [error] backtrace:
Nov  2 11:29:41.854 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 1533, characters 2-38
Nov  2 11:29:41.854 [error] Called from file "src/monitor/socketAcceptor.ml", line 148, characters 18-49
Nov  2 11:29:41.854 [error] 
Nov  2 11:29:46.673 [error] Closing connection 'server #1' due to uncaught exception in read loop: End_of_file
Nov  2 11:29:46.673 [error] backtrace:
Nov  2 11:29:46.673 [error] Raised at file "map.ml", line 130, characters 10-25
Nov  2 11:29:46.673 [error] Called from file "src/unix/lwt_engine.ml", line 318, characters 8-36
Nov  2 11:29:46.673 [error] 
Unable to obtain kernel buffer: Operation not permitted
usage: sudo dmesg
Nov  2 11:29:46.690 [error] Flow server (pid 34338) exited with code Unknown_error (110)
Nov  2 11:29:46.690 [info] Monitor is exiting (Dying along with server)
Nov  2 11:29:46.690 [info] Broadcasting to threads and waiting 1 second for them to exit

and:

/Users/path/to/project/node_modules/flow-bin/vendor/flow server /Users/path/to/project
Nov  2 11:38:34.590 [info] argv=/Users/path/to/project/node_modules/flow-bin/flow-osx-v0.84.0/flow server /Users/path/to/project
Nov  2 11:38:34.590 [info] Creating a new Flow server
Nov  2 11:39:03.533 [info] File watcher reported 3 files changed
Nov  2 11:39:05.541 [info] File watcher reported 1 file changed
Nov  2 11:39:07.427 [error] Closing connection 'server #1' due to uncaught exception in read loop: End_of_file
Nov  2 11:39:07.427 [error] backtrace:
Nov  2 11:39:07.427 [error] Raised at file "map.ml", line 130, characters 10-25
Nov  2 11:39:07.427 [error] Called from file "src/unix/lwt_engine.ml", line 318, characters 8-36
Nov  2 11:39:07.427 [error] 
Unable to obtain kernel buffer: Operation not permitted
usage: sudo dmesg
Nov  2 11:39:07.443 [error] Flow server (pid 37074) exited with code Unknown_error (110)
Nov  2 11:39:07.443 [info] Monitor is exiting (Dying along with server)
Nov  2 11:39:07.443 [info] Broadcasting to threads and waiting 1 second for them to exit

This completely breaks Flow support in IntelliJ IDEA.

I had one yarn linked package and when unlinked that, flow started to work normally again.

masylum commented 5 years ago

We started having this issue when jumping to babel 7.

villesau commented 5 years ago

I think this might not happen anymore? 🤔Anyone still experiencing this with recent Flows?

PavelVanecek commented 4 years ago

I am getting this error on my machine now.

Flow, a static type checker for JavaScript, version 0.121.0

IntelliJ IDEA 2019.3.3 (Ultimate Edition)
Build #IU-193.6494.35, built on February 11, 2020
Licensed to

Runtime version: 11.0.5+10-b520.38 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6
GC: ParNew, ConcurrentMarkSweep
Memory: 4012M
Cores: 12
Registry: javascript.flow.use.lsp=false (I tried with both true and false)
Non-Bundled Plugins: CheckStyle-IDEA, R4Intellij, com.alayouni.ansiHighlight, com.google.bamboo.id, com.intellij.ideolog, com.intellij.lang.jsgraphql, com.jetbrains.plugins.ini4idea, org.intellij.plugins.hcl, org.jetbrains.kotlin, some.awesome

Logs from intellij:

Apr  3 10:23:25.667 [info] argv=/node_modules/flow-bin/flow-osx-v0.121.0/flow server /
Apr  3 10:23:25.667 [info] lazy_mode=off
Apr  3 10:23:25.667 [info] arch=classic
Apr  3 10:23:25.667 [info] abstract_locations=off
Apr  3 10:23:25.667 [info] max_workers=12
Apr  3 10:23:25.667 [info] Creating a new Flow server
Apr  3 10:23:55.993 [error] Connection 'some ephemeral connection' was closed from the other side
Apr  3 10:23:55.993 [error] Failed to shutdown socket client: Unix.Unix_error(Unix.ENOTCONN, "shutdown", "")
Apr  3 10:23:55.993 [error] backtrace:
Apr  3 10:23:55.993 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 1656, characters 2-38
Apr  3 10:23:55.993 [error] Called from file "src/monitor/socketAcceptor.ml", line 148, characters 18-49
Apr  3 10:23:55.993 [error] 
Apr  3 10:24:10.427 [info] File watcher reported 2 files changed

Everything works fine when running from command line directly. (I'm not quite sure if this is intellij problem or flow problem. But I found this thread so here I am!)