It seems like a lot of folks have had similar problems, and we have as well, and maybe it would help to explain why these problems occur.  Rebuild_zebra.pl -r deletes all of the files in the Zebra db directories (such as <span class="Apple-style-span" style="font-family: Arial; font-size: 13px; border-collapse: collapse; color: rgb(0, 0, 128); ">reci-0.mf) and then recreates them.  Thus, permissions will be lost, and the files will be owned by the user who ran <a href="http://rebuild_zebra.pl">rebuild_zebra.pl</a>.  If one rebuilds the zebra indexes as root, the daemons, which typically run under the user koha, will not be able to update the indexes.  Thus, it&#39;s important then that the zebra rebuilds are put in the cronjob file of the user koha, and not root.  Also important is that other users, such as root, don&#39;t manually execute rebuilds.</span><div>
<span class="Apple-style-span" style="font-family: Arial; font-size: 13px; border-collapse: collapse; color: rgb(0, 0, 128); "><br></span></div><div><span class="Apple-style-span" style="font-family: Arial; font-size: 13px; border-collapse: collapse; color: rgb(0, 0, 128); ">If one desires that another user be able to execute <a href="http://rebuild_zebra.pl">rebuild_zebra.pl</a>, he should be given the permission to execute &#39;sudo -u Koha .../<a href="http://rebuild_zebra.pl">rebuild_zebra.pl</a>,&#39; (if you want to do this, you also have to edit the sudoers file to pass the PERL5LIB variable with the env_keep option as by default sudo strips away almost all environment variables).  Or, as root user, one can use a simple &#39;su koha&#39; and then the <a href="http://rebuild_zebra.pl">rebuild_zebra.pl</a> command.</span><div>
<font class="Apple-style-span" color="#000080" face="Arial"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" color="#000080" face="Arial"><span class="Apple-style-span" style="border-collapse: collapse;">I&#39;ve also tried to set the sticky bit on <a href="http://rebuild_zebra.pl">rebuild_zebra.pl</a>, but for whatever reason it didn&#39;t seem to work due to some problem with the PERL5LIB variable that I wasn&#39;t able to figure.  That seems to me the easiest thing to do, if anybody has any idea how to make it work.  If it worked and were the default, I think it would help folks to avoid a great deal of the problems that come up with zebra.</span></font></div>
<div><font class="Apple-style-span" color="#000080" face="Arial"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" color="#000080" face="Arial"><span class="Apple-style-span" style="border-collapse: collapse;">Best regards to all,</span></font></div>
<div><font class="Apple-style-span" color="#000080" face="Arial"><span class="Apple-style-span" style="border-collapse: collapse;">Patrick Redmon<br></span></font><br><div class="gmail_quote">2009/11/18 Chadwick, John, DCA <span dir="ltr">&lt;<a href="mailto:john.chadwick@state.nm.us">john.chadwick@state.nm.us</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
















<div lang="EN-US" link="blue" vlink="blue">

<div>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">Looks like the issue was ownership, not
permissions. </span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">As a test I deleted the log files and
restarted the server. The files in the directory remained with the koha user
and group, but the permissions got set back down.</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">-rw-r--r-- 1 koha koha     8192 2009-11-18
15:40 reci-0.mf</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">John</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>

<div><div class="im">

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">+----------------------------------------------------------------------------+</span></font><font color="navy"><span style="color:navy"></span></font></p>


<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">John Chadwick, Ed.D. Information
Technology Manager</span></font><font color="navy"><span style="color:navy"></span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">New Mexico</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> State</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> Library</span></font><font color="navy"><span style="color:navy"></span></font></p>


<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">1209 Camino Carlos Rey</span></font><font color="navy"><span style="color:navy"></span></font></p>


<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">Santa Fe</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">, NM 87507</span></font><font color="navy"><span style="color:navy"></span></font></p>


<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">Phone: 505-476-9740  Cell:
505-629-8116 Fax: 505-476-9761</span></font><font color="navy"><span style="color:navy"></span></font></p>

</div><p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><a href="mailto:john.chadwick@state.nm.us" target="_blank">john.chadwick@state.nm.us</a></span></font><font color="navy"><span style="color:navy"></span></font></p>


