ejabberd - Comments for "SOLVED: ejabberd 1.1.3 on gentoo using mysql: cant add users or authenticate." https://www.ejabberd.im/node/2777 en installationg from source produces strange errors https://www.ejabberd.im/node/2777#comment-51613 <p><strong>UPDATE:</strong> Fixed somehow!</p> <p>Installing from SVN somehow led to this:</p> <div class="codeblock"><code># ejabberdctl register admin FQDN.com march81<br />RPC failed on the node ejabberd@localhost: nodedown <p>=ERROR REPORT==== 14-Jan-2008::02:04:02 ===<br />Error in process &lt;0.34.0&gt; on node &#039;ejabberdctl@thedude&#039; with exit value: {badarg,[{erlang,list_to_existing_atom,[&quot;ejabberd@thedude&quot;]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}</p> <p>Commands to start an ejabberd node: (etc)</p></code></div> <p>...so I unmasked my distro's 1.1.4 package and installed that this time. I did it from scratch, essentially following Badlop's instructions (just generally being methodical), and for whatever reason it worked this time.</p> <p>I wish I could say what is was, the upgrade, the new cfgs, or karma, but I can't.</p> <p>I did get some problems with my ssl.pem files not being found, so I used the full path i ejabberd.cfg, and had to change their perms so they were readable to the jabber user on my system.</p> <p>I need to give this a rest for a few hours and try to add other domains.</p> Mon, 14 Jan 2008 08:46:48 +0000 FuriousGeorge comment 51613 at https://www.ejabberd.im Debugging odbc auth account creation https://www.ejabberd.im/node/2777#comment-51612 <p>It seems you use Gentoo's ejabberd 1.1.3 package, and you spend several hours trying to figure what's going on here. Since I don't know where the problem is, and after several days nobody else answered, I propose you to spend another hour or so, to at least know the nature of the problem.</p> <ol> <li>Backup and remove all the ejabberd files. So you start with it from scratch. </li><li>Get ejabberd source code from SVN </li><li>Compile ejabberd. Quite probably you already have most of the dependencies. </li><li>Configure ejabberd: you just need to put your FQDN. </li><li>Start ejabberd and check that it works correctly. The accounts you create are stored in a Mnesia table. </li><li>As everything works correctly, now let's complicate it. Get the mysql module again (or copy its beam files). Configure ejabberd to use that authentication method. </li><li>Start ejabberd. Now there are no accounts. Try to create one. If it works correctly, all we get happy. If fails with the old message 'account exists', then let's debug it. </li></ol> <p>To increase the level of debugging in ejabberd, you can use the option debug_level in ejabberd.cfg</p> <p>If those debug messages don't help you much to find the problem, put back the default debug_level and let's add your custom messages in the code. The file to edit is ejabberd_auth_odbc.erl and the function is try_register/3 (around line 116). You can add as many log messages as you want, but I think this example covers all the possibilities:</p> <pre>try_register(User, Server, Password) -&gt; ?INFO_MSG("Let's start with the function try_register with ~n User: ~p, Server: ~p, Password: ~p", [User, Server, Password]), case jlib:nodeprep(User) of error -&gt; ?INFO_MSG("Error: invalid JID; with user: ~p", [User]), {error, invalid_jid}; LUser -&gt; ?INFO_MSG("OK, nodeprep returns LUser: ~p", [LUser]), Username = ejabberd_odbc:escape(LUser), Pass = ejabberd_odbc:escape(Password), LServer = jlib:nameprep(Server), ?INFO_MSG("So, let's call add_user with ~n LServer: ~p, Username: ~p, Pass: ~p", [LServer, Username, Pass]), case catch odbc_queries:add_user(LServer, Username, Pass) of {updated, 1} -&gt; ?INFO_MSG("Success creating the account!!", []), {atomic, ok}; E -&gt; ?INFO_MSG("Error creating the account :( Maybe the account already exists ~n Result: ~p", [E]), {atomic, exists} end end.</pre> Sun, 13 Jan 2008 23:50:08 +0000 mfoss comment 51612 at https://www.ejabberd.im