KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.83k stars 153 forks source link

IntellijElixir.DebugServer received unexpected message in handle_info/2: {:tcp_closed, port} #1059

Open menge101 opened 6 years ago

menge101 commented 6 years ago

14:59:06.408 [error] IntellijElixir.DebugServer IntellijElixir.DebugServer received unexpected message in handle_info/2: {:tcp_closed, #Port<0.12574>}

is thrown if I try to debug through IntelliJ.

If I run, there is no issue.

I don't see any particular debug specific configuration that I might have missed in the readme.

KronicDeth commented 6 years ago

The Elixir side is saying the TCP loopback port that the IntelliJ side opens closed. This could mean there was an uncaught exception that killed it OR that when your operating system asked you to allow IntelliJ to listen on a port you denied a request. It's fairly easy to miss the prompt from macOS. I'm not sure what it looks like in other operating systems.

Did you not see any IDE errors from the little red ! in the status bar?

menge101 commented 6 years ago

I am on MacOS, and I'm definetely not seeing a port request. I use debugging through Jetbrains on Pycharm and Rubymine daily, unless IntelliJ uses a different port for it, I'd be surprised the port isn't allowed. Also the firewall is off, so I'm not sure what else might block a port.

I do not see any IDE errors.

Is it possible for the two processes to be looking at different ports? I don't know where port 12574 comes from, and I noticed today its using a different port, 12598. So, I guess that is not something that gets configured?

KronicDeth commented 6 years ago

The port is passed to the mix task:

https://github.com/KronicDeth/intellij-elixir/blob/815c0553d26f58af2cea0a7d77dcb0742d2c52c8/src/org/elixir_lang/debugger/Process.java#L398-L402

The port is generated when the Node is created

https://github.com/KronicDeth/intellij-elixir/blob/815c0553d26f58af2cea0a7d77dcb0742d2c52c8/src/org/elixir_lang/debugger/Node.java#L46-L59

that Future gets a port assigned randomly by passing 0 to the OS.

https://github.com/KronicDeth/intellij-elixir/blob/815c0553d26f58af2cea0a7d77dcb0742d2c52c8/src/org/elixir_lang/debugger/Node.java#L132-L133

KronicDeth commented 6 years ago

@menge101 I need you to supply a public repo to reproduce the problem OR we can pair on Zoom on Friday if you can't make the code public or if the problem is specific to your machine. If you want to pair PM me on Elixir slack.

menge101 commented 6 years ago

Hi @KronicDeth - I see it with this repo: https://github.com/menge101/elixir-sieve

It's just a toy project to learn some elixir. I honestly thought you'd just tell me I missed a config somewhere.

I'd love to pair up to take a look at the issue. I am professionally a software engineer, but not in elixir.