processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6k stars 1.5k forks source link

Can't set long node name! using kubernetes #4184

Closed venkateshcontus closed 1 week ago

venkateshcontus commented 3 months ago

Hi,

we started the ejabberd node with the below command
**sbin/ejabberdctl --node ejabberd@10.0.1.18** 

it works and verified by logs in PSI+ . After that try to check the status getting error. sbin/ejabberdctl --node ejabberd@10.0.1.18 status

IP is created dynamically in kubernetes cluster so we can't able to set in ejabberd.cfg file.

Environment

Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml

loglevel: 4
...

Errors from error.log/crash.log

-- =INFO REPORT==== 21-Mar-2024::10:05:33.064535 === Can't set long node name! Please check your configuration

=SUPERVISOR REPORT==== 21-Mar-2024::10:05:33.064570 === supervisor: {local,net_sup} errorContext: start_error reason: {'EXIT',nodistribution} offender: [{pid,undefined}, {id,net_kernel}, {mfargs,{net_kernel,start_link, [#{clean_halt => true,name => undefined, name_domain => longnames, supervisor => net_sup}]}}, {restart_type,permanent}, {significant,false}, {shutdown,2000}, {child_type,worker}]

{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}}"} Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}})

Crash dump is being written to: /opt/ejabberd/var/log/ejabberd/erl_crash_20240321-100532.dump...done

Bug description

IP address not able assign a node name ejabberd@10.0.1.18, ejabberd@10.0.1.20

prefiks commented 3 weeks ago

Hello,

Would you be able to edit ejabberdctl script, and see if doing this change:

     # Erlang/OTP 23 or higher: use native dynamic node code
     # https://www.erlang.org/patches/otp-23.0#OTP-13812
-    echo undefined
+    if [ "$ERLANG_NODE" != "${ERLANG_NODE%.*}" ]; then
+      echo "undefined@${ERLANG_NODE#*@}"
+    else
+      echo "undefined"
+    fi

helps with your problem?

Neustradamus commented 2 weeks ago

@venkateshcontus: Have you seen the @prefiks comment?

venkateshcontus commented 2 weeks ago

@venkateshcontus: Have you seen the @prefiks comment?

Yes, but we can't able to change it on runtime. We are using Kubernetes cluster architecture. So we can't do this change in the ejabberdctl script .

prefiks commented 1 week ago

This change was commited as 2c5a8f0860d874e71f7588842d3844b1b76db663. Since this seems to be fixed this problem in my tests, i am closing it.

venkateshcontus commented 1 week ago

thanks it's works me too