walkerbrown

walkerbrown

If you’re working to embed ejabberd into a Phoenix app, I hope this helps!

I had been following the docs and tutorial (note that the blog post is dated):
https://docs.ejabberd.im/developer/extending-ejabberd/elixir/
https://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/

I’m using the following versions:

  • Phoenix 1.4.10
  • ejabberd 19.8

If you’re having Logger/logger/lager issues, see this related thread: https://forum.elixirforum.com/t/getting-ejabberd-to-use-elixir-logger-in-release-build/24252

I had been getting an error on compilation (see below). The solution was to remove the ejabberd dependency from mix.exs, clean out the build, get and compile the other dependencies, then add back ejabberd before a final compilation step. Here’s the full workaround:

# Clean out build; careful with rm -rf ...
rm -rf _build
rm -rf deps
mix deps.clean --all
# In mix.exs, comment out the line in deps {:ejabberd, "~> 19.8"},
mix do deps.get, compile
# In mix.exs, uncomment the ejabberd line in deps
mix do deps.get, compile

Does anyone know why building everything at once causes this task to crash? I’d like to find a better solution. Thanks!

...
==> phoenix_ecto
Compiling 6 files (.ex)
Generated phoenix_ecto app

16:32:04.624 [info]  Application phoenix exited: exited in: Phoenix.start(:normal, [])
    ** (EXIT) exited in: :gen_server.call(:telemetry_handler_table, {:insert, {Phoenix.Logger, [:phoenix, :channel_handled_in]}, [[:phoenix, :channel_handled_in]], #Function<8.17735610/4 in Phoenix.Logger.install/0>, :ok})
        ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started

16:32:04.624 [info]  Application eex exited: :stopped
** (MatchError) no match of right hand side value: {:error, {:phoenix, {:bad_return, {{Phoenix, :start, [:normal, []]}, {:EXIT, {:noproc, {:gen_server, :call, [:telemetry_handler_table, {:insert, {Phoenix.Logger, [:phoenix, :channel_handled_in]}, [[:phoenix, :channel_handled_in]], #Function<8.17735610/4 in Phoenix.Logger.install/0>, :ok}]}}}}}}}
    (phoenix) lib/mix/tasks/compile.phoenix.ex:11: Mix.Tasks.Compile.Phoenix.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/tasks/compile.all.ex:73: Mix.Tasks.Compile.All.run_compiler/2
    (mix) lib/mix/tasks/compile.all.ex:53: Mix.Tasks.Compile.All.do_compile/4
    (mix) lib/mix/tasks/compile.all.ex:24: anonymous fn/1 in Mix.Tasks.Compile.All.run/1
    (mix) lib/mix/tasks/compile.all.ex:40: Mix.Tasks.Compile.All.with_logger_app/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/tasks/compile.ex:96: Mix.Tasks.Compile.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2
    (elixir) lib/code.ex:813: Code.require_file/2

In any case, I hope this workaround helps someone out there!

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
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
velrest
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
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
mnkhod
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New

Other Trending Topics Top

GenericJam
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
JesseHerrick
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews