Ebuild ejabberd-16.04 installs ejabber files into /usr/lib/erlang/libs/ejabberd-16.04 instead /usr/lib/erlang/libs/ejabberd/ejabberd-16.04 (as ejabberd-16.01). As a result ejabber use /usr/lib/erlang/lib/eldap-1.2.1 instead internal eldap. dev-lang/erlang-18.3 net-im/ejabberd-16.04 net-nds/openldap-2.4.38-r2
If you temporarily move /usr/lib/erlang/lib/eldap-1.2.1 somewhere else, does ejabberd work? The fix would be to either force to include local eldap.hrl somehow, or rename eldap modules to e.g. ejabberd_eldap.
I just stumbled over a similar bug. Some googling found an issue on github (https://github.com/processone/ejabberd/issues/1037) which suggests moving /usr/lib/erlang/lib/eldap-1.2.1 aside. If I do that, ejabberd works just fine with LDAP. It seems that the eldap module is part of the dev-lang/erlang build. Maybe an LDAP use flag would be due?
Moving out eldap shipped with erlang is only a workaround, as well as not installing it would be a workaround. Erlang should first look into internal modules to include. I have discussed the issue on #ejabberd and I think I know how to fix the issue: 1) Move out ejabberd from /usr/lib/erlang/lib. It doesn't belong there, actually, because it's not a lib. But that wouldn't solve the issue, yet. 2) Set ERL_LIBS path to prefer ejabberd path over /usr/lib/erlang/lib. I will try to fix the issue as soon as possible, but certainly not today.
Dirk, thank for confirming that workaround works. That confirms the bug origin.
There's also another thing I would like you guys to test. Please revert everything to original state (move eldap-1.2.1 back to /usr/lib/erlang/lib/). Then please change ERL_LIBS in ejabberdctl to point to ejabber-16.04 directory first: sed -r -e 's@^(ERL_LIBS)=(.*)$@\1=/usr/lib/erlang/lib/ejabberd-16.04:\2@' -i /usr/sbin/ejabberdctl You should end up with: ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04:/usr/lib64/ejabberd-16.04 or ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04:/usr/lib64/ejabberd-16.04 If that works for you I will prepare the fix.
And second case to test: just set ERL_LIBS to ejabberd-16.04 directory: ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04 I am not sure that pointing to /usr/lib/erlang/lib is needed at all. ejabberd starts for me with setting above.
Sorry, I've messed up the first test case. Forget. I will sum it up here: 1. Set ERL_LIBS to point directly to ejabberd dir: ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04 2. If (1) doesn't work, set ERL_LIBS to: ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04:/usr/lib/erlang/lib You may need to change "/usr/lib" to "/usr/lib64" if for some reason you don't have the symlink.
I have fixed it in ejabberd-16.04-r1 with solution (2), but please test scenario (1) for me. You only need to stop ejabberd and epmd services, remove second path from ERL_LIBS in ejabberdctl (everything after and including ':') and then start ejabberd. For me both cases seem to work.
(In reply to Amadeusz Żołnowski from comment #8) > I have fixed it in ejabberd-16.04-r1 with solution (2), but please test > scenario (1) for me. You only need to stop ejabberd and epmd services, > remove second path from ERL_LIBS in ejabberdctl (everything after and > including ':') and then start ejabberd. For me both cases seem to work. I tested scenario (1) (just ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04) and my ejabberd started just fine. IMHO solution (2) is safer because it does not change the default behaviour of ejabberdctl but just shuffles the search path a bit.
I can confirm that 16.04 does not work for me with LDAP, but 16.04-r1 does. I never moved erlang files around and just installed 16.04 today (and 16.04-r1 afterwards).
Thanks for testing.