tracker issue : CF-3787621

select a category, or use search below
(searches all categories and all time range)
Title:

cfindex does not correctly report errors

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Raymond Camden / Raymond Camden (raymondcamden)

Created: 07/10/2014

Components: Text Search

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final / 2018.0.0.310739

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Platforms All

Vote Count: 3

If cfindex has errors when indexing files, it does not report this to the user. As an example, imagine you are indexing a folder of PDFs. 4 of them. One cannot have its text extracted due to a permissions setting. When you index the directory, the result structure will tell you 3 PDFs were added (or updated), and nothing else. The user has no idea what file didn't index or why. If you examine server.log you will see why. 

While I *strongly* believe an exception should be thrown, if that is not the case, this is what should happen: The result struct should return an errors key. The errors key will be an array of errors where each element is a struct. One key is used for the filename (full path), and one for the exception object. 

This key should always be returned. If no error was thrown the array will be empty.

Note - another example of this is when you index ONE file. The same result should happen in that case as well. 

Also - ensure that if you try to index a file that does not exist, that an error is logged to the array as well.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3787621

Reason:	NewBug

External Customer Info:
External Company:  
External Customer Name: raymondcamden
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

I would initially just say "if it doesn't work, it should error out"... but there *is* benefit in indexing 95% and just being told about the failures. Either way, it should be down to the dev what they would prefer, so like a throwonfail="MyExceptionType" attribute or something? And if not provided, returns a manifest like you say? It sure as hell should not silently fail. -- Adam
Comment by External U.
11664 | July 10, 2014 09:03:44 AM GMT
+1. needs to be dealt with. And the "silent fail" approach to *anything* in the language should be reworked, and never used as a concept again. -- Adam
Vote by External U.
11668 | July 10, 2014 09:04:46 AM GMT
As others have pointed out to me, my suggested attribute should be "throwOnError" not "throwOnFail". Don't take me literally on these suggestions ;-) -- Adam
Comment by External U.
11665 | July 10, 2014 09:05:53 AM GMT
I want to +1 Adam's suggestion - I think it is the best of both worlds. For folks who want exceptions, they get it, for folks who don't, they don't. This is an EPIC WIN FOR EVERYONE. Woot!
Comment by External U.
11666 | July 10, 2014 09:11:46 AM GMT
+1 for the errors array key and throwOnError attribute
Vote by External U.
11669 | November 16, 2014 02:20:18 AM GMT
Now result of indexing will have one more parameter : ERRORS Its will be key value pair of file names and their corresponding error while indexing them Also introduced a new attribute 'throwonerror' - If specified as true,indexing will throw an exception even if single file fails to get indexed. Default value will be false
Comment by Uday O.
11667 | November 27, 2014 02:34:53 AM GMT
Any update on this? This is a huge issue that should be addressed.
Vote by External U.
11670 | November 17, 2015 03:40:55 PM GMT
Noting Adobe's last comment was 11/27/2014 and this ticket is still "To Fix". Thanks!, -Aaron
Comment by Aaron N.
28954 | May 30, 2018 06:06:08 AM GMT
This was fixed in CF16. One can use "throwonError" attribute with cfindex tag to control if an error is throw while indexing documents. index status struct returns an additional element "ERRORS" that is a struct of key-value pairs containing the filepath and corresponing error message encountered when indexing it. default value for the new attribute is false. No error is thrown. The errors are recorded in the index status struct.  setting the attribute to true would result in an exception. USAGE: cfindex( action='refresh', collection=coln_name, type='path', key=indx_dir, extensions=".*", status="indx_stat", recurse=true,  throwonError=false); writeDump(indx_stat); should return something like: throwonError=true struct DELETED 0 ERRORS struct C:\inetpub\cf12\misc\solr\throwOnerror\index_corrupt_fls\corrupt_fls\corr_xlsx.doc coldfusion.tagext.search.SolrUtils$InvalidFileException: Content of file corr_xlsx.doc can not be extracted. INSERTED 0 UPDATED 0
Comment by Piyush K.
29402 | July 25, 2018 12:21:40 PM GMT