I can connect to the remote iex session just fine, but I can’t actually run any code there. Anything I do, at all, coughs up the following error message:
(ArgumentError) could not fetch application environment :parser for application :iex because the application was not loaded nor configured
(elixir 1.19.0-rc.0) lib/application.ex:775: Application.fetch_env!/2
I’m not seeing anywhere in the documentation where you’re supposed to set something up special in your configuration in order to be able to run iex remotely, it seems like it’s supposed to Just Work, and I’m far out of my depths in terms of trying to debug this or figure out what in the world is configured incorrectly.
Hi… It did Just Work back when I tried it a couple years ago; there wasn’t any extra configuration required.
fly launch is rather heuristic, though, and it’s been known to miss things in more niche and/or bleeding-edge Elixir setups in the past.
Perhaps you could say more about your app and the exact commands that you used? (Your post title doesn’t match the recommended IEx invocation, for example: fly ssh console --pty -C "/app/bin/hello_elixir remote".)
That is, in fact, the invocation I used, and it’s obviously connecting to AN instance of iex.
I don’t think I’m doing anything particularly insane, although I’m resurrecting a project and environment that I haven’t significantly touched in 2 years onto a different VM entirely and I’ve run into various bumpinesses of the process along the way. I’m not exactly sure what I could provide that would help debug the issue.
It’s up to you, but it’s often useful to see the full IEx startup banner. E.g.,
Erlang/OTP 25 [erts-13.1.5] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.14.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
There was a recent change in Erlang/OTP around multi-line editing, if I recall correctly.
And if your deployment 2 years ago was also on Fly.io and you still have that image in the registry (fly releases --image), then I would try a fly deploy --image to see if that fares any better.
Also, the following very recent patch caught my eye while looking out of curiousity for occurrences of :parser…
commit 504c680870cdb8c3984abd56a6561f578eb5fa0a
Author: Jose Valim <jose.valim@dashbit.co>
Date: Thu Oct 16 08:44:43 2025 +0200
Fix IEx parser fetching on mix release
diff --git a/lib/iex/lib/iex/config.ex b/lib/iex/lib/iex/config.ex
index 964ee9892..85f3ca201 100644
--- a/lib/iex/lib/iex/config.ex
+++ b/lib/iex/lib/iex/config.ex
@@ -80,7 +80,9 @@ def alive_prompt() do
end
def parser() do
- Application.fetch_env!(:iex, :parser)
+ # Since the parser itself can be invoked from the remote node
+ # without IEx running, we cannot use fetch_env!
+ Application.get_env(:iex, :parser, {IEx.Evaluator, :parse, []})
end
The error message reported at the top of the thread mentioned 1.19.0-rc.0 (June 9), and that’s missing the above fix—if I’ve navigated the branching maze correctly. It might be worth checking whether the above is in the call path that you were exercising…