tracker issue : CF-4199994

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

Delete and Recreate Collection Crash

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): bobo beebop / bobo beebop ()

Created: 10/10/2017

Components: Text Search, Solr Integration

Versions: 2016,2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: ColdFusion 2016 Update 5 / 2018,0,02,313101

Priority/Frequency: Minor / All users will encounter

Locale/System: / Windows 8.1/64bit

Vote Count: 1

Problem Description:

After creating a deleting a collection multiple times creation fails.

Steps to Reproduce:

Run the following code.  It crashes on line 5.

<cfcollection action="create" collection="FAKE_COLLECTION">
<cfcollection action="delete" collection="FAKE_COLLECTION">
<cfcollection action="create" collection="FAKE_COLLECTION">
<cfcollection action="delete" collection="FAKE_COLLECTION">
<cfcollection action="create" collection="FAKE_COLLECTION">

Actual Result:

The following error occurs:

  Unable to create Solr collection fake_collection.

  An error occurred while creating the collection: 
  org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException. Check the Solr logs for more 

In the Solr admin panel, this is logged:

 Error CREATEing SolrCore 'fake_collection': Could not create a new core in E:\ColdFusion2016\cfusion\jetty\multicore\collections\fake_collection\as another core is already defined there

Note that when the collection is deleted the collection folder is not removed (i.e. <CF_ROOT>\cfusion\jetty\multicore\collections\fake_collection).  This is true even if the collection is deleted from the CF Admin.

Expected Result:

The collection should be recreated.

Any Workarounds:

Delete the collection using cfcollection, then manually delete <CF_ROOT>\cfusion\jetty\multicore\collections\fake_collection.



Hi Bobo, Below is the comment from our Engg. Dev. Let me know if you have to say something for this. Creating and deleting collections can take some time. We should not call once action immediately after other. Its better to put some sleep. This works fine :   <cfcollection action="create" collection="uday4"> <cfscript> SLEEP(100); </cfscript> <cfcollection action="delete" collection="uday4"> <cfscript> SLEEP(100); </cfscript> <cfcollection action="create" collection="uday4"> <cfscript> SLEEP(100); </cfscript> <cfcollection action="delete" collection="uday4"> <cfscript> SLEEP(100); </cfscript> <cfcollection action="create" collection="uday4"> <cfscript> SLEEP(100); </cfscript> <cfcollection action="delete" collection="uday4">
Comment by Nitin K.
29903 | November 06, 2018 10:00:15 AM GMT
First off, it's been a fucking year since I reported this issue. We paid twenty thousand dollars in licences for this software, and this response time is completely unacceptable. Second, the "solution" doesn't work, even if the sleep time is arbitrarily long (30000ms for example). It crashes on line 17, the third "create" call, which is exactly the same as the reproduction code I reported. Third, even if it did work, using sleep would not be an acceptable solution. The cfcollection tag should block until completion like everything else in CF. And even if cfcollection were a nonblocking tag then (1) that would need to be documented somewhere, and (2) there would need to be some sort of mechanism to notify the caller of completion. Simply hoping that a nonblocking operation finishes within X time is not acceptable.
Comment by Ben B.
29905 | November 07, 2018 04:29:10 PM GMT
Hi Uday / Nitin / Ben, Confirmed issue in CF2016. Even from CF Admin. After 2nd deletion, the 3rd recreation fails. Even when waiting 10+ seconds between every click/action. Should be fixed. Unable to reproduce issue in CF2018. Thanks!, -Aaron
Comment by Aaron N.
29910 | November 09, 2018 05:56:18 AM GMT
+1 - Should work.
Vote by Aaron N.
29913 | November 09, 2018 05:57:51 AM GMT
Note: My CF2016 vs CF2018 comparison was on _same_ Win10 PC. Seems a CF2016 issue for sure.
Comment by Aaron N.
29911 | November 09, 2018 06:03:46 AM GMT
And, when I say it failed on CF2016: I mean all above-mentioned scenarios failed (w/ and w/o 100 and 30000 ms sleeps). And, when I say it succeeded on CF2018, I mean the no-sleep example from description. I even copy/pasted those cfcollection tags 6 more times and CF2018 handled the entire create/delete/create/delete/create/delete/create/etc sequence successfully and no error.
Comment by Aaron N.
29912 | November 09, 2018 06:11:12 AM GMT