Exception when indexing user folder, indexing aborts

Hello,

We purchased the searching/indexing component from you to be able to create an index and have a problem on all our computers when scanning the user folder, e.g. C:\Users\me

Our code is very simple (please ignore the empty property initializers. They don’t matter.):

var index = new GroupDocs.Search.Index(indexDirectory, new IndexSettings { }, overwriteIfExists: false);

index.Add(scanTarget, new IndexingOptions { });

When scanTarget is C:\Users\me, this happens:

  1. There is an internal exception in the GroupDocs library.
  2. The index creation is aborted for some reason.

Afterwards, when I call this…

var report = index.GetIndexingReports().First();

…, I’m able to access errors that happened and I can see this exception:

"08/13/2024 13:29:39: System.UnauthorizedAccessException: Access to the path 'C:\Users\me\Anwendungsdaten' is denied.
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
   at .(String , List`1 )
   at .(String , List`1 )
   at .(List`1 , Boolean )
   at .(String[] , Document[] )
   at .(String[] , Document[] , IndexingOptions )"

That folder “Anwendungsdaten” does not appear in Windows Explorer and is some kind of special folder on Windows , I guess…

And as I said: The index creation is immediately aborted, so we can’t use that feature right now…

@jamsharp
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SEARCHNET-3216

@jamsharp

Even if you run the application as an administrator, there may still be objects in the specified folder for which this exception will be raised. The workaround is to only add the necessary folders and files to the index, and avoid including system subfolders and files. A ticket has been created to implement skipping system subfolders and files during the indexing process: SEARCHNET-3217. You’ll be notified as there’s any further progress.

Hello.

thank you for your reply!

Please note that the issue that index creation is aborted in case there is any not accessible sub folder in the directory is an urgent issue for us.

I would expect that such sub folders would be simply skipped from indexing (maybe optional/configurable and maybe with some kind of logging/reporting). However, I am very surprised that such a situation will cause the complete indexing process to be aborted.

I wonder if we could expect a higher priority fix for this issue in case we subscribe for the paid support?

Thank you for your time and best regards!

@jamsharp

We have implemented skipping system subdirectories when adding a directory. However, This improvement will be included in the next release. You can expect next release by the end of this month.

For priority support we have paid support helpdesk.

Thank you for the quick information!
However, I don’t think that “system subdirectories” are the only directories which could cause this issue. I could imagen many other types of subdirectories which could cause this issue (e.g. directories with explicit “deny” access permissions set for certain users/groups). What about other subdirectories with no sufficient access to read the data? Are these handled in SEARCHNET-3216 as well?

@jamsharp

A subdirectory will be skipped if errors occur while accessing it.

Perfect! Thank you very much!

We are very interested in the upcoming release including this fix.
Additionally, in case there is an option to get a prerelease version we would be very interested in it!

Thank you for your time.

@jamsharp

We’re looking into the possibility of getting you a preview of the API, but it’s almost ready! We’ll release it by the end of this month.

The issues you have found earlier (filed as SEARCHNET-3216) have been fixed in this update. This message was posted using Bugs notification tool by atir.tahir