Franky Orson | 1 Aug 04:25 2011
Picon

Re: Upgraded to 2.1.6 - clients get disconnected after 60 secs (new behavior from 2.1.3)

Actually disconnection varies from 1 to 4 minutes...but most of the time it is around a minute...

On Sun, Jul 31, 2011 at 11:08 AM, Franky Orson <franky.orson <at> gmail.com> wrote:
Hi All,

I have a bit of a problem here - I upgraded our Ejabberd servers from 2.1.3 to 2.1.6 and now my clients get disconnected every 60 secs roughly. Basically, the client gets a "Connection reset by peer". The same client against 2.1.3 never gets disconnected.

Whether mod_ping is enabled or disabled, it does NOT change anything.

What I don't understand if why this new behavior in 2.1.6? 2.1.3 did not disconnect clients, idle or not.

Any new Ejabberd config param I should be looking for? I have searched through ejabberd.cfg and haven't found anything yet. There is also nothing in ejabberd.log.

Thank you in advance for any help with this.

--Franky

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Alexander Kuleshov | 1 Aug 08:40 2011
Picon

Communicate with other code from hooks

Hello,

I have hook handler in my code:

    ejabberd_hooks:add(sm_register_connection_hook,
BotState#state.host, ?MODULE, on_register, 80),

on_register(SID, JID, INFO) ->
    {_, _, _, _, Name, _, _} = JID,
    ok.

How can i send message to gen_server for example from this hook with Name?

How can i make know gen_server pid to hook?

Thank you.
Evgeniy Khramtsov | 1 Aug 09:01 2011
Picon

Re: Upgraded to 2.1.6 - clients get disconnected after 60 secs (new behavior from 2.1.3)

01.08.2011 12:25, Franky Orson wrote:
> Actually disconnection varies from 1 to 4 minutes...but most of the time it
> is around a minute...

I don't think that's a ejabberd problem. Did you upgrade Erlang as well?

--

-- 
Regards,
Evgeniy Khramtsov, ProcessOne.
xmpp:xram <at> jabber.ru.
Franky Orson | 1 Aug 09:18 2011
Picon

Re: Upgraded to 2.1.6 - clients get disconnected after 60 secs (new behavior from 2.1.3)

Hi Evgeny,

I am running the same version of Erlang as I was with Ejabberd 2.1.3

Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:24:24] [rq:24] [async-threads:0] [hipe] [kernel-poll:false]

I turned on Debug level logging - no real hints besides sessions being closed at these intervals (~1mn)...and routing of unavailable stanzas...
I also tried w/ or without kernel polling, same. I did compile Erlang to support kernel polling too.

Ubuntu 2.6.32-31 x86_64

Cheers

--Franky

On Mon, Aug 1, 2011 at 12:01 AM, Evgeniy Khramtsov <xramtsov <at> gmail.com> wrote:
01.08.2011 12:25, Franky Orson wrote:
Actually disconnection varies from 1 to 4 minutes...but most of the time it
is around a minute...

I don't think that's a ejabberd problem. Did you upgrade Erlang as well?

--
Regards,
Evgeniy Khramtsov, ProcessOne.
xmpp:xram <at> jabber.ru.

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Fanbin Kong | 1 Aug 15:34 2011
Picon

Re: Fwd: Pubsub bugs?


Message: 2
Date: Sun, 31 Jul 2011 09:24:45 -0600
From: Shaun Kruger <shaun.kruger <at> gmail.com>
To: ejabberd <at> jabber.ru
Subject: Re: [ejabberd] Fwd: Pubsub bugs?
Message-ID:
       <CADDAWw2WViWsfC0MYDu8N=vFh9Q_YY9Vj3UWK0ztmhm5=DB5Ag <at> mail.gmail.com>
Content-Type: text/plain; charset=windows-1252

What version of ejabberd are you running?  If it is a 3.0 alpha
version then the pubsub binary vs list type problem makes sense
because ejabberd 3 is transitioning to working with vhost domains as
binaries instead of lists.

I think this ticket in process one's issue tracker may be pertinent:
https://support.process-one.net/browse/EJAB-1244

Shaun

