processone / ejabberd

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

Crashing on login #3039

Closed shaggi7 closed 5 years ago

shaggi7 commented 5 years ago

Hi, I am facing the issue upon login into ejabberd :

$ ejabberdctl live
--------------------------------------------------------------------

IMPORTANT: ejabberd is going to start in LIVE (interactive) mode.
All log messages will be shown in the command shell.
You can interact with the ejabberd node if you know how to use it.
Please be extremely cautious with your actions,
and exit immediately if you are not completely sure.

To exit this LIVE mode and stop ejabberd, press:
  q().  and press the Enter key

--------------------------------------------------------------------
To bypass permanently this warning, add to ejabberdctl.cfg the line:
  EJABBERD_BYPASS_WARNINGS=true
Press return to continue

Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]

Eshell V10.4.4  (abort with ^G)
(ejabberd@localhost)1> 10:47:44.383 [notice] Changed loghwm of /usr/local/var/log/ejabberd/error.log to 100
10:47:44.383 [notice] Changed loghwm of /usr/local/var/log/ejabberd/ejabberd.log to 100
10:47:44.415 [info] Loading configuration from /usr/local/etc/ejabberd/ejabberd.yml
10:47:44.506 [info] Configuration loaded successfully
10:47:44.603 [info] Building language translation cache
10:47:44.685 [info] Loading modules for 192.168.4.69
10:47:44.746 [info] My message!!!!
10:47:44.746 [info] Hello, ejabberd world!
10:47:44.790 [info] Building MQTT cache for 192.168.4.69, this may take a while
10:47:44.814 [info] Waiting for Mnesia synchronization to complete
10:47:44.912 [warning] No certificate found matching 192.168.4.69
10:47:44.913 [warning] No certificate found matching pubsub.192.168.4.69
10:47:44.913 [warning] No certificate found matching proxy.192.168.4.69
10:47:44.913 [warning] No certificate found matching upload.192.168.4.69
10:47:44.913 [warning] No certificate found matching conference.192.168.4.69
10:47:44.913 [info] ejabberd 19.08.58 is started in the node ejabberd@localhost in 0.60s
10:47:44.913 [info] Start accepting TCP connections at [::]:1883 for mod_mqtt
10:47:44.913 [info] Start accepting TLS connections at [::]:5443 for ejabberd_http
10:47:44.913 [info] Start accepting TCP connections at 127.0.1.1:7777 for mod_proxy65_stream
10:47:44.913 [info] Start accepting TCP connections at [::]:5280 for ejabberd_http
10:47:44.913 [info] Start accepting TCP connections at [::]:5269 for ejabberd_s2s_in
10:47:44.913 [info] Start accepting TCP connections at [::]:5222 for ejabberd_c2s
10:47:48.561 [info] (<0.651.0>) Accepted connection [::ffff:192.168.4.69]:34372 -> [::ffff:192.168.4.69]:5280
10:47:49.019 [info] (http_bind|<0.652.0>) Accepted c2s SCRAM-SHA-1 authentication for sagar@192.168.4.69 by sql backend from ::ffff:192.168.4.69
10:47:49.268 [info] (http_bind|<0.652.0>) Opened c2s session for sagar@192.168.4.69/webApp
10:47:49.529 [info] <<<<-------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=------------>>>>
10:47:49.529 [info] <<<<-------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=------------>>>>
10:47:49.529 [info] FORMAT ERROR: "LServer IN MOD_VCARD " [<<"192.168.4.69">>]
10:47:49.529 [info] <<<<-------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=------------>>>>
10:47:49.529 [info] <<<<-------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=------------>>>>
10:47:49.529 [info] <<<<-------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=------------>>>>
10:47:49.530 [info] <<<<-------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=------------>>>>
10:47:49.530 [info] FORMAT ERROR: "LServer IN MOD_VCARD_SQL " [<<"192.168.4.69">>]
10:47:49.530 [info] <<<<-------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=------------>>>>
10:47:49.530 [info] <<<<-------=-=-=-=-=-=-=-=-=-=-=-=-=-=-=------------>>>>
10:47:49.542 [info] Outbound s2s connection started: 192.168.4.69 -> 192.168.3.145
10:47:49.543 [info] Outbound s2s connection started: 192.168.4.69 -> 192.168.3.145
10:47:49.543 [error] gen_server <0.654.0> terminated with reason: no function clause matching string:chr(<<"192.168.3.145">>, 46, 1) line 1801
10:47:49.544 [error] CRASH REPORT Process <0.654.0> with 0 neighbours exited with reason: no function clause matching string:chr(<<"192.168.3.145">>, 46, 1) line 1801 in p1_server:terminate/7 line 878
10:47:49.544 [error] Supervisor ejabberd_s2s_out_sup had child undefined started with {ejabberd_s2s_out,start_link,undefined} at <0.654.0> exit with reason no function clause matching string:chr(<<"192.168.3.145">>, 46, 1) line 1801 in context child_terminated
10:47:49.545 [error] gen_server <0.655.0> terminated with reason: no function clause matching string:chr(<<"192.168.3.145">>, 46, 1) line 1801
10:47:49.545 [error] CRASH REPORT Process <0.655.0> with 0 neighbours exited with reason: no function clause matching string:chr(<<"192.168.3.145">>, 46, 1) line 1801 in p1_server:terminate/7 line 878
10:47:49.546 [error] Supervisor ejabberd_s2s_out_sup had child undefined started with {ejabberd_s2s_out,start_link,undefined} at <0.655.0> exit with reason no function clause matching string:chr(<<"192.168.3.145">>, 46, 1) line 1801 in context child_terminated

I have also tried the solution provided in #3037.

also I am receiving the these presence stanzas from rosters upon login:

<presence xmlns="jabber:client" xml:lang="en" to="tony@192.168.4.69/webApp" from="bob@192.168.3.145" type="error">
    <x xmlns="vcard-temp:x:update">
          <photo>4e354a5e2baf2f5d3f055529561fed9536cb037b</photo>
    </x>
   <error code="500" type="wait">
           <internal-server-error xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
           <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Internal server error</text> 
   </error>
   <priority>100</priority>
</presence>
zinid commented 5 years ago

Fixed in https://github.com/processone/xmpp/commit/8169533782724615c4b0daa8b9c551f3ce47d032

zinid commented 5 years ago

Update ejabberd, I fixed it:

$ git pull
$ make distclean
$ ./autogen.sh && ./configure --blah-blah && make
shaggi7 commented 5 years ago

Thanks @zinid This fix the problem on login. but then i was getting this error stanza

<presence xmlns="jabber:client" xml:lang="en" to="sagar@192.168.4.69/webApp" from="alice@192.168.3.145" type="error">
   <x xmlns="vcard-temp:x:update">
          <photo/>
   </x>
   <error code="504" type="wait">
   <remote-server-timeout xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">
            Connection failed: timeout
    </text>
    </error>
    <priority>100</priority>
</presence>

And then i realized what the actual problem was. Roster information . I not only saves the username of roster but also saves the domain address from which they are connected . Roster were saved using my old IP address . So i removed all roster and then added them back manually.

zinid commented 5 years ago

Yes, don't change domains in the config in order to avoid this.