Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to Elixir or Erlang node with OTP 23 fails due to missing capabilities BIG_CREATION, UTF8_ATOMS, NEW_FUN_TAGS #12

Open
dg1sbg opened this issue Jun 30, 2020 · 4 comments

Comments

@dg1sbg
Copy link

dg1sbg commented Jun 30, 2020

While connecting to an Elixir node (based on Erlang/OTP 23) I get:

On the Elixir node in iex:
"08:08:43.722 [error] ** :"[email protected]": Connection attempt from node :lispnode@localhost rejected since it cannot handle ['BIG_CREATION', 'UTF8_ATOMS', 'NEW_FUN_TAGS'].**"

On the Lisp side (AllegroCL 10.1 Enterprise Edition):
#<HANDSHAKE-FAILED-ERROR @ #x100079433f2>
[Condition of type COMMON-LISP-ERLANG-INTERFACE:HANDSHAKE-FAILED-ERROR]

Backtrace:
0: (ERROR COMMON-LISP-ERLANG-INTERFACE:HANDSHAKE-FAILED-ERROR :REASON "Connection not allowed")
Locals:
EXCL::DATUM = COMMON-LISP-ERLANG-INTERFACE:HANDSHAKE-FAILED-ERROR
EXCL::ARGUMENTS = (:REASON "Connection not allowed")
EXCL::LOCAL-0 = (:REASON "Connection not allowed")
(:DEAD EXCL::LOCAL-1) = COMMON-LISP-ERLANG-INTERFACE:HANDSHAKE-FAILED-ERROR
(:DEAD EXCL::LOCAL-2) = #(22659694466373723 T (CLERIC-HANDSHAKE-PROTOCOL::MESSAGE-LENGTH CLERIC-HANDSHAKE-PROTOCOL::TAG CLERIC-HANDSHAKE-PROTOCOL:STATUS) #() # 0 ...)
(:DEAD EXCL::LOCAL-3) = #<COMMON-LISP-ERLANG-INTERFACE:HANDSHAKE-FAILED-ERROR @ #x100079433f2>
(:DEAD EXCL::LOCAL-4) = 97
:UNKNOWN = NIL

I truly need this to work. May I get support on enabling these features?
Thank you!

// Frank

@flambard
Copy link
Owner

Hi,

Thanks for reporting this!

It has been a long time since I touched this code, but I will try to solve it. Looks like the protocol has been extended with a couple new types that needs to be added to https://github.com/flambard/cl-erlang-term

@dg1sbg
Copy link
Author

dg1sbg commented Jun 30, 2020

@flambard

Hi Markus,

I really appreciate your help here. I was really surprised to get an immediate reply here, given that you hadn't changed anything for a few years here. As Elixir and so the Erlang VM are getting more attraction and more and more apps are built based on those, I see a need to make Lisp a good citizen and keep up with Erlang developments. So: Big thanks!! If you want me to take over some parts I am really open to dive in deep.

Regards
Frank
(a.k.a frgo on IRC).

@igoralmeida
Copy link

igoralmeida commented Dec 31, 2022

Hi all,

I took a stab at this with #14 and flambard/cl-erlang-term#7

Tested with IEx 1.14.0 (compiled with Erlang/OTP 25).
Here's some auxiliary code:

(defvar *msg-queue* (list))
;;... other defvars for *elx-node-name* and *cookie*

(defun keepalive-thread ()
  (loop doing
    (let ((msgs (cleric:receive-node-messages)))
      (when (> (length msgs) 0)
        (format t "got messages!")
        (push msgs *msg-queue*)))))

#|
;; connect
(let ((node (cleric-epmd:lookup-node *elx-node-name*)))
   (cleric:remote-node-connect node *cookie*))

;; use a separate thread to respond to tick messages
(bt:make-thread #'keepalive-thread :name "keepalivethread")

;; send a message to a registered process on the elixir side
(let ((local-pid (cleric:make-pid)))
  (cleric:reg-send local-pid "iex_cl_receiver" *elx-node-name* "Hello from CL, elixir!"))
|#
defmodule ClericTest.Cl do

  def myinit() do
    pid = spawn(__MODULE__, :iex_receiver, [])
    Process.register(pid, :iex_cl_receiver)
  end

  def iex_receiver() do
    receive do
      msg -> IO.puts(msg)
    end
    iex_receiver()
  end

end

Then ClericTest.Cl.myinit() and send({:one,:"lispnode@localhost"}, {:two,:three,"four"}) in iex to send messages to CL.

Hope this helps.

@muswawir
Copy link

muswawir commented Jul 6, 2023

Only utf8_atoms and maps as far as I can tell, are missing in cl-erlang-term, the distribution protocal was updated in otp-23 and compatibility with the old version was removed in otp-25. To resolve the issues, the distribution protocal handshake in cleric needs to be updated to that of otp-25, utf8_atom support added to cl-erlang-term, cl-epmd still works fine.

Compatibility with versions less than otp-23 will be lost.

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

No branches or pull requests

4 participants