On Sun, Jul 31, 2011 at 7:53 AM, Fanbin Kong <kfbuniversity <at> gmail.com> wrote:
> Hi, everyone, I posted this message serveral days ago, but nobody answers
> me, ?so I modified the source code myself, and ejabberd can work now, here
> are my modifications:
> diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl
> index fc50a1c..c2432c6 100644
 

Thank you, Shaun. Yeah, I'm running 3.0.0-alpha-3. I thought the transitioning was finished. 
Well then, when will the transition be finished? And when will the stable version 3 be released?
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Shaun Kruger | 1 Aug 16:06 2011
Picon

Re: Communicate with other code from hooks

There are a few ways of doing this that I like to use.  It all depends
on if you have a gen_server per vhost or if you want a global
gen_server.  Also, I'm going to make my suggestions based on what I
have seen in the ejabberd 2 series.  Things a a little different (and
nicer) in ejabberd3.

The best way of talking to a gen server when you can't just pass a PID
around is by naming your gen server.  There are two options for this.
You can create a global (to your node) gen server, or you can start
one for each vhost.

The global gen_server option assuming you are making use of the
gen_mod behaviour.
======================================
start("localhost",Opts) ->
    supervisor:start_child(ejabberd_sup,{?MODULE,{?MODULE,start_link,[Opts]},permanent,2000,worker,[?MODULE]}),
    ok;
start(Host,Opts) ->
    %% Do per vhost startup.
    ok.

start_link(Opts) ->
    gen_server:start_link({local,?MODULE},?MODULE,Opts,[]).

init(Opts) ->
    %% This assumes you simply want opts to be your state variable.  I
usually create a local record definition and put opts into it.
    {ok,Opts}.

