bishop335 / subtext

Automatically exported from code.google.com/p/subtext
0 stars 0 forks source link

Error with Lucene: LockObtainFailedException #264

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Periodically, the lock file gets orphaned and it prevents new posts and various 
admin functions as timeouts happen

What is the expected output? What do you see instead?
Locking should work!

What version of the product are you using? On what operating system?
2.5.1.19, Windows IIS 7, Integrated pipeline, ASP.NET 3.5

Please provide any additional information below.
Often when it starts up I see this in the log: 
Subtext.Framework.Services.SearchEngine.SearchEngineService
Something left a lock in the index folder: deleting it

I also see a lot of :
Subtext.Web.SubtextApplication
Unhandled Exception trapped in Global.asax
Lucene.Net.Store.LockObtainFailedException: Lock obtain timed out: 
NativeFSLock@D:\Hosting\6568906\html\App_Data\write.lock: 
System.IO.IOException: The process cannot access the file 
'D:\Hosting\6568906\html\App_Data\write.lock' because it is being used by 
another process. at System.IO.__Error.WinIOError(Int32 errorCode, String 
maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, 
FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, 
Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, 
FileAccess access) at Lucene.Net.Store.NativeFSLock.Obtain() ---> 
System.IO.IOException: The process cannot access the file 
'D:\Hosting\6568906\html\App_Data\write.lock' because it is being used by 
another process. at System.IO.__Error.WinIOError(Int32 errorCode, String 
maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, 
FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, 
Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, 
FileAccess access) at Lucene.Net.Store.NativeFSLock.Obtain() --- End of inner 
exception stack trace --- at Lucene.Net.Store.Lock.Obtain(Int64 
lockWaitTimeout) at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, 
Boolean create, Boolean closeDir, IndexDeletionPolicy deletionPolicy, Boolean 
autoCommit, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit 
commit) at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean 
closeDir, IndexDeletionPolicy deletionPolicy, Boolean autoCommit, Int32 
maxFieldLength, IndexingChain indexingChain, IndexCommit commit) at 
Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, MaxFieldLength mfl) 
at 
Subtext.Framework.Services.SearchEngine.SearchEngineService.EnsureIndexWriter() 
at 
Subtext.Framework.Services.SearchEngine.SearchEngineService.DoWriterAction[T](Fu
nc`2 action) at 
Subtext.Framework.Services.SearchEngine.SearchEngineService.get_Searcher() at 
Subtext.Framework.Services.SearchEngine.SearchEngineService.GetIndexedEntryCount
(Int32 blogId) at Subtext.Web.Admin.Pages.FullTextSearch.UpdateIndexSize() at 
Subtext.Web.Admin.Pages.FullTextSearch.BindLocalUI() at 
Subtext.Web.Admin.Pages.AdminOptionsPage.Page_Load(Object sender, EventArgs e) 
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, 
Object t, EventArgs e) at 
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, 
EventArgs e) at System.Web.UI.Control.OnLoad(Ev

Original issue reported on code.google.com by ariank...@gmail.com on 22 Sep 2010 at 4:09

GoogleCodeExporter commented 8 years ago
Do you have 2 processes running on the same server reading/writing the same 
index file?

Original comment by simone.chiaretta on 22 Sep 2010 at 8:33

GoogleCodeExporter commented 8 years ago
Not due to my settings... unless there is something about GoDaddy that can 
cause two instances to run at once, but I wouldn't think so.  That would make 
sense for the error, but not really for my setup.  It happens all the time.  
Posting fails, logging in to Admin fails, and my only fix is to recycle the app 
pool and hope I can delete that file fast!  Until it locks again...

Original comment by ariank...@gmail.com on 23 Sep 2010 at 1:22

GoogleCodeExporter commented 8 years ago
Another dump... When I post from Windows Live Writer, I get the following error 
so WLW think it failed, though it actually does post:

Server Error 0 Occurred

Lock obtain timed out: 
NativeFSLock@D:\Hosting\6568906\html\App_Data\write.lock: 
System.IO.IOException: The process cannot access the file 
'D:\Hosting\6568906\html\App_Data\write.lock' because it is being used by 
another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at Lucene.Net.Store.NativeFSLock.Obtain()    at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout)
   at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create, Boolean closeDir, IndexDeletionPolicy deletionPolicy, Boolean autoCommit, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit)
   at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean closeDir, IndexDeletionPolicy deletionPolicy, Boolean autoCommit, Int32 maxFieldLength, IndexingChain indexingChain, IndexCommit commit)
   at Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, MaxFieldLength mfl)
   at Subtext.Framework.Services.SearchEngine.SearchEngineService.EnsureIndexWriter()
   at Subtext.Framework.Services.SearchEngine.SearchEngineService.DoWriterAction(Action`1 action)
   at Subtext.Framework.Services.SearchEngine.SearchEngineService.ExecuteRemovePost(Int32 entryId)
   at Subtext.Framework.Services.SearchEngine.SearchEngineService.AddPosts(IEnumerable`1 posts, Boolean optimize)
   at Subtext.Framework.Services.SearchEngine.SearchEngineService.AddPost(SearchEngineEntry post)
   at Subtext.Framework.Services.SearchEngine.IndexingService.ExecuteAddPost(SearchEngineEntry entry)
   at Subtext.Framework.Services.SearchEngine.IndexingService.AddPost(Entry entry, IList`1 tags)
   at Subtext.Framework.Services.EntryPublisher.Publish(Entry entry)
   at Subtext.Framework.XmlRpc.MetaWeblog.PostContent(String username, String password, Post& post, Boolean publish, PostType postType)

