[ejabberd] Problem with Roster push as a result of subscription

Brett Holton brett.holton at meteor-ent.com
Tue Nov 6 23:50:41 MSK 2012


So I tracked my issue down to middleware that was sending a Roster Add before sending the subscription stanza, the result of this was what I was seeing. It seems this was done to add the group to the roster before the subscription stanza is sent. I have not looked into it yet but ideally I could include the group with the subscription stanza and get rid of the initial RosterAdd that the client is sending.

Brett Holton
Engineer
Meteor Entertainment

-----Original Message-----
From: ejabberd-bounces at jabber.ru [mailto:ejabberd-bounces at jabber.ru] On Behalf Of ejabberd-request at jabber.ru
Sent: Tuesday, November 06, 2012 11:38 AM
To: ejabberd at jabber.ru
Subject: ejabberd Digest, Vol 112, Issue 5

Send ejabberd mailing list submissions to
	ejabberd at jabber.ru

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.jabber.ru/mailman/listinfo/ejabberd
or, via email, send a message with subject or body 'help' to
	ejabberd-request at jabber.ru

You can reach the person managing the list at
	ejabberd-owner at jabber.ru

When replying, please edit your Subject line so it is more specific than "Re: Contents of ejabberd digest..."


Today's Topics:

   1. Re: Problem with Roster push as a result of subscription
      request (Badlop)
   2. Re: mod_last_odbc with PostgreSQL (Felix GV)
   3. Re: mod_last_odbc with PostgreSQL (Felix GV)
   4. Looking for advices on migrating to the odbc version of	some
      modules... (Felix GV)


----------------------------------------------------------------------

Message: 1
Date: Tue, 6 Nov 2012 17:59:55 +0100
From: Badlop <badlop at gmail.com>
To: ejabberd at jabber.ru
Subject: Re: [ejabberd] Problem with Roster push as a result of
	subscription	request
Message-ID:
	<CAA6KaLz2Sg38x4577h5ZaFfW-mg5tj1bMKJk6KioruQ_Dims-A at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On 30 October 2012 20:05, Brett Holton <brett.holton at meteor-ent.com> wrote:
> I am currently running ejabberd 2.1.11 and I?m seeing behavior that 
> does not seem to meet RFC 6121 when I send a subscription request.
>
> After sending a subscription request I correctly receive a Roster Set 
> IQ, but the ask attribute is empty. Is this a known issue with Mod_Roster?
>
> According to the RFC the server should respond with a roster set IQ 
> with a subscription of ?none? and an ask of ?subscribe?

I send this stanza using the XML window of Tkabber to ejabberd 2.1.11, and it seems correct:

<!-- 17:40:50.902 OUT (::xmpp::1, user1 at localhost/tka1) -->
<presence	type='subscribe'
	to='user222 at localhost'>
  <status>Me gustar?a a?adirte a mi lista de contactos.
</status>
</presence>

<!-- 17:40:50.924 IN (::xmpp::1, user1 at localhost/tka1) --> <iq from='user1 at localhost'
	to='user1 at localhost/tka1'
	id='push681909530'
	type='set'>
  <query xmlns='jabber:iq:roster'>
    <item ask='subscribe'
	subscription='none'
	jid='user222 at localhost'/>
  </query>
</iq>


---
Badlop
ProcessOne


------------------------------

Message: 2
Date: Tue, 6 Nov 2012 13:56:15 -0500
From: Felix GV <felix at mate1inc.com>
To: ejabberd at jabber.ru
Subject: Re: [ejabberd] mod_last_odbc with PostgreSQL
Message-ID:
	<CAECHK7vr1RRYPp_1Jr6-En3Ute2AdCTPOnD7DrZDeQyfZ0JPsg at mail.gmail.com>
Content-Type: text/plain; charset="koi8-r"

Hello,

I don't know if you solved your issue (?), but I have a similar one!

I am using the binary distribution of ejabberd 2.1.11 that's available on the process-one website.

I configured ejabberd to use the MySQL native driver and created the tables for all of the ejabberd modules in a MySQL DB (by executing the mysql.sql file).

