-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[BUG] MS SQL database backend reason: {port_exit,memory_allocation_failed} with Erlang >25.3 #4178
Comments
@badlop as discussed |
Erlang versions affectedI've tested compilation of ejabberd master git from source code with different Erlang/OTP versions and the results are:
Same problem with the Problematic commitUsing git bisect on erlang, I found that the problematic commit is erlang/otp@53ef5df Using erlang OTP-27.0-rc1 and reverting that commit, ejabberd works perfectly with mssql. Minimal reproduction stepsRight now the only way to reproduce the problem is using ejabberd... I found no way to provoke the problem in odbc without using ejabberd. HypothesisTrying to find some reproduction steps that wouldn't involve ejabberd: Setup: cat >"/tmp/odbcinst.ini" <<-'EOF'
[ODBC]
Driver = libtdsodbc.so
EOF This works correctly and returns erl
os:putenv("ODBCSYSINI", "/tmp/").
odbc:start().
{ok, Ref} = odbc:connect("DRIVER=ODBC;SERVER=mssql;DATABASE=ejabberd_test;UID=ejabberd_test;PWD=ejabberd_Test1;PORT=1433;CLIENT_CHARSET=UTF-8;", []).
erlang:process_info(Ref).
odbc:sql_query(Ref, "CREATE TABLE EMPLOYEE (NR integer, FIRSTNAME char varying(20), LASTNAME char varying(20), GENDER char(1), PRIMARY KEY(NR))").
odbc:describe_table(Ref, "EMPLOYEE"). Interestingly, if we provoke some error in erlang, the odbc query fails with erl
os:putenv("ODBCSYSINI", "/tmp/").
odbc:start().
{ok, Ref} = odbc:connect("DRIVER=ODBC;SERVER=mssql;DATABASE=ejabberd_test;UID=ejabberd_test;PWD=ejabberd_Test1;PORT=1433;CLIENT_CHARSET=UTF-8;", []).
erlang:process_info(Ref).
odbc:describe_table(Ref, "EMPLOYEE").
aa:bb().
erlang:process_info(Ref).
odbc:describe_table(Ref, "EMPLOYEE"). One wild hypothesis: maybe, when using erlang 26.0-rc2 or higher, ejabberd provokes some error that closes the odbc connection. That error is not provoked with older erlang versions. And the error itself is being silenced, so we are not aware of it. |
I think I am experiencing this exact same issue, on ejabberd 24.02. We're using the OTP that came with that. Is the current solution to try and load and use a specific working version of OTP? |
Aha, the binary installers and containers for ejabberd 24.02 include Erlang/OTP 26.2, and are affected by this problem.
Yes, either using Erlang 26.0-rc2 or older... Or compile Erlang/OTP from source with a small patch that revers the problematic commit. I've applied that solution in branch 24.02-otp-patch-mssql. This is just ejabberd 24.02 with a small patch for Erlang 26.2 that reverts the problematic commit. There are available binary installers and containers. I've tried the amd64 container and seems to work: at least it starts, connects to MSSQL and I can register an account. |
As a temporary workaround, the ejabberd binary installers now include a patch that reverts the problematic commit in Erlang/OTP. |
Environment
26.2
Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml
Errors from error.log/crash.log
Bug description
I started updating the ejabberd helm chart to newest
24.02
. While doing that and updating the corresponding container image I found that there is a problem with MS SQL. Therefore, I tested the officialghcr.io/processone/ejabberd:24.02
as well to see if it depends on my custom image, but it does not (see error message above).reason: {port_exit,memory_allocation_failed}
What solved the issue was reverting the container build from erlang 26.2 / elixir 16.1 to erlang 25.3 / elixir 14.4 . I haven't tested anything in between.
It most likely is unrelated to Alpine packages, because I also tried it with a custom Debian based variant with the same combination erlang 26.2 / elixir 16.1 .
The text was updated successfully, but these errors were encountered: