ejabberd - Comments for "[ejabberdctl] create_rooms_file: file format" https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format en It is already documented: $ https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67318 <p>It is already documented:</p> <pre> $ ejabberdctl create_rooms_file Error: the command "create_rooms_file" requires 1 more argument. Command Name: create_rooms_file Arguments: file::string Returns: res::rescode Tags: muc Description: Create the rooms indicated in file Provide one room JID per line. Rooms will be created after restart. </pre> Thu, 09 Feb 2017 16:24:19 +0000 badlop comment 67318 at https://www.ejabberd.im Good! Anyway i think that the https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67314 <p>Good! Anyway i think that the documentation should be updated, just to avoid other users/developers to digg into the internet in order to find the file format! :)</p> <p>Thanks! Bye</p> Thu, 09 Feb 2017 08:15:59 +0000 ferraresi comment 67314 at https://www.ejabberd.im Better than that, I've added https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67295 <p>Better than that, I've added support for non-JID lines (for example empty lines) in the command. It will be supported in next release.</p> <p><noindex><a href="https://github.com/processone/ejabberd/commit/b2a2e0f135f54a562c7157066df5412d32608482" title="https://github.com/processone/ejabberd/commit/b2a2e0f135f54a562c7157066df5412d32608482" rel="nofollow" >https://github.com/processone/ejabberd/commit/b2a2e0f135f54a562c7157066d...</a></noindex></p> Tue, 31 Jan 2017 16:51:20 +0000 badlop comment 67295 at https://www.ejabberd.im Hi! I'm so sorry for the huge https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67292 <p>Hi!<br /> I'm so sorry for the huge delay... :( Anyway, today I have updated my eJabberd installation to version 17.01 and the command</p> <div class="codeblock"><code>ejabberdctl create_rooms_file /root/ejabberd_muc_rooms.txt</code></div> <p>works correctly as is returns a:</p> <div class="codeblock"><code>Creating room room1@conference.localhost</code></div> <p>message and after the eJabberd server restart the room is created on the server.<br /> The only thing i noticed is that the "ejabberd_muc_rooms.txt" file should not contain empty lines, otherwise the command will fail.</p> <p>I think it could be usefull to update the documentation (<a href="https://docs.ejabberd.im/admin/ejabberdctl/muc-admin/#toc_6" title="https://docs.ejabberd.im/admin/ejabberdctl/muc-admin/#toc_6">https://docs.ejabberd.im/admin/ejabberdctl/muc-admin/#toc_6</a>) with the following information:</p> <ul> <ol>the filename should be provided with full path</ol> <ol>the file should not contain empty lines</ol> <ol>the eJabberd server should be restarted after the execution of the "create_rooms_file" command</ol> </ul> <p>Thank you so much for helping me! :)</p> Tue, 31 Jan 2017 11:48:09 +0000 ferraresi comment 67292 at https://www.ejabberd.im That's exactly the error that https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67183 <p>That's exactly the error that I got before applying the fix. It seems as if you got an older version (previous to the fix), or that you are not starting the fixed version that you just compiled.</p> <p>Check if the path where you installed the fixed beam file is where ejabberd is reading it. For that you can attach an erlang shell to your node with "ejabberdctl debug", and execute in it:</p> <pre> (ejabberd@localhost)1&gt; code:is_loaded(mod_muc_admin). {file,"/lib/ejabberd-16.09.51/ebin/mod_muc_admin.beam"} </pre> Thu, 10 Nov 2016 18:53:58 +0000 badlop comment 67183 at https://www.ejabberd.im Hi, sorry for the delay! https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67181 <p>Hi, sorry for the delay! Thank you so much for the response!</p> <p>I've tried using the full path (adding also the txt extension) and changing the file content (single row with no empty trailer row, single row with trailer row, multiple rows with trailer row, and multiple rows without trailer row), but it seems to break on the first row of the file:</p> <pre> # ejabberdctl create_rooms_file /root/ejabberd_muc_rooms.txt Problem 'error function_clause' occurred executing the command. Stacktrace: [{io_lib_fread,fread_skip_latin1_nonwhite, [&lt;&lt;"room1@conference.localhost\n"&gt;&gt;,0,[]], [{file,"io_lib_fread.erl"},{line,399}]}, {io_lib_fread,fread1,7,[{file,"io_lib_fread.erl"},{line,229}]}, {mod_muc_admin,read_room,1, [{file,"src/mod_muc_admin.erl"},{line,535}]}, {mod_muc_admin,create_rooms_file,1, [{file,"src/mod_muc_admin.erl"},{line,555}]}, {ejabberd_ctl,call_command,4, [{file,"src/ejabberd_ctl.erl"},{line,329}]}, {ejabberd_ctl,try_call_command,4, [{file,"src/ejabberd_ctl.erl"},{line,298}]}, {ejabberd_ctl,process2,4, [{file,"src/ejabberd_ctl.erl"},{line,247}]}, {ejabberd_ctl,process,2, [{file,"src/ejabberd_ctl.erl"},{line,225}]}] </pre><p> I googled for the "fread_skip_latin1_nonwhite" error, but i didn't find anything interesting (but i'm not used to erlang, so maybe i searched for the wrong things!). Any suggestion?<br /> Currently i'm using eJabberd 16.09.50 downloaded from the github's head after your commit.</p> Thu, 10 Nov 2016 08:23:56 +0000 ferraresi comment 67181 at https://www.ejabberd.im Looking at https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67177 <p>Looking at <noindex><a href="http://erlang.org/doc/man/file.html" title="http://erlang.org/doc/man/file.html" rel="nofollow" >http://erlang.org/doc/man/file.html</a></noindex><br /> &gt; enoent<br /> &gt; The directory does not exist.</p> <p>The best is to provide the filename with full path, because the ejabberdctl script is not running in .</p> <p>Notice that in my example call I provided the full path.</p> Mon, 07 Nov 2016 16:16:40 +0000 badlop comment 67177 at https://www.ejabberd.im Hi, thanks for the response! https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67176 <p>Hi,<br /> thanks for the response! :)<br /> I applied the fix, but I still have problems.</p> <p>File:</p> <pre> # less ejabberd_muc_rooms test@conference.localhost </pre><p> Command:</p> <pre> # ejabberdctl create_rooms_file ejabberd_muc_rooms Problem 'error {badmatch,{error,enoent}}' occurred executing the command. Stacktrace: [{mod_muc_admin,create_rooms_file,1, [{file,"src/mod_muc_admin.erl"},{line,554}]}, {ejabberd_ctl,call_command,4, [{file,"src/ejabberd_ctl.erl"},{line,329}]}, {ejabberd_ctl,try_call_command,4, [{file,"src/ejabberd_ctl.erl"},{line,298}]}, {ejabberd_ctl,process2,4, [{file,"src/ejabberd_ctl.erl"},{line,247}]}, {ejabberd_ctl,process,2, [{file,"src/ejabberd_ctl.erl"},{line,225}]}, {rpc,'-handle_call_call/6-fun-0-',5, [{file,"rpc.erl"},{line,187}]}] </pre><p> Where am i wrong? Maybe i've lost some module's options...</p> Mon, 07 Nov 2016 09:11:58 +0000 ferraresi comment 67176 at https://www.ejabberd.im While looking for your https://www.ejabberd.im/forum/28597/ejabberdctl-createroomsfile-file-format#comment-67174 <p>While looking for your question, I noticed a bug in ejabberd that probably breaks that command. I've committed a fix that you probably need to apply to use it:<br /> <noindex><a href="https://github.com/processone/ejabberd/commit/5e723bc90e9701c7112d741558bfd8b45ea637b0" title="https://github.com/processone/ejabberd/commit/5e723bc90e9701c7112d741558bfd8b45ea637b0" rel="nofollow" >https://github.com/processone/ejabberd/commit/5e723bc90e9701c7112d741558...</a></noindex></p> <p>Now regarding your question: simply put room JIDs one per line, as explained in</p> <pre> $ ejabberdctl help create_rooms_file Command Name: create_rooms_file Arguments: file::string Returns: res::rescode Tags: muc Description: Create the rooms indicated in file Provide one room JID per line. Rooms will be created after restart. </pre><p>Example:</p> <pre> $ cat /tmp/rooms.txt room1@conference.localhost room2@conference.localhost room3@conference.localhost $ ejabberdctl create_rooms_file /tmp/rooms.txt Creating room room3@conference.localhost Creating room room2@conference.localhost Creating room room1@conference.localhost </pre><p>Remember that the rooms will be fully accessible only after you restart ejabberd (or at least the mod_muc service, using WebAdmin for example to restart that module).</p> Fri, 04 Nov 2016 15:59:23 +0000 badlop comment 67174 at https://www.ejabberd.im