I tested out mod_roster_odbc and that seemed to work fine (it's inserting and updating rows in the rosterusers table and not adding any new records to the roster Mnesia table).

When I try to use mod_last_odbc, however, the MySQL table named last remains empty. Also, in the admin interface, I see new records being created in the last_activity Mnesia table, as if the non-ODBC version of mod_last was still running...

It seems clear that the MySQL database and native driver are properly installed and configured, since mod_roster_odbc is able to write into the DB. Is it possible that mod_last_odbc is not behaving correctly?

I can provide any other info (configs, logs, etc...) if needed.

Thanks :) !

--
Felix



On Tue, Oct 30, 2012 at 6:47 PM, Alex Favaro <afavaro at omnihours.com> wrote:

> I did compile from the 2.1.x branch - I was just referencing that file 
> to set up the schema for my database. In particular, I used the 2.1.x 
> / odbc schema from the comments section (a table named "last" with 
> columns "username", "seconds", and "state").
>
> On Tue, Oct 30, 2012 at 3:33 PM, Badlop <badlop at gmail.com> wrote:
>
>> Try with the stable ejabberd 2.1.x branch, instead of 'master' branch.
>>
>>
>> On 30 October 2012 22:32, Alex Favaro <afavaro at omnihours.com> wrote:
>> > Has anybody had any luck configuring mod_last_odbc with the native 
>> > PostgreSQL driver?
>> >
>> > I installed ejabberd from source using the instructions here, added 
>> > the table "last" to my database using the schema in mod_last.erl, 
>> > and added
>> the
>> > following lines to my ejabberd.cfg:
>> >
>> > {modules, [
>> >   ...
>> >   {mod_last_odbc, []},
>> >   ...
>> > ]}
>> > ...
>> > {host_config, "localhost", [
>> >   {odbc_server, {pgsql, "localhost", "<database>", "<user>",
>> "<password>"}}
>> > ]}.
>> >
>> > But when I run ejabberd and start sending messages between two 
>> > users I
>> don't
>> > see any rows in the database table I created. There are no error
>> messages in
>> > either the ejabberd or PostgreSQL logs so I'm not really sure how 
>> > to
>> debug
>> > this. Has anyone successfully configured this? I'm running ejabberd
>> 2.1.11
>> > with PostgreSQL 9.1
>> >
>> > Also, will this module track any kind of activity from users or do 
>> > I
>> need to
>> > explicitly send presence stanzas to update the last activity? (I've
>> tried
>> > doing this but still no luck)
>> >
>> > -Alex
>>
>> ---
>> Badlop
>> ProcessOne
>> _______________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20121106/86f08adb/attachment-0001.html>

------------------------------

Message: 3
Date: Tue, 6 Nov 2012 14:06:52 -0500
From: Felix GV <felix at mate1inc.com>
To: ejabberd at jabber.ru
Subject: Re: [ejabberd] mod_last_odbc with PostgreSQL
Message-ID:
	<CAECHK7s4d8DYj2ezd2EgNL3XGbHdF4rjGawncTbHzPs7-=JBdg at mail.gmail.com>
Content-Type: text/plain; charset="koi8-r"

Actually, it's working now...

I'm not sure what went wrong the first time around...

So then, regarding the OP's problem, is it possible that it's a pgsql-specific issue?

--
Felix



On Tue, Nov 6, 2012 at 1:56 PM, Felix GV <felix at mate1inc.com> wrote:

