ejabberd - Comments for "error when migrate from mnesia to mysql backend" https://www.ejabberd.im/forum/29705/error-when-migrate-mnesia-mysql-backend en I updated to version ejabberd https://www.ejabberd.im/forum/29705/error-when-migrate-mnesia-mysql-backend#comment-67751 <p>I updated to version ejabberd 17.12.<br /> Also was updated the MySql scheme<br /> But the issue still remain.</p> <p>Please tell me why there is an error during the migration?</p> <div class="codeblock"><code>14:38:53.572 [warning] Ignoring export for module mod_irc: Mnesia table irc_custom doesn&#039;t exist (most likely because the module is unused)<br />14:39:35.036 [error] Failed export for module pubsub_db and table pubsub_node: function_clause<br />14:39:35.156 [error] SQL transaction restarts exceeded<br />** Restarts: 10<br />** Last abort reason: &quot;#23000Cannot add or update a child row: a foreign key constraint fails (`ejabberd`.`pubsub_state`, CONSTRAINT `pubsub_state_ibfk_1` FOREIGN KEY (`nodeid`) REFERENCES `pubsub_node` (`nodeid`) ON DELETE CASCADE)&quot;<br />** Stacktrace: [{ejabberd_sql,sql_query_t,1,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,186}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejabberd_sql,outer_transaction,3,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,497}]},{ejabberd_sql,run_sql_cmd,4,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,434}]},{p1_fsm,handle_msg,10,[{file,&quot;src/p1_fsm.erl&quot;},{line,582}]},{proc_lib,init_p_do_apply,3,[{file,&quot;proc_lib.erl&quot;},{line,247}]}]<br />** When State == {state,&lt;0.449.0&gt;,mysql,undefined,30000,&lt;&lt;&quot;rtr.host.ru&quot;&gt;&gt;,{{[],[]},0,1000}}<br />14:39:35.161 [error] Failed export for module pubsub_db and table pubsub_state: {{badmatch,{aborted,&quot;#23000Cannot add or update a child row: a foreign key constraint fails (`ejabberd`.`pubsub_state`, CONSTRAINT `pubsub_state_ibfk_1` FOREIGN KEY (`nodeid`) REFERENCES `pubsub_node` (`nodeid`) ON DELETE CASCADE)&quot;}},[{ejd2sql,output,4,[{file,&quot;src/ejd2sql.erl&quot;},{line,186}]},{mnesia_tm,apply_fun,3,[{file,&quot;mnesia_tm.erl&quot;},{line,836}]},{mnesia_tm,execute_transaction,5,[{file,&quot;mnesia_tm.erl&quot;},{line,811}]},{ejd2sql,&#039;-export/3-fun-4-&#039;,5,[{file,&quot;src/ejd2sql.erl&quot;},{line,87}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejd2sql,export,3,[{file,&quot;src/ejd2sql.erl&quot;},{line,85}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejd2sql,export,2,[{file,&quot;src/ejd2sql.erl&quot;},{line,71}]}]}<br />14:39:35.166 [error] Failed export for module pubsub_db and table pubsub_item: badarg<br />14:39:35.166 [warning] Ignoring export for module mod_push: Mnesia table push_session doesn&#039;t exist (most likely because the module is unused) <p>(ejabberd@rtr)3&gt; ejd2sql:export(&lt;&lt;&quot;rtr.host.ru&quot;&gt;&gt;, sql).<br />14:40:31.953 [warning] Ignoring export for module mod_irc: Mnesia table irc_custom doesn&#039;t exist (most likely because the module is unused)<br />14:41:07.900 [error] SQL transaction restarts exceeded<br />** Restarts: 10<br />** Last abort reason: [35,50,51,48,48,48,68,117,112,108,105,99,97,116,101,32,101,110,116,114,121,32,39,209,135,208,176,209,130,95,209,128,208,180,209,129,45,114,116,114,46,110,101,119,115,116,97,114,46,114,117,39,32,102,111,114,32,107,101,121,32,39,105,95,109,117,99,95,114,111,111,109,95,110,97,109,101,95,104,111,115,116,39]<br />** Stacktrace: [{ejabberd_sql,sql_query_t,1,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,186}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejabberd_sql,outer_transaction,3,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,497}]},{ejabberd_sql,run_sql_cmd,4,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,434}]},{p1_fsm,handle_msg,10,[{file,&quot;src/p1_fsm.erl&quot;},{line,582}]},{proc_lib,init_p_do_apply,3,[{file,&quot;proc_lib.erl&quot;},{line,247}]}]<br />** When State == {state,&lt;0.446.0&gt;,mysql,undefined,30000,&lt;&lt;&quot;rtr.host.ru&quot;&gt;&gt;,{{[],[]},0,1000}}<br />14:41:07.908 [error] Failed export for module mod_muc and table muc_room: {{badmatch,{aborted,[35,50,51,48,48,48,68,117,112,108,105,99,97,116,101,32,101,110,116,114,121,32,39,209,135,208,176,209,130,95,209,128,208,180,209,129,45,114,116,114,46,110,101,119,115,116,97,114,46,114,117,39,32,102,111,114,32,107,101,121,32,39,105,95,109,117,99,95,114,111,111,109,95,110,97,109,101,95,104,111,115,116,39]}},[{ejd2sql,output,4,[{file,&quot;src/ejd2sql.erl&quot;},{line,186}]},{mnesia_tm,apply_fun,3,[{file,&quot;mnesia_tm.erl&quot;},{line,836}]},{mnesia_tm,execute_transaction,5,[{file,&quot;mnesia_tm.erl&quot;},{line,811}]},{ejd2sql,&#039;-export/3-fun-4-&#039;,5,[{file,&quot;src/ejd2sql.erl&quot;},{line,87}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejd2sql,export,3,[{file,&quot;src/ejd2sql.erl&quot;},{line,85}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejd2sql,export,2,[{file,&quot;src/ejd2sql.erl&quot;},{line,71}]}]}<br />14:41:07.954 [error] SQL transaction restarts exceeded<br />** Restarts: 10<br />** Last abort reason: &quot;#23000Duplicate entry &#039;virt@rtr.host.ru-rtr.host.ru&#039; for key &#039;i_muc_registered_jid_host&#039;&quot;<br />** Stacktrace: [{ejabberd_sql,sql_query_t,1,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,186}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejabberd_sql,outer_transaction,3,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,497}]},{ejabberd_sql,run_sql_cmd,4,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,434}]},{p1_fsm,handle_msg,10,[{file,&quot;src/p1_fsm.erl&quot;},{line,582}]},{proc_lib,init_p_do_apply,3,[{file,&quot;proc_lib.erl&quot;},{line,247}]}]<br />** When State == {state,&lt;0.447.0&gt;,mysql,undefined,30000,&lt;&lt;&quot;rtr.host.ru&quot;&gt;&gt;,{{[],[]},0,1000}}<br />14:41:07.961 [error] Failed export for module mod_muc and table muc_registered: {{badmatch,{aborted,&quot;#23000Duplicate entry &#039;virt@rtr.host.ru-rtr.host.ru&#039; for key &#039;i_muc_registered_jid_host&#039;&quot;}},[{ejd2sql,output,4,[{file,&quot;src/ejd2sql.erl&quot;},{line,186}]},{mnesia_tm,apply_fun,3,[{file,&quot;mnesia_tm.erl&quot;},{line,836}]},{mnesia_tm,execute_transaction,5,[{file,&quot;mnesia_tm.erl&quot;},{line,811}]},{ejd2sql,&#039;-export/3-fun-4-&#039;,5,[{file,&quot;src/ejd2sql.erl&quot;},{line,87}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejd2sql,export,3,[{file,&quot;src/ejd2sql.erl&quot;},{line,85}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejd2sql,export,2,[{file,&quot;src/ejd2sql.erl&quot;},{line,71}]}]}<br />14:41:09.671 [error] Failed export for module pubsub_db and table pubsub_node: function_clause<br />14:41:09.766 [error] SQL transaction restarts exceeded<br />** Restarts: 10<br />** Last abort reason: &quot;#23000Cannot add or update a child row: a foreign key constraint fails (`ejabberd`.`pubsub_state`, CONSTRAINT `pubsub_state_ibfk_1` FOREIGN KEY (`nodeid`) REFERENCES `pubsub_node` (`nodeid`) ON DELETE CASCADE)&quot;<br />** Stacktrace: [{ejabberd_sql,sql_query_t,1,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,186}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejabberd_sql,outer_transaction,3,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,497}]},{ejabberd_sql,run_sql_cmd,4,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,434}]},{p1_fsm,handle_msg,10,[{file,&quot;src/p1_fsm.erl&quot;},{line,582}]},{proc_lib,init_p_do_apply,3,[{file,&quot;proc_lib.erl&quot;},{line,247}]}]<br />** When State == {state,&lt;0.449.0&gt;,mysql,undefined,30000,&lt;&lt;&quot;rtr.host.ru&quot;&gt;&gt;,{{[],[]},0,1000}}<br />14:41:09.768 [error] Failed export for module pubsub_db and table pubsub_state: {{badmatch,{aborted,&quot;#23000Cannot add or update a child row: a foreign key constraint fails (`ejabberd`.`pubsub_state`, CONSTRAINT `pubsub_state_ibfk_1` FOREIGN KEY (`nodeid`) REFERENCES `pubsub_node` (`nodeid`) ON DELETE CASCADE)&quot;}},[{ejd2sql,output,4,[{file,&quot;src/ejd2sql.erl&quot;},{line,186}]},{mnesia_tm,apply_fun,3,[{file,&quot;mnesia_tm.erl&quot;},{line,836}]},{mnesia_tm,execute_transaction,5,[{file,&quot;mnesia_tm.erl&quot;},{line,811}]},{ejd2sql,&#039;-export/3-fun-4-&#039;,5,[{file,&quot;src/ejd2sql.erl&quot;},{line,87}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejd2sql,export,3,[{file,&quot;src/ejd2sql.erl&quot;},{line,85}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejd2sql,export,2,[{file,&quot;src/ejd2sql.erl&quot;},{line,71}]}]}<br />14:41:09.773 [error] Failed export for module pubsub_db and table pubsub_item: badarg<br />14:41:09.773 [warning] Ignoring export for module mod_push: Mnesia table push_session doesn&#039;t exist (most likely because the module is unused)<br />14:41:10.108 [error] SQL transaction restarts exceeded<br />** Restarts: 10<br />** Last abort reason: &quot;#23000Duplicate entry &#039;elena.m-ba@rtr.host.ru-brn&#039; for key &#039;i_sr_user_jid_group&#039;&quot;<br />** Stacktrace: [{ejabberd_sql,sql_query_t,1,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,186}]},{lists,foreach,2,[{file,&quot;lists.erl&quot;},{line,1338}]},{ejabberd_sql,outer_transaction,3,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,497}]},{ejabberd_sql,run_sql_cmd,4,[{file,&quot;src/ejabberd_sql.erl&quot;},{line,434}]},{p1_fsm,handle_msg,10,[{file,&quot;src/p1_fsm.erl&quot;},{line,582}]},{proc_lib,init_p_do_apply,3,[{file,&quot;proc_lib.erl&quot;},{line,247}]}]<br />** When State == {state,&lt;0.451.0&gt;,mysql,undefined,30000,&lt;&lt;&quot;rtr.host.ru&quot;&gt;&gt;,{{[],[]},0,1000}}<br />14:41:10.116 [error] Failed export for module mod_shared_roster and table sr_user: {badmatch,{aborted,&quot;#23000Duplicate entry &#039;elena.m-ba@rtr.host.ru-brn&#039; for key &#039;i_sr_user_jid_group&#039;&quot;}}<br />ok</p></code></div> Sat, 06 Jan 2018 11:56:28 +0000 virt comment 67751 at https://www.ejabberd.im