Problem creating Persistent MUC with ReST API

Version: 17.08

OS: Windows 7 Professional

I am trying to create a persistent room using ReST API create_room_with_opts with the following -

{
  "name": "testapi",
  "service": "conference.eteam",
  "host" : "localhost",
  "options": [
    {
      "name": "persistent",
      "value": "true"
    },
    {
      "name": "mam",
      "value": "true"
    },
    {
      "name": "title",
      "value": "test"
    },
    {
      "name": "description",
      "value": "Testing for Creating Persistent MUC from ReST API"
    }
  ]
}

The group gets created. I can see it in the web admin panel and also by using ReST API get_room_options. The value for "persistent" is "true". But I see that no data is getting saved in the muc_room table. And also the room disappears on server restart. I have tried both db_type: sql and db_type: mnesia. The room is not persisted.

Yet, when I create a persistent room using converse.js XMPP client, the room is getting saved in the database.

Hi. I use ejabberdctl in the

Hi. I use ejabberdctl in the shell, and that command requires using a more powerful frontend, like you do. So, I configure this:

modules:
  mod_muc:
    default_room_options:
      persistent: true

And then execute:

ejabberdctl create_room room1 conference.localhost localhost

I imagine this should produce a result similar to what you do. In my case, using ejabberd 18.01, the room is created, and after a server restart, it is still recreated.

Can you try with my method in your 17.08 version, and comment if it still fails?

I have already tried that.

I have already tried that. This default_room_options doesn't seem to be making any difference.

It's creating a room which is not persistent whether I create it with ejabberdctl or ReST API. I even checked from the Web Admin Console - the Persistent field is false.

It works correctly for me

It works correctly for me using 17.08. But I can reproduce the problem in recent ejabberd 18.01, as a bug was introduced in a recent commit: https://github.com/processone/ejabberd/commit/ba2b650464bd3aae2b6b0f3a31...

Maybe you are using 18.01 too, which has that bug?

BTW, I've committed a fix for that bug, in:
https://github.com/processone/ejabberd/commit/5054a9933f29d6cc8a88486c62...

If you are sure you are using an ejabberd older than 18.01, then I cannot reproduce your problem.

Syndicate content