<docbook><section><title>VirtTipsAndTricksTrxInvalidLGEntry</title><title> How do I recover from &quot;Invalid log entry in replay&quot; when transaction log is being replayed during server start?</title> How do I recover from &quot;Invalid log entry in replay&quot; when transaction log is being replayed during server start?
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Error Condition</bridgehead>
<para>A Virtuoso transaction log file may fail to replay, with an error of the form: </para>
<programlisting>11:42:57 Invalid log entry in replay. Delete transaction log virtuoso.trx or truncate at point of error. 
Valid data may exist after this record. A log record begins with bytes 193 188 5 188 0. Error at offset 13205546
11:42:57 Searching for the next valid header signature starting at 13205547
11:42:57 No valid looking header found.
11:42:57 Server exiting
</programlisting><para> Resolution of this error varies with the kind of Virtuoso server you&#39;re running.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Recovery Methods</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Single-Server Deployments of both Open Source and Commercial Edition</bridgehead>
<emphasis><emphasis>WARNING:</emphasis> Do not use this recovery method on Cluster Deployments of Commercial Edition.</emphasis><para>This can be recovered by truncating to the transaction log to the reported error offset.</para>
<para>Unix-like OS can use the built-in dd command; Windows users must first install <ulink url="http://sourceforge.net/projects/windd/">WinDD</ulink> or <ulink url="http://www.cygwin.com/">cygwin</ulink> to get the same functionality.</para>
<para>Given the error above, the recovery steps on a Unix-like OS would look like -- </para>
<programlisting># mv virtuoso.trx old.trx
# dd if=old.trx of=new.trx bs=1 count=13205546
13205546+0 records in
13205546+0 records out
# mv new.trx virtuoso.trx
# virtuoso-iodbc-t -f
</programlisting><para> Restarting Virtuoso should now succeed.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Replication Cluster Deployments of Commercial Edition</bridgehead>
<emphasis>Recovery instructions coming soon!  Until then, please <ulink url="http://support.openlinksw.com/support/online-support.vsp">contact Support for assistance</ulink>.</emphasis><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Elastic Cluster Deployments of Commercial Edition</bridgehead>
<emphasis>Recovery instructions coming soon!  Until then, please <ulink url="http://support.openlinksw.com/support/online-support.vsp">contact Support for assistance</ulink>.</emphasis></section></docbook>