> Hello,
>
> I don't know if you solved your issue (?), but I have a similar one!
>
> I am using the binary distribution of ejabberd 2.1.11 that's available 
> on the process-one website.
>
> I configured ejabberd to use the MySQL native driver and created the 
> tables for all of the ejabberd modules in a MySQL DB (by executing the 
> mysql.sql file).
>
> I tested out mod_roster_odbc and that seemed to work fine (it's 
> inserting and updating rows in the rosterusers table and not adding 
> any new records to the roster Mnesia table).
>
> When I try to use mod_last_odbc, however, the MySQL table named last 
> remains empty. Also, in the admin interface, I see new records being 
> created in the last_activity Mnesia table, as if the non-ODBC version 
> of mod_last was still running...
>
> It seems clear that the MySQL database and native driver are properly 
> installed and configured, since mod_roster_odbc is able to write into 
> the DB. Is it possible that mod_last_odbc is not behaving correctly?
>
> I can provide any other info (configs, logs, etc...) if needed.
>
> Thanks :) !
>
> --
> Felix
>
>
>
>
> On Tue, Oct 30, 2012 at 6:47 PM, Alex Favaro <afavaro at omnihours.com>wrote:
>
>> I did compile from the 2.1.x branch - I was just referencing that 
>> file to set up the schema for my database. In particular, I used the 
>> 2.1.x / odbc schema from the comments section (a table named "last" 
>> with columns "username", "seconds", and "state").
>>
>> On Tue, Oct 30, 2012 at 3:33 PM, Badlop <badlop at gmail.com> wrote:
>>
>>> Try with the stable ejabberd 2.1.x branch, instead of 'master' branch.
>>>
>>>
>>> On 30 October 2012 22:32, Alex Favaro <afavaro at omnihours.com> wrote:
>>> > Has anybody had any luck configuring mod_last_odbc with the native 
>>> > PostgreSQL driver?
>>> >
>>> > I installed ejabberd from source using the instructions here, 
>>> > added the table "last" to my database using the schema in 
>>> > mod_last.erl, and
>>> added the
>>> > following lines to my ejabberd.cfg:
>>> >
>>> > {modules, [
>>> >   ...
>>> >   {mod_last_odbc, []},
>>> >   ...
>>> > ]}
>>> > ...
>>> > {host_config, "localhost", [
>>> >   {odbc_server, {pgsql, "localhost", "<database>", "<user>",
>>> "<password>"}}
>>> > ]}.
>>> >
>>> > But when I run ejabberd and start sending messages between two 
>>> > users I
>>> don't
>>> > see any rows in the database table I created. There are no error
>>> messages in
>>> > either the ejabberd or PostgreSQL logs so I'm not really sure how 
>>> > to
>>> debug
>>> > this. Has anyone successfully configured this? I'm running 
>>> > ejabberd
>>> 2.1.11
>>> > with PostgreSQL 9.1
>>> >
>>> > Also, will this module track any kind of activity from users or do 
>>> > I
>>> need to
>>> > explicitly send presence stanzas to update the last activity? 
>>> > (I've
>>> tried
>>> > doing this but still no luck)
>>> >
>>> > -Alex
>>>
>>> ---
>>> Badlop
>>> ProcessOne
>>> _______________________________________________
>>> 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
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20121106/4b6a41c6/attachment-0001.html>

------------------------------

Message: 4
Date: Tue, 6 Nov 2012 14:37:56 -0500
From: Felix GV <felix at mate1inc.com>
To: ejabberd at jabber.ru
Subject: [ejabberd] Looking for advices on migrating to the odbc
	version of	some modules...
Message-ID:
	<CAECHK7tgUaHh9vmUaYmqKNrB+M+vyvS5WY7w++w-DaJ0bi-izg at mail.gmail.com>
Content-Type: text/plain; charset="koi8-r"

Hello,

We deployed an ejabberd cluster a couple weeks ago, and the size of our roster and last_activity tables seem to have become problematic.

We sometimes want to do rolling restarts on the cluster, and the nodes now take 5 minutes+ each to start. We think this is probably because of the size of Mnesia.

I have tested a set up where an ejabberd cluster uses mod_last_odbc and mod_roster_odbc with the native MySQL driver, and that seems to work fine for new data, but I need to find a way to migrate the data that currently exists in Mnesia to MySQL.

The documentation says we can't run both versions of a module.

We were thinking of doing something along those lines:

   - Disconnect all users (while keeping the nodes up)
   - Using a custom erlang module to read the data from the last_activity
   and roster Mnesia tables and write it to the corresponding MySQL tables.
   - Changing the nodes' config so that it uses the odbc versions of the
   modules.
   - Restarting the nodes (or doing the module unloading and loading
   live...)
   - Once we're certain everything's fine: delete the old Mnesia data.

We don't mind having a bit of downtime if that makes things simpler and more reliable, although we certainly are interested in doing this without downtime if there is a proven solution to do so.

I haven't found an already-implemented way of doing such data migration, but if it exists, I'd like to know about it! Otherwise, we'll roll out our own implementation of the data migration module, in which case, any advice or best practices recommendation would be greatly appreciated!

Thanks :)

--
Felix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20121106/d902895b/attachment.html>

------------------------------

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


End of ejabberd Digest, Vol 112, Issue 5
****************************************



More information about the ejabberd mailing list