on_register(SID,#jid{lname=Name},Info) ->
    gen_server:call(?MODULE,{on_register,Name,SID,Info}),
    ok.

In the event you wish to start a gen_server per vhost you can do this:
=======================================
start(Host,Opts) ->
    PName = gen_mod:get_module_proc(Host,?MODULE),
    supervisor:start_child(ejabberd_sup,{PName,{?MODULE,start_link,[Host,Opts]},permanent,2000,worker,[?MODULE]}),
    ok.

start_link(Host,Opts) ->
    PName = gen_mod:get_module_proc(Host,?MODULE),
    gen_server:start_link({local,PName},?MODULE,{Host,Opts},[]).

init({Host,Opts}) ->
    {ok,{Host,Opts}}.

on_register(SID,#jid,{lname=Name,lserver=Host},Info) ->
    PName = gen_mod:get_module_proc(Host,?MODULE),
    gen_server:call(PName,{on_register,Name,SID,Info}),
    ok.

In essence, you must give your gen_server a name that you either can
assume globally (first example), or infer based on the arguments that
come in (second example).  Take note that these are only partial
examples.  I didn't implement the stop(_Host) function where I stop
the gen_servers and remove them from the supervisor.  I have seen some
modules merely start a gen_server or spawn a process without
supervisor support, but I don't recommend it.  It's always sad when
your module stops running properly because of a small bug that should
have been automatically corrected.

Shaun

On Mon, Aug 1, 2011 at 12:40 AM, Alexander Kuleshov
<kuleshovmail <at> gmail.com> wrote:
> Hello,
>
> I have hook handler in my code:
>
>    ejabberd_hooks:add(sm_register_connection_hook,
> BotState#state.host, ?MODULE, on_register, 80),
>
> on_register(SID, JID, INFO) ->
>    {_, _, _, _, Name, _, _} = JID,
>    ok.
>
> How can i send message to gen_server for example from this hook with Name?
>
> How can i make know gen_server pid to hook?
>
> Thank you.
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
Shaun Kruger | 1 Aug 17:07 2011
Picon

Re: Fwd: Pubsub bugs?

Good question.  I'm not on the ejabberd team, I've just been really
interested in ejabberd 3.  I'm sure they wouldn't be opposed to some
patches that help deal with these bugs. :)

Shaun

On Mon, Aug 1, 2011 at 7:34 AM, Fanbin Kong <kfbuniversity <at> gmail.com> wrote:
>
>
> Thank you, Shaun. Yeah, I'm running 3.0.0-alpha-3. I thought
> the transitioning was finished.
> Well then, when will the transition be finished? And when will the stable
> version 3 be released?
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>
Badlop | 1 Aug 19:47 2011
Picon

Re: ejabberdctl get_vcard _or_ set_vcard still not working for me in 2.1.6

2011/7/31 Franky Orson <franky.orson <at> gmail.com>:
> ejabberd <at> chat-server:~$ ejabberdctl get_vcard Frank chat-server.com nickname
> Problem 'error badarg' occurred executing the command.
> Stacktrace: [{io_lib,format,["~s","E"]},
>
> ejabberd <at> chat-server:~$ ejabberdctl set_vcard Frank chat-server.com nickname
> Franky
> Problem 'error {badxml,
>                    {xmlelement,"vCard",
>                        [{"xmlns","vcard-temp"}],
>
> [[{xmlelement,"nickname",[],[{xmlcdata,"Franky"}]}]]},
>                    {{case_clause,
>                         [{xmlelement,"nickname",[],[{xmlcdata,"Franky"}]}]},
>
> Whether I specify nickname in lowercase or uppercase, it does not change a
> thing.

Sorry, I have no clue why it fails for you.

I try with ejabberd 2.1.6, and mod_admin_extra compiled from SVN.

First of all I create an account and set a nickname using Tkabber. Then:

$ ejabberdctl get_vcard User1 odbc.localhost NICKNAME
nick1
$ ejabberdctl set_vcard User1 odbc.localhost NICKNAME nickanem222
$ ejabberdctl get_vcard User1 odbc.localhost NICKNAME
nickanem222

---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Franky Orson | 2 Aug 03:45 2011
Picon

PROBLEM FIXED - was Re: Upgraded to 2.1.6 - clients get disconnected after 60 secs (new behavior from 2.1.3)

Finally found the problem - sorry guys for the false alert - it was our load balancer acting up - the 2.1.3 and 2.1.6 Ejabberd servers were on 2 different load balancers and the one used by 2.1.6 was resetting connections at times, a bit too aggressively...

Regards.

On Mon, Aug 1, 2011 at 12:18 AM, Franky Orson <franky.orson <at> gmail.com> wrote:
Hi Evgeny,

I am running the same version of Erlang as I was with Ejabberd 2.1.3

Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:24:24] [rq:24] [async-threads:0] [hipe] [kernel-poll:false]

I turned on Debug level logging - no real hints besides sessions being closed at these intervals (~1mn)...and routing of unavailable stanzas...
I also tried w/ or without kernel polling, same. I did compile Erlang to support kernel polling too.

Ubuntu 2.6.32-31 x86_64

Cheers

--Franky


On Mon, Aug 1, 2011 at 12:01 AM, Evgeniy Khramtsov <xramtsov <at> gmail.com> wrote:
01.08.2011 12:25, Franky Orson wrote:
Actually disconnection varies from 1 to 4 minutes...but most of the time it
is around a minute...

I don't think that's a ejabberd problem. Did you upgrade Erlang as well?

--
Regards,
Evgeniy Khramtsov, ProcessOne.
xmpp:xram <at> jabber.ru.

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd


_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Shaun Kruger | 2 Aug 06:34 2011
Picon

Re: ejabberdctl get_vcard _or_ set_vcard still not working for me in 2.1.6

On Sun, Jul 31, 2011 at 12:26 PM, Franky Orson <franky.orson <at> gmail.com> wrote:
> Problem 'error {badxml,
>                    {xmlelement,"vCard",
>                        [{"xmlns","vcard-temp"}],
>
> [[{xmlelement,"nickname",[],[{xmlcdata,"Franky"}]}]]},

This is a curious xmlelement tuple.  I did notice that the child
elements list part is malformed.  Usually it is a list containing
either xmlelement tuples and/or xmlcdata tuples.  This list contains
another list that finally contains the xmlelement child tuple.  I'm
not sure where to look exactly to figure out why it is happening, but
I would be interested to see if you still have the problem if you
enable mod_vcard instead of mod_vcard_odbc.  Then we would know if
this was an odbc vcard storage specific problem you're having.

Shaun

Gmane