How to solve Mnesia - inconsistent_database error in clustered ejabberd environment?

We have an ejabberd cluster set up consisting of two hosts with which we are running into issues during restarts of the hosts.We are seeing inconsistent_database errors logged in. However, we cannot conclusively analyse what in configurations or module_init executions may actually cause the behaviour.Deleting the mnesia on node1 may help resolve the issue. Yet, it is not desirable for administration purposes.Would like to request a review of below data along with some configuration and feedback on what may actually be causing the behavior as we...Read more

lager - ejabberd odbc error + unable to figure out exact source

my ejabberd server is constantly crashing and it is somewhat related to ODBC module but I am not able to understand the issue. Below are the logs. Can anyone help me interpret?I have copy pasted a few messages below. =ERROR REPORT==== 14-Oct-2015::00:27:51 === ** State machine <0.27422.5> terminating ** Last message in was {'$gen_sync_event', {<0.27896.5>,#Ref<>}, {sql_cmd, {sql_query,<<"SELECT 1;">>}, {1444,782471,512104}}} ** When State == session_established ** Data == {state,<0.27423.5>,odbc,30000,<<"ab...Read more

ejabberd - Enabling mod_announce in MongooseIM

I have nearly zero experience with ejabberd or MongooseIM (a fork of ejabberd) so bear with me.I would like to enable mod_announce so that I can broadcast messages, but there is no mod_announce.erl in the source tree. I do see references to mod_announce elsewhere in the source so I tried simply to enable it in the config:{mod_private, []},{mod_roster_kov, []},{mod_announce, [access, announce]},{mod_sic, []},{mod_ping, [{send_pings, true}, {ping_interval, 300}, {timeout_action, kill}]},However, now the server won't start. The log says:2015-03-11...Read more

Ejabberd does not work on MAC with [Failed to open socket at [::]:5222]

I am facing errors at the first cup of Ejabberd.On my Mac(10.13.6) I installed "" and I have followed all instruction written in official website. ( installation was completed I noticed nothing significant and found error logs were generated as below. 2019-01-16 10:02:03.936 [error] <0.316.0>@ejabberd_listener:report_socket_error:417 Failed to open socket at [::]:5222 for ejabberd_c2s: address already in use2019-01-16 10:02:03.937 [error] <0.315.0> ...Read more

Unable to understand a crash while adding a field in vcard in ejabberd

I am trying to add a new field in the vcard as “Abc” . For this I added an xml for this “Abc” field in xmpp_codec.spec file. And referenced it in the #vcard_temp. I placed the xmpp_codec.erl,xmpp_codec.hrl, xep0054.erl files thus generated after ‘make spec’ in their respective directories.But when I try to add a value of this field by sending this iq<<"<iq id='D2sPz-22' type='set'><vCard xmlns='vcard-temp'><N><GIVEN>byname</GIVEN></N><Abc>10</Abc><FN>byname </FN><NICKNAME>b...Read more

ejabberd - org.apache.xmlrpc.XmlRpcException: Error -118 {error,access_rules_unauthorized}

I m trying to get the response of get_roster in ejabberd through XML-RPC client but I am using ejabberd 18.9 version and it is showing me this error: org.apache.xmlrpc.XmlRpcException: Error -118 A problem '{error,access_rules_unauthorized}' occurred executing the command get_roster with arguments [{user,<<"admin">>},{server,<<"localhost">>}]Can somebody suggest how can I solve this?Here is my java client code: XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL("http://localhost:4560"));...Read more

Changing or adding prefix for Ejabberd Database tables

Is there any possibility to change or add a prefix for user table in Ejabberd database. My requirement is, I want to user authentication ( using php ) via my own database ( pgsql ). Using external auth settings I have managed to do that. Same as I would like to save all my chat related data on that same DB. ( Not saving inside Ejabberd ). But I already have a user credential table, unfortunately it is not "users" and I can not change it. I am thinking if I will change the Ejabberd "users" table reference into my DB's user data table name, I co...Read more

Does ejabberd community edition support rest API

I can't find clear information about the differences between Ejabberd Business and Ejabberd community (apart from the list of RFC/XEP here : about the rest API : does community edition support it ?In the documentation ( there is no info about which functionnality is supported by which version.I also found this page : on the Business edition features but it seems to ...Read more

Clustering in Ejabberd in 2 linux OS

I am currently trying to cluster ejabberd using 2 ubuntu instances but I am facing some problems. I have 2 instances inside oracle Virtual Box .My current ejabberd.yml file for both instances have the following host:-hosts: - "xyz-VirtualBox"For node1 I modify the ejabberdctl.cfg and change the ejabberd name like the following for exampleERLANG_NODE=ejabberd@ is the ip of my ubuntu machine 1 instance .I make sure that I have the same .erlang.cookie in 2nd ubuntu machine and done the same changes o...Read more

multiuserchat - Ejabberd trying to subscribe a user through api

I am trying to subscribe a test user to a test room using the Ejabberd API. I am sure I just misconfigured something but I can't seem to find the issue.I am running Ejabberd 16.09 and trying to use mod_http_apiMy configuration is the following:hosts: - "localhost" - ""listen: - port: 5285 module: ejabberd_http request_handlers: "/api": mod_http_apiacl: admin: user: - "@localhost"modules: mod_muc: mam: true default_room_options: allow_subscription: true access: - allow access_adm...Read more

ejabberd-18.12 : parse Packet inside hook

Hook code :user_receive_packet({Packet, #{jid := JID} = C2SState}) -> ?INFO_MSG("~p.", [Packet]), {Packet, C2SState}.Output:{message,<<"49a85099-6fa6-4aa5-84ab-bced89adf847">>,groupchat,<<"en">>,{jid,<<"sgj279_59f990094dd64c4846cc38c5_59fa99bbfdbd1ab22e59df29">>,<<"conference.localhost">>,<<"localhost">>,<<"sgj279_59f990094dd64c4846cc38c5_59fa99bbfdbd1ab22e59df29">>,<<"conference.localhost">>,<<"localhost">>},{jid,<<"test1">>,<...Read more

ejabberd - retrieve timestamp value inside muc_filter_message hook

Is it possible to get the timestamp of the message inside muc_filter_message hook ? I need to notify the muc messages, the notification payload must include the timestamp of the messages.muc_filter_message(#message{from = From, body = Body} = Pkt, #state{config = Config, jid = RoomJID} = MUCState, FromNick) -> ?INFO_MSG("~p.", [From#jid.lserver]), PostUrl = gen_mod:get_module_opt(From#jid.lserver, ?MODULE, post_url, fun(S) -> iolist_to_binary(S) end, list_to_binary("")),Is there a field that I can extract from P...Read more