noelob
Hi,
I’ve created a simple cluster by opening 2 IEX sessions on two different machines, and I can see the the nodes are clustered:
iex(dev@127.0.0.1)11> Node.list [:this, :visible]
[:"suv@127.0.0.1", :"dev@127.0.0.1"]
When I try running a simple process on the other node, I get this error:
iex(dev@127.0.0.1)7> caller = self()
#PID<0.115.0>
iex(dev@127.0.0.1)8> Node.spawn(:"suv@127.0.0.1", fn -> send(caller, {:response, 1+2}) end)
#PID<14963.130.0>
11:43:45.064 [error] Process #PID<14963.130.0> on node :"suv@127.0.0.1" raised an exception
** (BadFunctionError) function #Function<43.125776118/0 in :erl_eval.expr/6> is invalid, likely because it points to an old version of the code
:erlang.apply/2
iex(dev@127.0.0.1)9> nil
The error implies :erl_eval.expr/6 is missing, so my first guess was differing versions of Elixir and/or Erlang/OTP on each node, but both have elixir 1.15 and OPT 26 as far as I can tell:
Node A:
iex(dev@127.0.0.1)6> System.build_info
%{
version: "1.15.5",
date: "2023-08-28T11:58:30Z",
otp_release: "26",
build: "1.15.5 (compiled with Erlang/OTP 26)",
revision: "9fd97c4"
}
Node B:
iex(suv@127.0.0.1)15> System.build_info
%{
version: "1.15.8",
date: "2024-11-12T06:54:38Z",
otp_release: "26",
build: "1.15.8 (compiled with Erlang/OTP 26)",
revision: ""
}
When I use tab completion on :erl_eval.expr in IEX there is no :erl_eval.expr/6. Any idea what I might be doing wrong?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
ruslandoga
What happens if you try
?
Re
erl_evalin#Function<43.125776118/0 in :erl_eval.expr/6>I think it just means that the anonymous function was defined in IEx. It might or might not mean thaterl_evalis the problem. It might as well beKernel.send/1, if that module / function were updated between 1.15.5 and 1.15.8, which they probably were, at least in “version”.noelob
That worked, thanks!
For my own curiosity, how could I verify where the issue might lie? Look at the Kernel.send source code for each of the Elixir versions or is there a better way?
ruslandoga
I would guess that the closures capture module versions (MD5 by default) in addition to module and function names and since they are different in different versions of Elixir, it results in an error. And maybe sending
Node.spawn(:"suv@127.0.0.1", Kernel, :send, [caller, {:response, 1+2}])doesn’t concern itself with module versions and just runsapply(Kernel, :send, [caller, {:response, 1+2}])so it works across Elixir versions. But it can possibly produce different results from if this was executed locally. But I guess that’s usually expected with distributed systems.ruslandoga
erlang — OTP 29.0.2 (erts 17.0.2) seems to support this guess:
That version seems to be stored in
:new_uniqattribute. Maybe it does some rolling hash of the versions of all the modules mentioned in the function body.noelob
When spawning a remote process like this, does the ‘work’ (1+2 in this case) get evaluated on the local node?
I’d like the ‘work’ to be evaluated on the remote node, and when I replace
1+2withNode.self(), it appears thatNode.self()is evaluated locally, and that the remote node is sending the already computed value back to the local node:I’m a relative Elixir noob, so not quite grasping how to make the remote node do the work
Thanks for your help
ruslandoga
Arguments (it’s just a normal list) are “evaluated” on the calling node, the function is executed on the remote node.
It’s the same as:
You can make the called function process its args and then that part would be handled by the remote node too:
:erpc.callhere just executes the function remotely and sends back the results, similar to yourNode.spawnexample withsend. I just wanted to mention it as it’s a pretty useful module.noelob
Cool, that’s what I figured. So you either need code on the remote node which you can invoke from the local node, or pass a function to the remote node (assuming both nodes have compatible versions).
Thanks for the tip on
:erpc.call, that looks pretty useful