{"id":2415,"date":"2022-08-30T15:24:40","date_gmt":"2022-08-30T15:24:40","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/11\/problem-about-ejabberd-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:24:40","modified_gmt":"2022-08-30T15:24:40","slug":"problem-about-ejabberd-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-ejabberd-collection-of-common-programming-errors\/","title":{"rendered":"problem about ejabberd-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/04f0a4cae99b10d6e6dce61498bc7c81?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2323620<br \/>\nejabberd<br \/>\nI want to cluster ejabberd node, so I want each node to have a different node name. I searched over net, everywhere it says you can change nodename in ejabberdctl.cfg file by changing ERLANG_NODE=ejabberd@desired_name.But the moment I modify that line to any other name, when starting the server, it says &#8220;Crash dump written to&#8230;&#8230;&#8221;, and when stopping the server using ejabberdctl stop, it says &#8220;Failed RPC connection to the node ejabberd@desired_name: nodedown&#8221;.Can somebody tell me how to change<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/88ab4a81f71fd6107b281aec408b9a76?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nwhy<br \/>\nerlang ejabberd<br \/>\nI install the Ejabberd on my Lion with OTP\/r15b02.When start Ejabberd, there is one error in log =CRASH REPORT==== 18-Sep-2012::21:05:54 ===crasher:initial call: application_master:init\/4pid: &lt;0.176.0&gt;registered_name: []exception exit: {bad_return,{{ejabberd_app,start,[normal,[]]},{&#8216;EXIT&#8217;,&#8221;invalid hostname&#8221;}}}in function application_master:init\/4 (application_master.erl, line 138)ancestors: [&lt;0.175.0&gt;]messages: [{&#8216;EXIT&#8217;,&lt;0.177.0&gt;,normal}]links: [&lt;0.175.0&gt;,&lt;0.147.0&gt;<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6ccd2967a8626eac7264e1e7d3c51278?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nHari Haran<br \/>\nerlang ejabberd<br \/>\nLet assume I have two ejabberd server consider X and Y which has the same source and i did ejabberd clustering for those server by using this. Now consider A and B are user and those are connected in X server. Both A and B are in ONLINE state and those are connected via X server. If suppose X server is get shutdown or crashed by some issue. In this sceneraio whether the A and B are get OFFLINE state or A and B are in ONLINE state which is handle by Y server. I don&#8217;t know whether my thought is ri<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/22c6475a8de2fbfb315a94235d855b28?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEldad Mor<br \/>\nejabberd mnesia<br \/>\nI&#8217;m trying to establish a procedure for restoring my database from a crashed server to a new server. My server is running Ejabberd as an XMPP server, and I configured it to use postgresql instead of mnesia &#8211; or so I thought.My procedure goes something like &#8220;dump the contents of the original DB, run the new server, restore the contents of the DBs using psql, then run the system&#8221;. However, when I try running Ejabberd again I get a crash:=CRASH REPORT==== 3-Dec-2010::22:05:00 ===crasher:pid: &lt;0.<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/88ab4a81f71fd6107b281aec408b9a76?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nwhy<br \/>\nerlang ejabberd<br \/>\nI am using erlang R14B01 with Ejabberd, when I start Ejabberd on my Lion, it shows errors, who can tell me the reason, thanks! I have hosts config {hosts, [&#8220;localhost&#8221;]}.=INFO REPORT==== 2012-09-18 23:35:10 ===application: ejabberdexited: {bad_return,{{ejabberd_app,start,[normal,[]]},{&#8216;EXIT&#8217;,{badarg,[{erlang,port_control,[stringprep_port,2,&#8221;localhost&#8221;],[]},{stringprep,control,2,[]},{jlib,nodeprep,1,[]},{ejabberd_config,normalize_hosts,2,[]},{ejabberd_config,add_hosts_to_option,2,[]},{lists,foldl<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/710e229215517291637f638127aa97f0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser141682<br \/>\nerlang failover ejabberd<br \/>\nContext: I have a system that will need to support 20,000 connected chat users spread over 100 chat rooms. During performance testing I&#8217;ve found that I can get up to 6,000 connected users on a single box before I get a crash dump, so in production I&#8217;ll probably go with four servers in a cluster.My Question: I understand that a chatroom is bound to a server node, so that if the node dies the chatroom disappears with it and the users no longer belong to the room. Is there a way to &#8220;replicate&#8221; a ch<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9167f9f0abda20ccacf5bfcadb55fafa?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nvinnitu<br \/>\nerlang ejabberd<br \/>\nI have a problem with one module of ejabberd. It is http_bind. But when I debug deeply I found that after accept socket and spawning hadling process and when reasign process for recieve data for new created process by calling gen_tcp:controlling_process() failed with badarg, WHY?&#8230;{ok, Socket} = get_tcp:accept(ListenSocket), Opts = [{active, false}, &#8230;],% here function return result of proc_lib:spawn_link(handler, &#8230;) {ok, Pid} = ejabberd_http:start({gen_tcp, Socket}, Opts),gen_tcp:controllin<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e3d4212415bc280a21ad85d8022791fe?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlegoscia<br \/>\nerlang ejabberd<br \/>\nI am not able to understand the reason why Erlang crashes and restarts. I am running Ejabberd server and its log folder is always full of erl_crash_xxxx.dump files. How can I debug this problem.Here is a small part of erlang.log file:=CRASH REPORT==== 4-Sep-2013::19:44:51 ===crasher:initial call: ejabberd_http:init\/2pid: &lt;0.15614.15&gt;registered_name: []exception exit: {normal,{gen_fsm,sync_send_all_state_event,[&lt;0.15454.15&gt;,{http_put,2020093061,[{&#8220;xmlns&#8221;,&#8221;http:\/\/jabber.org\/protocol\/ht<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5f78604fbb8e1fe20090e3e96f62b083?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTom O&#8217;Connor<br \/>\nxmpp ejabberd<br \/>\nHow can I configure ejabberd so that it checks if all online users are actually online?I have a small ejabberd server with 2-5 users, if a users pc (using pidgin) crashes or power off the users status still shows online for some hours even if he is offline.Is there a way to remove non responding clients from the online list?<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/anSVJ.png?s=32&amp;g=1\" \/><br \/>\nHauke Laging<br \/>\ndebian jabber ejabberd<br \/>\nWhen I try start ejabberd service it always crashes.Starting jabber server: ejabberd Crash dump was written to: \/var\/log\/ejabberd\/erl_crash.dump Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})Crash dump was written to: \/var\/log\/ejabberd\/erl_crash.dump Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}) .I&#8217;ve changed hostanme of server, before that it wor<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/979eaa7aa8d6c3cc1e9ed2dc9f38bb74?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMarco W.<br \/>\ncrash erlang ejabberd crash-reports<br \/>\nEveryday I have a new Erlang crash report on my server. As ejabberd is the only Erlang-thing I use, this must be the cause of the crash.The logfile (erl_crash.dump) has almost 9,000 lines so I have no idea how to debug that. But when I searched for &#8220;ejabberd&#8221; in that logfile, there were 5 occurrences &#8211; and every single occurrence was something related to &#8220;ejabberdctl&#8221;.I&#8217;m addressing ejabberdctl via PHP script (exec()) to programatially create users. Could that be the cause for the crash (somehow<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e169f2f42a8369cfdae51218fbcceb33?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHunt<br \/>\nxmpp ejabberd<br \/>\nWhen i try to start my ejabberd server using following commond\/etc\/init.d\/ejabberd startit shows following but nothing starts when i fire www.example.com:5280\\http-bindStarting ejabberd: [ OK ]as my logs at \/var\/log\/ejabberd\/ejabberd.log are empty but to figure it out i tried running ejabberdctl liveand got following log ,i really don&#8217;t know wht this says specially over here {error,duplicate_name} so can any please help me how to get rid off this and sta<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cadfc2b5f91df6ca905cbc5273d79847?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKMT<br \/>\nerlang ejabberd<br \/>\nThe problem I have is that the hook I defined is not being called on the event &#8220;user_send_packet&#8221;. I did assume that any stanza (including messages) that is being sent would trigger this event. I have taken into account the priority of how the hook is being called by setting it to &#8216;0&#8217;. In the log I have verified that the module is started (&#8220;mod_stanza_ack starting&#8221;). The erl file did compile, it only got the warning &#8220;gen_mod&#8221; is undefined, but I have read on a ejabberd mailing list that this is<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/19bec4b9e0e8dbce229d2ab90d2c5041?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser601836<br \/>\nerlang ejabberd<br \/>\nI would like to collect useful statistics in ejabberd.Let&#8217;s say I would be interested in knowing how many messages were sent to one or more specific internal components, what is in your opinion the best between these two solutions?Set up a new component (based on gen_mod + gen_server) with a filter_packet hook and handle in a specific function all the messages directed towards the aforesaid components. In order to not bother the message forwarding I could spawn a function to route asap the messa<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/391df6fe7f6952a3d36a0e909c5160f1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCarlosfocker<br \/>\nerlang ejabberd<br \/>\nWhen trying to run this command on Ejabberd 2.1.5-3 with Erlang R14Aejabberdctl dump \/tmp\/ejabberd1.textto dump the registered users from ejabberd I receive{error_logger,{{2012,5,17},{17,9,48}},&#8221;Too short cookie string&#8221;,[]} {error_logger,{{2012,5,17},{17,9,48}},crash_report,[[{initial_call,{auth,init,[&#8216;Argument__1&#8217;]}},{pid,&lt;0.19.0&gt;},{registered_name,[]},{error_info,{exit,{&#8220;Too short cookie string&#8221;,[{auth,init_cookie,0},{auth,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]},[{gen_<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cadfc2b5f91df6ca905cbc5273d79847?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKMT<br \/>\nerlang ejabberd<br \/>\nI am trying to figure out what is wrong with this code, cause it is giving me errors preventing it from compiling properly into a beam file. I do not see what is wrong with the syntax. Is there an IDE which could help me out?These are the errors:parallels@parallels-Parallels-Virtual-Platform:\/var\/backend\/ejabberd_modules# erlc -I \/var\/tmp\/ejabberd\/src\/ mod_stanza_ack.erl.\/mod_stanza_ack.erl:97: syntax error before: &#8216;.&#8217;.\/mod_stanza_ack.erl:98: syntax error before: Body.\/mod_stanza_ack.erl<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/GlHxN.png?s=32&amp;g=1\" \/><br \/>\nSankalp Singha<br \/>\nerlang websocket osx-mountain-lion ejabberd<br \/>\nI have downloaded ejabberd and even done a :sudo port install ejabberdAfter this, I am trying to install the ejabberd-websocket module from here : https:\/\/github.com\/superfeedr\/ejabberd-websocketsHowever, try as I might I am not able to install it by issuing :.\/build.shThis is the error that I am getting :Recompile: src\/mod_websocket src\/mod_websocket.erl:22: can&#8217;t find include file &#8220;ejabberd.hrl&#8221; src\/mod_websocket.erl:23: can&#8217;t find include file &#8220;jlib.hrl&#8221; src\/mod_websocket.erl:36: undefined ma<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/be45934b74e22dd2fa4740c70b4a8b3d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSean Thoman<br \/>\njavascript windows node.js chat ejabberd<br \/>\nI am learning node JS and want to create a very basic single purpose web service that runs a windows command (to create a new user in ejabberd chat server) on the server where the client can pass in a specific argument to the command (using ajax I imagine). I&#8217;ve been using the basic &#8216;createServer&#8217; tutorial as a template:var sys = require(&#8216;util&#8217;) var http = require(&#8216;http&#8217;); var exec = require(&#8216;child_process&#8217;).exec;var path = &#8216;&#8221;C:\\\\Program Files\\\\ejabberd-2.1.8\\\\bin\\\\ejabberdctl&#8221;&#8216;; http.createSe<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e30479a66da20350ef9223419424f60c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAndrew<br \/>\nphp authentication external xmpp ejabberd<br \/>\nI&#8217;m stumped at the moment. I&#8217;m trying to get ejabberd to authenticate users based on my web application&#8217;s already-existing MySQL user table.Environment infoUbuntu 8.04 server Ejabberd 2.0.1-2 (using hardy-backports) PHP 5.2.4 MySQL 5.0.51a-3In ejabberd.cfg:I&#8217;ve commented out the following default auth_method line:%%{auth_method, internal}.And uncommented and edited the following lines:{auth_method, external}. {extauth_program, &#8220;\/var\/myapplication\/xmpp_auth.php&#8221;}.The PHP scriptThe PHP script is<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3921eaca53507414a865916ef83b4f63?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ngboverflow<br \/>\neclipse import erlang ejabberd erlide<br \/>\ntrying to understand the working of ejabberd.I have some problems importing the source code. It would be of great help if you can help trouble shoot.Following is the problem:I install eclipse Juno, install erlide from eclipse market place. Set up the installed run-times as per instructions in here . But when I import the ejabberd source code using the erlang project in import option from the file menu, I get the following error:An error has occurred. See error log for more details. java.lang.Nu<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ac7e54c246b6c2a44e8851b92aa700fb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAbhinav Singh<br \/>\nphp mysql ejabberd authentication extjs<br \/>\nI am trying to setup extauth with ejabberd, however i just cannot get it working (even after googling for a fix on web). I have set following inside ejabberd.cfg:{auth_method, external}. {extauth_program, &#8220;\/etc\/ejabberd\/extauth.class.php&#8221;}.When i restart ejabberd after updating configs, I see this towards the end of ejabberd.log:=ERROR REPORT==== 2010-12-26 15:38:10 === C(&lt;0.4476.0&gt;:extauth:110) : normal=INFO REPORT==== 2010-12-26 15:38:10 === I(&lt;0.4181.0&gt;:ejabberd_app:69) : ejabberd<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/BmDMJ.jpg?s=32&amp;g=1\" \/><br \/>\nRohit Tailor<br \/>\nejabberd<br \/>\nHow to resolve Ejabberd error:&#8221;[Microsoft][SQL Server Native Client 10.0]Communication link failure SQLSTATE IS: 08S01&#8243;.I described the issue in the below thread but have been told that it is too localized and also given -4 marking to ask this. &#8220;[Microsoft][SQL Server Native Client 10.0]Communication link failure SQLSTATE IS: 08S01&#8243;Please help.<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cadfc2b5f91df6ca905cbc5273d79847?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKMT<br \/>\nerlang ejabberd exmpp<br \/>\nPreviously I was using xml:get_tag_attr_s(&#8220;type&#8221;, Packet) for that debug line in ejabberd 2.1.10, but that is not working anymore in ejabberd 13.03. Probably because it is deprecated according to the docs (http:\/\/www.process-one.net\/docs\/exmpp\/devdoc\/trunk\/xml.html#get_attr_s-2), so I tried using a function from exmpp library.I am getting an error on the second DEBUG line (First debug line works fine). And ideas how to get the value from the attribute? Code excerpt:on_user_send_packet(From, To,<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/841941a90f5a4b64b7b45c4550df5a2a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLucas<br \/>\nmysql ejabberd<br \/>\nI use ejabberd 2.1.12. It seems to work fine, but in logs I keep getting mysql connection errors. I thought that this is because of mod_roster_odbc (according i.e. to this thread, but I disabled mod_roster and mod_shared_roster and nothing has changed).I am on amazon EC2 on ubuntu 12.04. Errors are raised about 2 minutes after connecting some users to chat.UPDATE: I have found some pattern here. When I connect few users (using adium), every few minutes there is few errors like that. This probabl<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2014-01-11 07:27:01. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>user2323620 ejabberd I want to cluster ejabberd node, so I want each node to have a different node name. I searched over net, everywhere it says you can change nodename in ejabberdctl.cfg file by changing ERLANG_NODE=ejabberd@desired_name.But the moment I modify that line to any other name, when starting the server, it says &#8220;Crash dump written [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2415","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2415"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2415\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}