You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Digy <di...@gmail.com> on 2010/02/01 00:41:39 UTC

RE: Unauthorized Exception Error

If it were a bug in Lucene.NET you would probably get IOException ("The
process cannot access the file '....' because it is being used by another
process") not UnauthorizedAccessException. 

It may be related with some security settings (like accessing the index
without necessary permissions).

DIGY

-----Original Message-----
From: Tim Haughton [mailto:timhaughton@gmail.com] 
Sent: Sunday, January 31, 2010 1:31 PM
To: lucene-net-user@incubator.apache.org
Subject: Re: Unauthorized Exception Error

Some more relevant info:

Version: Dev version Exception Date: 30 January 2010
Exception Type: System.
UnauthorizedAccessException

DotNet Details
==============

1.0: 0.0
1.1: 0.0
2.0: 2.0.50727.4927
3.0: 3.0.30729.4926
3.5: 3.5.30729.4926

CardSpace: 3.0.4506.4926
WPF: 3.0.6920.4902
WCF: 3.0.4506.4926
WF: 3.0.4203.4926

OS Details
==========

Microsoft Windows NT 6.1.7600.0

Hardware
========

CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
Processor ID: 178BFBFF00060FB2
Number Of Cores: 2
Number Of Processors: 2
Manufacturer: NVIDIA
Model: AWRDACPI
Total Physical Memory: 4026064896
Graphics Card: NVIDIA GeForce 6150
Graphics Card Driver Version: 8.17.11.9562
Video Mode:

Description
===========



Exception
=========

Access to the path 'C:\Users\timhaughton\HDM AppData
Test\MetaDataIndex\segments_7h' is denied.

  at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
  at System.IO.File.Delete(String path)
  at Lucene.Net.Store.FSDirectory.DeleteFile(String name) in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Store\FS
Directory.cs:line
436
  at Lucene.Net.Index.IndexFileDeleter.DeleteFile(String fileName) in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\In
dexFileDeleter.cs:line
588
  at Lucene.Net.Index.IndexFileDeleter.DecRef(String fileName) in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\In
dexFileDeleter.cs:line
529
  at Lucene.Net.Index.IndexFileDeleter.DeleteCommits() in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\In
dexFileDeleter.cs:line
291
  at Lucene.Net.Index.IndexFileDeleter.Checkpoint(SegmentInfos segmentInfos,
Boolean isCommit) in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\In
dexFileDeleter.cs:line
445
  at Lucene.Net.Index.DirectoryIndexReader.DoCommit() in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\Di
rectoryIndexReader.cs:line
268
  at Lucene.Net.Index.IndexReader.Commit() in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\In
dexReader.cs:line
941
  at Lucene.Net.Index.IndexReader.DecRef() in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\In
dexReader.cs:line
157
  at Lucene.Net.Index.SegmentReader.DecRef() in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\Se
gmentReader.cs:line
201
  at Lucene.Net.Index.IndexReader.Close() in
C:\Users\timhaughton\Desktop\Lucene\Lucene.Net_2_3_2\src\Lucene.Net\Index\In
dexReader.cs:line
961
  at HDM.IndexManager.RemoveFromMetaIndex(EDMDocument document) in
C:\Users\timhaughton\svn\HDM\src\Application\Core\Data\IndexManager.cs:line
219


On 30 January 2010 23:00, Tim Haughton <ti...@gmail.com> wrote:

> When using Lucene, it's common to get a handful of IOExceptions appearing
> in the Output window every time I access the index, they're handled, so
> they're not really a problem. It's also quite common for us to have an
> unhandled exception pop up too:
>
> "Access to the path 'C:\\Users\\timhaughton\\HDM AppData
> Test\\MetaDataIndex\\segments_7h' is denied."
>
> This typically happens when we're performing a series of actions, e.g.
> doing a delete then an add within a for loop. All access to the index
occurs
> under lock, I don't even allow concurrent read access - just to see if it
> fixes it - it doesn't.
>
> Has anyone else seen this before? Does it indicate I'm doing anything
> wrong?
>
> Regards,
>
> Tim Haughton
> www.agilemicroisv.com
>  Skype: timhaughton
>  [image: Linkedin] <http://www.linkedin.com/in/timhaughton>[image:
> Facebook] <http://www.facebook.com/timhaughton>[image:
Twitter]<http://www.twitter.com/dokix>
> Blog RSS Two's
Company<http://feedproxy.google.com/%7Er/TheAgileMicroISVBlog/%7E3/jwNwE6dQn
Ac/>
>
>