What version of ejabberd are you using?
ejabberd 17.07.30
What operating system (version) are you using?
Ubuntu 14.04 LTS
How did you install ejabberd (source, package, distribution)?
source
What did not work as expected? Are there error messages in the log?
I created an MUC room using Ejabberd Rest API. The room was created and a record was inserted in the MySQL DB. I then destroyed the room using destroy_room Rest API method. I got a return code as 0 and when I refreshed the Web Admin MUC Panel the rooms disappeared. but the record still exists in MySQL Database. also whatever changes I do to the MUC Room in MySQL DB Eg: Setting Public to True/False, changing Room Name internally in muc_room table itself is not reflected back in the Web Admin even after I restart the Ejabberd Server.
Coming to the Question, is the data of MUC Rooms stored externally in some other storage? because the values that are shown in Web Admin doesn't coincide with the data in MySQL DB. also some of the Rest API Functionalities that are related to MUC Room doesn't seem to work properly even though I get a success Status (return code 0 ) on invocation.
Similarly, I register a nick in MUC Service using Rest API. the count of Nick is Increased when seen in Ejabberd Web Admin but there is no Data Available about the Nick in muc_registered table of MySQL DB. But there's an entry in muc_registered table when a new Nick is registered via XMPP Client such as Psi. Most of the MUC Functions seem to work properly when invoked from Psi client but doesn't work from Rest API even though the Return Code is 0 ( Success status ) for any method I invoke.
Also sometimes the data I change in DB is reflected only when I restart the Ejabberd Server.
I'm not getting full control over MUC over the Ejabberd Rest API. Any help would be appreciated.
Below is my mod_muc
mod_muc:
host: "muc.xxxxxx.xxxx.xxx"
access:
- allow
access_admin:
- allow: admin
access_create: muc_create
access_persistent: muc_create
history_size: 0
max_users: 256
max_user_conferences: 128
max_room_id: 24
max_room_name: 24
max_users_presence: 128
default_room_options:
allow_change_subj: true
max_users: 256
members_only: true
persistent: false
public: false
Thanks in advance :)
was the unexpected behavior? What was the expected result?
While others can reply to all your questions, I personally will address this one:
Also sometimes the data I change in DB is reflected only when I restart the Ejabberd Server
It's not supposed to directly change data in an SQL server, because ejabberd uses caching (sort of), so it won't be updated until ejabberd needs to re-read the database. With moving mod_muc to the new caching implementation (introduced in 17.06), it will be possible to change database values and subsequently flush the cache.
With moving mod_muc to the new caching implementation (introduced in 17.06), it will be possible to change database values and subsequently flush the cache.
Is there a way where I can change database values and subsequently flush the cache?
Also, is it possible to take a look at the data values that are currently in the memory?
Regarding the comments not related to caching:
I created an MUC room using Ejabberd Rest API. The room was created and a record was inserted in the MySQL DB. I then destroyed the room using destroy_room Rest API method. I got a return code as 0 and when I refreshed the Web Admin MUC Panel the rooms disappeared. but the record still exists in MySQL Database.
Problem confirmed. It also happens with Mnesia storage. I've just committed two fixes to git.
also whatever changes I do to the MUC Room in MySQL DB Eg: Setting Public to True/False, changing Room Name internally in muc_room table itself is not reflected back in the Web Admin even after I restart the Ejabberd Server.
Problem not confirmed. When I change a room option using API, it is reflected in the WebAdmin correctly. Maybe the previous problem affected here too.
the values that are shown in Web Admin doesn't coincide with the data in MySQL DB.
In my tests using ejabberd 17.08, those values match. Maybe I have cache disabled.
also some of the Rest API Functionalities that are related to MUC Room doesn't seem to work properly even though I get a success Status (return code 0 ) on invocation.
Yes, that may be possible, as not all API calls check the exact result, and simply return 0.
Similarly, I register a nick in MUC Service using Rest API. the count of Nick is Increased when seen in Ejabberd Web Admin but there is no Data Available about the Nick in muc_registered table of MySQL DB. But there's an entry in muc_registered table when a new Nick is registered via XMPP Client such as Psi.
Yes, because that command is still mnesia-dependent, and the number shown in webadmin is read from mnesia too.
Most of the MUC Functions seem to work properly when invoked from Psi client but doesn't work from Rest API even though the Return Code is 0 ( Success status ) for any method I invoke.
Because there are still some commands that are mnesia-dependent, and don't work with other database backends.
Also sometimes the data I change in DB is reflected only when I restart the Ejabberd Server.
That may be related to cache, as mentioned by Zinid.
In my tests using ejabberd 17.08, those values match. Maybe I have cache disabled.
How do I set the Cache? is it good to have Cache enabled?
Yes, because that command is still mnesia-dependent, and the number shown in webadmin is read from mnesia too.
This means the muc_registered table will not be used for storing Registered Nick information? if Not, when will the data from mnesia will be committed to the DB Table? Also, is there a way where I can visualize the mnesia data available?
I took a look at my Storage Types for each of the Database Table. There was an option called Ram and Disc copy. what does Ram copy and Disc Copy correspond to?
Similarly, I register a nick in MUC Service using Rest API. the count of Nick is Increased when seen in Ejabberd Web Admin but there is no Data Available about the Nick in muc_registered table of MySQL DB.
OK, I've finally modified the muc_register_nick and muc_unregister_nick commands to work with any database, and committed to git. This should solve all the problems and questions you made related to that problem.
I have a small doubt. I installed ejabberd from source using this document as reference https://docs.ejabberd.im/admin/installation/#installing-ejabberd-from-source-code
Now to update my Ejabberd, is it okay if I simply run git pull in the respective git directory?
Yes, but better clean everything before compiling, i.e.
$ make distclean
$ ./autogen.sh
$ ./configure --blah-blah
$ make
Below are the set of commands i executed
$ git pull
$ make distclean
$ ./autogen.sh
$ ./configure --enable-mysql --enable-debug
$ make
Here is the debug log
...
...
Compiled src/mod_stats.erl
Compiled src/ejabberd_sm_mnesia.erl
Compiled src/mod_stream_mgmt.erl
Compiled src/ejabberd_xmlrpc.erl
/usr/lib/erlang/bin/escript rebar skip_deps=true compile
WARN: Missing plugins: [rebar3_hex]
==> rel (compile)
==> ejabberd (compile)
I then stopped ejabberd server by typing sudo ejabberdctl stop and started it by typing sudo ejabberdctl start. The message I received was ejabberd 17.07.30 is running in that node
seems like the ejabberd server version is still in 17.07.30. is this normal? because the previous issues were fixed and committed to ejabberd 17.09 milestone.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.