Ejabberd: fail2ban crashes for c2s .onion

Created on 6 Jul 2018  路  5Comments  路  Source: processone/ejabberd

What version of ejabberd are you using?

18.06.27

What operating system (version) are you using?

Debian

How did you install ejabberd (source, package, distribution)?

git

What did not work as expected? Are there error messages in the log? What
was the unexpected behavior? What was the expected result?

fail2ban will crash when connecting through a .onion, since the client address is 127.0.0.1

Log:

[error] <0.665.0>@ejabberd_hooks:safe_apply:383 Hook c2s_stream_started crashed when running mod_fail2ban:c2s_stream_started/2:
** Reason = {error,badarg,[{ets,lookup,[],[failed_auth,{127,0,0,1}]},{mod_fail2ban,c2s_stream_started,[{file,"src/mod_fail2ban.erl"},{line,85}],2},{ejabberd_hooks,safe_apply,[{file,"src/ejabberd_hooks.erl"},{line,380}],4},{ejabberd_hooks,run_fold1,[{file,"src/ejabberd_hooks.erl"},{line,364}],4},{xmpp_stream_in,process_stream,[{file,"src/xmpp_stream_in.erl"},{line,529}],2},{xmpp_stream_in,handle_info,[{file,"src/xmpp_stream_in.erl"},{line,299}],2},{p1_server,handle_msg,[{file,"src/p1_server.erl"},{line,696}],8},{proc_lib,init_p_do_apply,[{file,"proc_lib.erl"},{line,247}],3}]}
** Arguments = [#{tls_verify => false,stream_timeout => {30000,3410031},stream_direction => in,stream_header_sent => true,mgmt_stanzas_req => 0,shaper => c2s_shaper,resource => <<>>,tls_enabled => true,zlib => true,mgmt_stanzas_out => 0,server => <<"domain.ltd">>,mgmt_resend => if_offline,mgmt_max_queue => 5000,mgmt_stanzas_in => 0,stream_authenticated => false,stream_encrypted => false,stream_version => {1,0},pres_a => {0,nil},lang => <<"en">>,csi_queue => {0,#{}},mod => ejabberd_c2s,mgmt_max_timeout => 300,stream_state => wait_for_stream,mgmt_queue_type => ram,tls_options => [compression_none],codec_options => [ignore_els],owner => <0.665.0>,tls_required => true,user => <<>>,lserver => <<"domain.ltd">>,mgmt_timeout => 300,mgmt_state => inactive,ip => {{127,0,0,1},44398},stream_id => <<"snip">>,access => c2s,csi_state => active,socket => {socket_state,gen_tcp,#Port<0.23889>,65536,#Ref<0.snip.snip.snip>,{maxrate,10000,10000,10000,snip},undefined},mgmt_ack_timeout => 60000,socket_monitor => #Ref<0.snip.snip.snip>,stream_restarted => false,stream_compressed => false,xmlns => <<"jabber:client">>},{stream_start,undefined,{jid,<<>>,<<"domain.ltd">>,<<>>,<<>>,<<"domain.ltd">>,<<>>},<<>>,{1,0},<<"jabber:client">>,<<"http://etherx.jabber.org/streams">>,<<>>,<<"en">>}]
Bug Needs more info

Most helpful comment

I'll have to retry to setup such a domain.

All 5 comments

I don't think this is because of 127.0.0.1. The crash looks weird: according to it mod_fail2ban is not loaded, but its hooks are registered.
Can you reproduce the problem easily?

@licaon-kter still experience the bug?

I'll have to retry to setup such a domain.

I close the issue since no additional information is provided. If there are some more info please share it here.

Was this page helpful?
0 / 5 - 0 ratings