Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 200 Time: 11:06 - Sep 19, 2006  

Anpanman

System.IO.IOException: Lock obtain timed out - Problem indexing with lucene.net?

Hi,

I'm using the asp.net framework lucene.net to index text to be able to search it easily.
This has been working fine, but suddenly I got problems with having write permissions to the directories that lucene uses (index and temp).

I tried to delete the former indexing files, but I'm stuck at this error message:

System.IO.IOException: Lock obtain timed out: Lock@D:\xxxxxxxxxxx\Temp\lucene-9ad3e71bc5841b99fcf8c97ba8b78a57-write.lock at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout) at Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a, Boolean create, Boolean closeDir) at Lucene.Net.Index.IndexWriter..ctor(String path, Analyzer a, Boolean create)

I didn't change anything related to it, and I checked the write permissions, which are ok. I also still have the lockdir defined in the web.config file:

<add key="Lucene.Net.lockdir" value="D:xxxxxxxxxxx\Temp\" />

Anyone knows what could be the issue here?

Categories

Answer Discussion
Tutorials

 

rcastagna

Date:: Sep 19, 2006

Time:: 17:22

Anpanman,

It doesn't look like anything should've disrupted Lucene in what you've explained. The only thing I can think of is that the parent privileges could've been changed. The recent MS updates for XP screwed up one of my apps that writes to TEMP as well. I just had to reset the privs on the parent, and everything went back to working.

Might not be a 200 point answer, but it couldn't hurt to check it out just in case XP got you, too.

Ric

Anpanman

Date:: Sep 19, 2006

Time:: 17:45

Thanks, Ric.
I was also thinking it was a problems of writing privileges, but the thing is that it doesn't happen to me on my development computer, only on the shared hosting provider. I've written them, but didn't get an answer yet.

Anpanman

Date:: Oct 10, 2006

Time:: 11:11

It boils down to the ASP.NET account not having writing privileges. My hosting provider changed something and for a couple of weeks I can't upload files via web, can't use lucene, well can't do something that's very basic in a website!
I'm testing out another provider these days and hopefully will be changing very soon.

Anpanman

Date:: Oct 10, 2006

Time:: 11:12

you get the points anyway, ric :)
It was an urgent matter...

Anpanman

Date:: Jan 19, 2007

Time:: 08:45

Apparently it might also be the account called NETWORK SERVICE in .net 2.0 or whatever the application pool identity is running as, that needs modify/write permissions to the index and temp folders.

pandiarajan1986

Date:: May 17, 2010

Time:: 13:43

hi,
i too face this type of problems..at that time i delete the write.lock in that indexed folder.. this type of problem arises due to optimization. suppose if u delete a indexed file without any optimization, write.lock will occur..

better use
indexwriter.optimise();
indexwriter.close();

after deleting a index file...

pandiarajan19863

Date:: May 17, 2010

Time:: 13:56

hi,

if (IndexReader.IsLocked(indexingFolder))
{

Response.write("it is locked");
IndexReader.Unlock(FSDirectory.GetDirectory(indexingFolder));
}
else
{
Response.write("it is not locked");
}

Question Answered

This question has been closed, and points have been rewarded to the following experts:


rcastagna: 200

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es