Original comment by ariank...@gmail.com on 24 Sep 2010 at 6:28

GoogleCodeExporter commented 8 years ago
Yes, I think it's always the same problem: something is locking your write.lock 
file.

Original comment by simone.chiaretta on 24 Sep 2010 at 7:29

GoogleCodeExporter commented 8 years ago
Any thoughts here?  What would be locking it?  It's a shared hosting server at 
GoDaddy.  I don't have any processes running -- just a directory full of files 
hosted in IIS.  Am I the only person to see this?

Original comment by ariank...@gmail.com on 27 Sep 2010 at 2:43

GoogleCodeExporter commented 8 years ago
I'm also getting this behaviour. I'm running two blogs on shared hosting. At 
first I was running using two processes which always locked me out of admin for 
one of the weblogs. After about a week of to/fro with support, I'm quite sure 
we now have it configured as a single process. The locking error is occuring 
only intermittently.

I get this trying to login as Admin:

[IOException: The process cannot access the file 
'\\boswinfs04\home\Users\Web\b2432\whl.ianwi\subtext25120\App_Data\write.lock' 
because it is being used by another process.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7715632
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1162
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) +67
   Lucene.Net.Store.NativeFSLock.Obtain() +428

[LockObtainFailedException: Lock obtain timed out: 
NativeFSLock@\\boswinfs04\home\Users\Web\b2432\whl.ianwi\subtext25120\App_Data\w
rite.lock: System.IO.IOException: The process cannot access the file 
'\\boswinfs04\home\Users\Web\b2432\whl.ianwi\subtext25120\App_Data\write.lock' 
because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at Lucene.Net.Store.NativeFSLock.Obtain()]
   Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout) +574

Original comment by ian.wije...@gmail.com on 4 Oct 2010 at 4:46

GoogleCodeExporter commented 8 years ago
Sorry to make a pest of myself, but I don't know what else to do.  My Subtext 
log is full of the above lock error and errors from 
Subtext.Framework.Services.SearchEngine.SearchEngineService stating "Something 
left a lock in the index folder: deleting it."  This is constant.  It happens 
over and over again.  I called GoDaddy and they say that the application pool 
keeps crashing.  I don't have any custom modules running though.  What do I 
need to do next?

Original comment by ariank...@gmail.com on 5 Nov 2010 at 7:05

GoogleCodeExporter commented 8 years ago
But is your application running?
The log message you are receiving is because the search engine is trying to 
recover from the locking error deleting the file.

If you don't need the search you can disable it... I think the web.config 
should have the info on how do to it

Original comment by simone.chiaretta on 6 Nov 2010 at 1:22

GoogleCodeExporter commented 8 years ago
Not sure what you mean about the app running.  I can hit the site just fine.  I 
get the lock exception if I try to post content and sometimes in the admin area 
(won't always even let me in).  GoDaddy says the app domain keeps crashing, so 
presumably the lock file is left open from last time.  Again and again.  I'll 
just disable then.  Not sure why I didn't think of that.  It's a shame that I 
can't figure out the actual problem though.

Original comment by ariank...@gmail.com on 6 Nov 2010 at 3:43

GoogleCodeExporter commented 8 years ago
I checked the web.confi gand there's no reference to Lucene, but there is a 
block concerning search:

<FullTextSearchEngineSettings 
type="Subtext.Framework.Configuration.FullTextSearchEngineSettings, 
Subtext.Framework">
    <Parameters>
        <MinimumDocumentFrequency>10</MinimumDocumentFrequency>
    </Parameters>
</FullTextSearchEngineSettings>

The admin tool just gives me an option to rebuild the index.  What do I do to 
actually disable it?

Original comment by ariank...@gmail.com on 6 Nov 2010 at 6:54

GoogleCodeExporter commented 8 years ago
I have the same problem -- I'm hosting on my own IIS 7 server, just one domain, 
but with multiple blog support. I do seem to remember some option for full text 
support when I installed this the first time, but now all I see is what the 
previous poster mentioned.

Original comment by tpuj...@gmail.com on 22 Nov 2010 at 11:40

GoogleCodeExporter commented 8 years ago
Did anyone ever figure out how to disable this search feature to get rid of the 
locking problem?

Original comment by ian.wije...@gmail.com on 27 Nov 2010 at 1:53

GoogleCodeExporter commented 8 years ago
Sorry, forgot to check:
just add IsEnabled="False" in the FullTextSearchEngineSettings tag

Simone

Original comment by simone.chiaretta on 27 Nov 2010 at 5:38

GoogleCodeExporter commented 8 years ago

Original comment by simone.chiaretta on 30 Nov 2010 at 8:49

GoogleCodeExporter commented 8 years ago
I logged a second error about this and just received this error again.

Original comment by billgraz...@gmail.com on 19 Feb 2011 at 1:02

GoogleCodeExporter commented 8 years ago
Haven't been able to reproduce this. Can you try deploying the .pdb files?

Original comment by haac...@gmail.com on 16 May 2011 at 3:50

GoogleCodeExporter commented 8 years ago
Issue 296 has been merged into this issue.

Original comment by haac...@gmail.com on 16 May 2011 at 4:12

GoogleCodeExporter commented 8 years ago
I no longer use Subtext.  I'm using Orchard now.  It appears that this was 
caused by GoDaddy (and likely other shared hosts) using pools of worker threads 
which would each attempt to lock the same index file.  I'm not sure what a good 
fix for this would be, but I was never able to resolve it.

Original comment by ariank...@gmail.com on 16 May 2011 at 5:36