<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><a href="http://www.nmstatelibrary.org" target="_blank">http://www.nmstatelibrary.org</a></span></font></p>


</div><div class="im">

<div>

<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">

<hr size="2" width="100%" align="center">

</span></font></div>

<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma"> Joe Atzberger
[mailto:<a href="mailto:ohiocore@gmail.com" target="_blank">ohiocore@gmail.com</a>] <br>
<b><span style="font-weight:bold">Sent:</span></b> Wednesday, November 18, 2009
3:11 PM<br>
<b><span style="font-weight:bold">To:</span></b> Chadwick,
 John, DCA<br>
<b><span style="font-weight:bold">Cc:</span></b> <a href="mailto:Koha@lists.katipo.co.nz" target="_blank">Koha@lists.katipo.co.nz</a><br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [Koha] Zebra indexing
question</span></font></p>

</div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"> </span></font></p>

</div><p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">The recommended
configuration is to run rebuild_zebra out of crontab (See the example crontab
file) but I&#39;m not sure if this error is related.  </span></font></p><div><div></div><div class="h5">

<div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">2009/11/18 Chadwick, John,
DCA &lt;<a href="mailto:john.chadwick@state.nm.us" target="_blank">john.chadwick@state.nm.us</a>&gt;</span></font></p>

<div link="blue" vlink="purple">

<div>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">I am
noticing some errors in the koha-zebradaemon-output.log file. When new records
are added it takes a bit longer to index than we think they should. Running
rebuild zebra is often faster.</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">The log file
shows the following:</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">14:31:44-18/11
zebrasrv(55) [warn] Failed to open
/var/lib/bbmkoha/zebradb/biblios/register/reci-0.mf [Permission denied]</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">14:31:44-18/11
zebrasrv(55) [fatal] mf_write: reci error (1)</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">14:31:44-18/11
zebrasrv(55) [fatal] write commit block</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">14:31:44-18/11
zebrasrv(55) [warn] zebra_commit: failed</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Zebra ends
up indexing and search works, but I am concerned about the errors. Any ideas?</span></font></p>

</div>

</div>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><br>
OK, baseline question: does </span></font><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">/var/lib/bbmkoha/zebradb/biblios/register/reci-0.mf
exist?  What are the owner:group and permissions?<br>
<br>
--joe</span></font></p>

</div></div><div class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">

<hr size="2" width="100%" noshade color="black" align="left">

</span></font></div><div class="im">

<p class="MsoNormal"><font size="3" face="Calibri"><span style="font-size:12.0pt;font-family:Calibri">This inbound email has been scanned for malicious software
and transmitted safely to you using Webroot Email Security. </span></font></p>

<div class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">

<hr size="2" width="100%" noshade color="black" align="left">

</span></font></div>

</div></div>

<div> </div><br><div class="im"><br>Confidentiality Notice: This e-mail, including all attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited unless specifically provided under the New Mexico Inspection of Public Records Act. If you are not the intended recipient, please contact the sender and destroy all copies of this message. -- This email has been scanned by the Sybari - Antigen Email System. <br>
<br><br>

  
  

<div style="width:530px">
<br>
<br>
<hr align="left" color="#000000" size="2" width="100%"><span style="font-family:Calibri">
Confidentiality Notice: This e-mail,including all attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review,use,disclosure or distribution is prohibited unless specifically provided under the New Mexico Inspection of Public Records Act. If you are not the intended recipient, please contact the sender and destroy all copies of this message. 
<br>
This email has been scanned using Webroot Email Security. 
</span><br style="font-family:Calibri">

<hr align="left" color="#000000" size="2" width="100%">
</div></div></div>



<br>_______________________________________________<br>
Koha mailing list<br>
<a href="mailto:Koha@lists.katipo.co.nz">Koha@lists.katipo.co.nz</a><br>
<a href="http://lists.katipo.co.nz/mailman/listinfo/koha" target="_blank">http://lists.katipo.co.nz/mailman/listinfo/koha</a><br>
<br></blockquote></div><br></div></div>