andytill / erlyberly

erlang tracing for the masses
https://twitter.com/erlyberlytips
GNU General Public License v3.0
693 stars 43 forks source link

Cannot connect to Elixir instance (Elixir 1.5.2 & Erlang 20.1.5) #156

Closed ghost closed 7 years ago

ghost commented 7 years ago

Tried connecting to a running iex instance - GUI Message "Cannot connect to peer node"

But confirmed the node could be ping'd etc.

(test@127.0.0.1)3> net:ping('blah@127.0.0.0.1').
pong
iex(blah@127.0.0.0.1)3> :net.ping(:'test@127.0.0.1')
:pong
iex(blah@127.0.0.0.1)5> :erlang.get_cookie          
:test_cookie
iex(blah@127.0.0.0.1)6> :erlang.node                
:"blah@127.0.0.0.1"

Steps to run - and exception on CLI.

git pull origin && ./mvnw clean compile install assembly:single && java -jar target/*runnable.jar
Already up-to-date.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building erlyberly 0.7.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ erlyberly ---
[INFO] Deleting /common/erlyberly/target
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (validate) @ erlyberly ---
[INFO] Starting audit...
Audit done.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ erlyberly ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ erlyberly ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 51 source files to /common/erlyberly/target/classes
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (Version Calculation) @ erlyberly ---
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (validate) @ erlyberly ---
[INFO] Starting audit...
Audit done.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ erlyberly ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ erlyberly ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (Version Calculation) @ erlyberly ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ erlyberly ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /common/erlyberly/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ erlyberly ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /common/erlyberly/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ erlyberly ---
[INFO] Surefire report directory: /common/erlyberly/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running erlyberly.BasicSearchTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.067 sec
Running erlyberly.node.OtpUtilTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec

Results :

Tests run: 16, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ erlyberly ---
[INFO] Building jar: /common/erlyberly/target/erlyberly-0.7.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ erlyberly ---
[INFO] Installing /common/erlyberly/target/erlyberly-0.7.1-SNAPSHOT.jar to /Users/bryanhunt/.m2/repository/andytill/erlyberly/0.7.1-SNAPSHOT/erlyberly-0.7.1-SNAPSHOT.jar
[INFO] Installing /common/erlyberly/pom.xml to /Users/bryanhunt/.m2/repository/andytill/erlyberly/0.7.1-SNAPSHOT/erlyberly-0.7.1-SNAPSHOT.pom
[INFO]
[INFO] --- maven-assembly-plugin:2.4.1:single (default-cli) @ erlyberly ---
[INFO] Building jar: /common/erlyberly/target/erlyberly-0.7.1-SNAPSHOT-runnable.jar
[WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing.
Instead of attaching the assembly file: /common/erlyberly/target/erlyberly-0.7.1-SNAPSHOT-runnable.jar, it will become the file for main project artifact.
NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!
[WARNING] Replacing pre-existing project main-artifact file: /common/erlyberly/target/erlyberly-0.7.1-SNAPSHOT.jar
with assembly file: /common/erlyberly/target/erlyberly-0.7.1-SNAPSHOT-runnable.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.334 s
[INFO] Finished at: 2017-11-15T22:30:50+00:00
[INFO] Final Memory: 28M/95M
[INFO] ------------------------------------------------------------------------
Exception in thread "Timer-0" java.lang.ExceptionInInitializerError
        at com.moandjiezana.toml.TomlWriter.write(TomlWriter.java:153)
        at com.moandjiezana.toml.TomlWriter.write(TomlWriter.java:140)
        at erlyberly.PrefBind.store(PrefBind.java:101)
        at erlyberly.PrefBind$1.run(PrefBind.java:59)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: java.lang.NullPointerException
        at com.moandjiezana.toml.ValueWriters.getPlatformSpecificDateConverter(ValueWriters.java:30)
        at com.moandjiezana.toml.ValueWriters.<clinit>(ValueWriters.java:33)
        ... 6 more
Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: The MacPasteboard is not valid
        at javafx.graphics/com.sun.glass.ui.mac.MacPasteboard.assertValid(MacPasteboard.java:201)
        at javafx.graphics/com.sun.glass.ui.mac.MacPasteboard.getSeed(MacPasteboard.java:179)
        at javafx.graphics/com.sun.glass.ui.mac.MacSystemClipboard.isOwner(MacSystemClipboard.java:78)
        at javafx.graphics/com.sun.glass.ui.SystemClipboard.getMimeTypes(SystemClipboard.java:81)
        at javafx.graphics/com.sun.glass.ui.ClipboardAssistance.getMimeTypes(ClipboardAssistance.java:140)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumClipboard.hasContent(QuantumClipboard.java:513)
        at javafx.graphics/javafx.scene.input.Clipboard.hasContent(Clipboard.java:294)
        at javafx.graphics/javafx.scene.input.Clipboard.hasString(Clipboard.java:303)
        at javafx.controls/javafx.scene.control.TextInputControl.paste(TextInputControl.java:631)
        at javafx.controls/com.sun.javafx.scene.control.behavior.TextInputControlBehavior.paste(TextInputControlBehavior.java:528)
        at javafx.controls/com.sun.javafx.scene.control.behavior.TextInputControlBehavior.lambda$new$20(TextInputControlBehavior.java:159)
        at javafx.controls/com.sun.javafx.scene.control.behavior.TextInputControlBehavior.lambda$keyMapping$62(TextInputControlBehavior.java:330)
        at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
        at javafx.graphics/javafx.scene.Scene$KeyHandler.process(Scene.java:4083)
        at javafx.graphics/javafx.scene.Scene$KeyHandler.access$1600(Scene.java:4029)
        at javafx.graphics/javafx.scene.Scene.processKeyEvent(Scene.java:2146)
        at javafx.graphics/javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2620)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:217)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:149)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(GlassViewEventHandler.java:248)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:247)
        at javafx.graphics/com.sun.glass.ui.View.handleKeyEvent(View.java:547)
        at javafx.graphics/com.sun.glass.ui.View.notifyKey(View.java:971)
Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: The MacPasteboard is not valid
        at javafx.graphics/com.sun.glass.ui.mac.MacPasteboard.assertValid(MacPasteboard.java:201)
        at javafx.graphics/com.sun.glass.ui.mac.MacPasteboard.getSeed(MacPasteboard.java:179)
        at javafx.graphics/com.sun.glass.ui.mac.MacSystemClipboard.isOwner(MacSystemClipboard.java:78)
        at javafx.graphics/com.sun.glass.ui.SystemClipboard.getMimeTypes(SystemClipboard.java:81)
        at javafx.graphics/com.sun.glass.ui.ClipboardAssistance.getMimeTypes(ClipboardAssistance.java:140)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumClipboard.hasContent(QuantumClipboard.java:513)
        at javafx.graphics/javafx.scene.input.Clipboard.hasContent(Clipboard.java:294)
        at javafx.graphics/javafx.scene.input.Clipboard.hasString(Clipboard.java:303)
        at javafx.controls/com.sun.javafx.scene.control.behavior.TextInputControlBehavior.populateContextMenu(TextInputControlBehavior.java:700)
        at javafx.controls/com.sun.javafx.scene.control.behavior.TextFieldBehavior.contextMenuRequested(TextFieldBehavior.java:377)
        at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
        at javafx.graphics/javafx.scene.Scene.processMenuEvent(Scene.java:1914)
        at javafx.graphics/javafx.scene.Scene.access$4500(Scene.java:173)
        at javafx.graphics/javafx.scene.Scene$ScenePeerListener.menuEvent(Scene.java:2635)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMenuEvent$3(GlassViewEventHandler.java:471)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMenuEvent$4(GlassViewEventHandler.java:451)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMenuEvent(GlassViewEventHandler.java:450)
        at javafx.graphics/com.sun.glass.ui.View.handleMenuEvent(View.java:564)
        at javafx.graphics/com.sun.glass.ui.View.notifyMenu(View.java:894)
java.io.IOException: Cannot connect to peer node
        at com.ericsson.otp.erlang.AbstractConnection.doConnect(AbstractConnection.java:1010)
        at com.ericsson.otp.erlang.AbstractConnection.<init>(AbstractConnection.java:203)
        at com.ericsson.otp.erlang.OtpConn.<init>(OtpConn.java:29)
        at com.ericsson.otp.erlang.OtpSelfNode.connect(OtpSelfNode.java:37)
        at erlyberly.node.NodeAPI.connect(NodeAPI.java:212)
        at erlyberly.node.NodeAPI.manualConnect(NodeAPI.java:191)
        at erlyberly.ConnectionView.lambda$onConnect$2(ConnectionView.java:96)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:299)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.io.IOException: Handshake failed - peer has wrong name: blah@127.0.0.0.1
        at com.ericsson.otp.erlang.AbstractConnection.recvChallenge(AbstractConnection.java:1204)
        at com.ericsson.otp.erlang.AbstractConnection.doConnect(AbstractConnection.java:997)
        ... 12 more
java.io.IOException: Cannot connect to peer node
        at com.ericsson.otp.erlang.AbstractConnection.doConnect(AbstractConnection.java:1010)
        at com.ericsson.otp.erlang.AbstractConnection.<init>(AbstractConnection.java:203)
        at com.ericsson.otp.erlang.OtpConn.<init>(OtpConn.java:29)
        at com.ericsson.otp.erlang.OtpSelfNode.connect(OtpSelfNode.java:37)
        at erlyberly.node.NodeAPI.connect(NodeAPI.java:212)
        at erlyberly.node.NodeAPI.manualConnect(NodeAPI.java:191)
        at erlyberly.ConnectionView.lambda$onConnect$2(ConnectionView.java:96)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:299)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.io.IOException: Handshake failed - peer has wrong name: blah@127.0.0.0.1
        at com.ericsson.otp.erlang.AbstractConnection.recvChallenge(AbstractConnection.java:1204)
        at com.ericsson.otp.erlang.AbstractConnection.doConnect(AbstractConnection.java:997)
        ... 12 more
ghost commented 7 years ago

Incidentally, I'd attach a screenshot but github's telling me, "Something went really wrong, and we can't process that file??" ha ha.

Anyway, I could connect to an Erlang instance 'test@127.0.0.1' - worked great - but 'blah@127.0.0.1' it just doesn't like.

ghost commented 7 years ago

Can't reproduce it again.. weird.

ghost commented 7 years ago
screen shot 2017-11-15 at 22 35 53
andytill commented 7 years ago

You have an extra zero in your node name ip.

iex(blah@127.0.0.0.1)6> :erlang.node
:"blah@127.0.0.0.1"

ghost commented 7 years ago

??? how did it ever resolve? thanks @andytill

andytill commented 7 years ago

No worries, maybe it parsed as a hostname because it didn't fit the 4 char format.