Copy link to clipboard
Copied
Hello, everyone.
I did fix the last Sandbox security related issue with Solr collections - it was in the "Files/Dir" section, I had to put everything under C:\ColdFusion9\wwwroot.
Now, I'm facing yet another Sandbox related issue with collections.
I have one reindex script that has NO ISSUES when pulling data from a database and indexing a collection from that.
I have another reindex script that will not index a collection from a query, unless Sandbox is disabled. I will try to give some pseudo code.
<cfquery name="search_results" datasource="documents">
SELECT DOC_ID, DOC_NAME, DOC_DESCRIPTION
FROM DOC
WHERE DOC_ID in (<cfqueryparam value="#thisList#" cfsqltype="CF_SQL_VARCHAR" list="yes">)
</cfquery>
<cftry>
<cfindex action="refresh" collection="collection_name" key="DOC_DESCRIPTION" type="custom" title="DOC_DESCRIPTION" query="search_results" body="DOC_ID, DOC_NAME, DOC_DESCRIPTION" status="results" />
<cfcatch><cfdump var="#cfcatch#"></cfcatch>
</cftry>
The query will retrieve 15 records, with or without Sandbox. But the CFINDEX will not work if Sandbox is enabled.
The other reindex script is not affected, either way.
What could be causing the CFINDEX to fail?
Thank you,
^_^
Copy link to clipboard
Copied
The CFINDEX is not erroring, and it's contained within a CFTRY that will dump "cfcatch" if anything did error. But the collection remains documents: 0 and size: 0.
^_^
Copy link to clipboard
Copied
I had a similar issue with CFSEARCH on CF10 with sandbox security that I resolved by adding the following to the neo-security.xml file:
<struct><var name='CLASS'><string>java.net.SocketPermission</string></var><var name='TARGET'><string>127.0.0.1:0</string></var><var name='ACTION'><string>listen,resolve</string></var></struct></array></var></struct></var></struct>
That gives permission to listen on dynamic ports (the colon-zero part).
Copy link to clipboard
Copied
I ran into an issue with CFINDEX that was fixed by disabling Sandbox Security, running the CFINDEX, and then re-enabling. Perhaps the first time the collection is indexed requires elevated privileges?
It may have also helped to add sandbox access to C:\Users\<user_running_coldfusion_service>\AppData\Local\Temp\-