[Coldbox 6.8.1] Running Into Strange Errors with CBFutures + Quick + Renderer

I am encountering a few issues using async() in an ACF2021 Coldbox app. I watched the CFCasts primer on the subject and I have sifted through the documentation a bit. My objective is to execute a private handler method asynchronously which makes a few database calls with QB (via Quick) and creates a PDF file from a view via Renderer

Here’s how I set up the future:

// public handler method
function create( event, rc, prc ) {
    
    param rc.deleteTempFiles = true;
    prc.htmlBaseUrl = event.getHTMLBaseURL();

    var f = async().newFuture( function() {
                    
        logger.warn( "I started!" );
        submitApp( event, rc, prc ); // private handler method
        logger.warn( "I finished!" );
            
    } ).then( ( data ) => {
        logger.warn( "All clear!" );
    } );

}


/**
 * Private method which actually does the app submission
 */
private function submitApp( event, rc, prc ) {

    // create the pdf
    prc.app.createPdf( prc.htmlBaseUrl, rc.deleteTempFiles );

    // ... 


/**
 * Quick entity BaseApp.cfc
 * 
 * @baseUrl
 * @deleteTempFiles: (boolean)
 */
void function createPdf( 
    required string baseUrl,
    boolean deleteTempFiles = true
) {

    var outputFilename = getSignedApplicationFileName();
    
    var body = renderer.renderView(
        view = "pdfs/app", // <-- the view gets a value from a Quick relationship
        args = {
            "app": this,
            "baseUrl" = baseUrl
        }
    );

    // ...

I did my best to simplify the code for this example. The first error I receive is related to retrieving a relationship from within Quick inside the view. It works outside of async().

[Error] running Supplier: Variable APPLICATION is undefined.
[ERROR] Stacktrace for Supplier: coldfusion.runtime.UndefinedVariableException: Variable APPLICATION is undefined.
        at coldfusion.runtime.CfJspPage._get(CfJspPage.java:360)
        at coldfusion.runtime.CfJspPage._get(CfJspPage.java:334)
        at coldfusion.runtime.CfJspPage._get(CfJspPage.java:321)
        at coldfusion.runtime.CfJspPage._autoscalarize(CfJspPage.java:2433)
        at coldfusion.runtime.CfJspPage._autoscalarize(CfJspPage.java:2395)
        at cfBaseGrammar2ecfc1510236286$funcTRYPOSTINTERCEPTOR.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\modules\qb\models\Grammars\BaseGrammar.cfc:129)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:5011)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4991)
        at cfBaseGrammar2ecfc1510236286$funcRUNQUERY.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\modules\qb\models\Grammars\BaseGrammar.cfc:110)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4254)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4217)
        at cfQueryBuilder2ecfc1227477118$funcRUNQUERY.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\modules\qb\models\Query\QueryBuilder.cfc:3503)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:681)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4909)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4890)
        at cfQueryBuilder2ecfc1227477118$funcRUN.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\modules\qb\models\Query\QueryBuilder.cfc:3460)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:681)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4909)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4890)
        at cfQueryBuilder2ecfc1227477118$funcGET.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\modules\qb\models\Query\QueryBuilder.cfc:3212)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:681)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4909)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4890)
        at cfQueryBuilder2ecfc1227477118$func_CF_ANONYMOUSCLOSURE_52.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\modules\qb\models\Query\QueryBuilder.cfc:3227)
        at coldfusion.runtime.Closure.invoke(Closure.java:171)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:5011)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4991)
        at cfQueryBuilder2ecfc1227477118$funcWITHRETURNFORMAT.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\modules\qb\models\Query\QueryBuilder.cfc:3732)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:5011)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4991)
        at cfQueryBuilder2ecfc1227477118$funcFIRST.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\modules\qb\models\Query\QueryBuilder.cfc:3226)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4254)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4217)
        at cfQuickBuilder2ecfc1858670105$funcFIRST.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\models\QuickBuilder.cfc:738)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4254)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4217)
        at cfQuickBuilder2ecfc1858670105$funcFIRSTORFAIL.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\models\QuickBuilder.cfc:691)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at co
[ERROR] ldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4254)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4217)
        at cfBaseRelationship2ecfc106908637$funcFIRSTORFAIL.runFunction(D:\Dropbox\Repositories\ccis-api\modules\quick\models\Relationships\BaseRelationship.cfc:136)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4254)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4217)
        at cfProduct2ecfc493613111$funcGETINDEMNITYBYPAYMENTOPTIONID.runFunction(D:\Dropbox\Repositories\ccis-api\models\product\Product.cfc:169)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:5011)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4991)

I suspect this is a race condition, because if I sleep( 2000 ) before executing submitApp(), the error changes to something different:

var f = async().newFuture( function() {
                
    logger.warn( "I started!" );
    
    // take a nap first.
    sleep( 2000 );
    
    submitApp( event, rc, prc );
    logger.warn( "I finished!" );
        
} ).then( ( data ) => {
    logger.warn( "I finished!" );
} );
[Error] running Supplier: Injector not found in scope registration informationScope information: {SCOPE={application},ENABLED={true},KEY={wireBox}}
[ERROR] Stacktrace for Supplier: coldfusion.runtime.CustomException: Injector not found in scope registration information
        at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:139)
        at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:5191)
        at cfProvider2ecfc1272647826$func$GET.runFunction(D:\Dropbox\Repositories\ccis-api\coldbox\system\ioc\Provider.cfc:95)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:5011)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4991)
        at cfProvider2ecfc1272647826$funcONMISSINGMETHOD.runFunction(D:\Dropbox\Repositories\ccis-api\coldbox\system\ioc\Provider.cfc:108)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:417)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:996)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:762)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4165)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4129)
        at cfBaseApp2ecfc935791906$funcCREATEPDF.runFunction(D:\Dropbox\Repositories\ccis-api\models\app\BaseApp.cfc:247)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4254)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4217)

For reference, the Renderer is injected into the Quick entity like this:
property name="renderer" inject="provider:coldbox:renderer" persistent="false";
and called like this:

void function createPdf( required string baseUrl ) {
        
        var body = renderer.renderView(
            view = "pdfs/app", // <-- line 247 triggers the exception
            args = {
                "app": this,
                "baseUrl" = baseUrl
            }
        );

Another thing I noticed is that if you call renderView() from the Renderer from within a model, it has access to event.getHTMLBaseURL(). However, if you call it from within async(), you will get a null pointer exception, which is why I pass in baseUrl manually through to the view.

Can anyone offer any pointers on how to work around these issues?

I continued my experiments into the wee hours of the night and discovered the issue is exclusive to ACF engines and may be related to an issue I created for Coldbox scheduled tasks back in 2021:
https://ortussolutions.atlassian.net/browse/COLDBOX-1070

My current theory is that ACF engines have trouble accessing the application scope when running async().

The clues are in both error messages I received:
Injector not found in scope registration informationScope information: {SCOPE={application},ENABLED={true},KEY={wireBox}}
and
Variable APPLICATION is undefined.

What is the exception? I would assume it’s related to hitting the cgi scope after the main thread has finished.

@bdw429s
This is the error if you try and call event.getHTMLBaseURL() inside an async() closure.

[Error] running Supplier:
[ERROR] Stacktrace for Supplier: java.lang.NullPointerException
        at coldfusion.runtime.CFPage.GetHTTPRequestData(CFPage.java:11562)
        at cfRequestContext2ecfc15633158$funcGETHTTPHEADER.runFunction(D:\Dropbox\Repositories\ccis-api\coldbox\system\web\context\RequestContext.cfc:1659)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:5011)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4991)
        at cfRequestContext2ecfc15633158$funcISSSL.runFunction(D:\Dropbox\Repositories\ccis-api\coldbox\system\web\context\RequestContext.cfc:788)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:5011)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4991)
        at cfRequestContext2ecfc15633158$funcGETHTMLBASEURL.runFunction(D:\Dropbox\Repositories\ccis-api\coldbox\system\web\context\RequestContext.cfc:1086)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4254)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:4217)
        at cfApps2ecfc1263895291$func_CF_ANONYMOUSCLOSURE_37.runFunction(D:\Dropbox\Repositories\ccis-api\modules_app\api\modules_app\v1\handlers\Apps.cfc:200)

The above issue is an easy one to workaround because you can put the value into the prc scope or even the request scope if needed. However, the issue I can’t seem to workaround is the “Injector not found in scope registration informationScope information: {SCOPE={application},ENABLED={true},KEY={wireBox}}” as mentioned above.

Yeah, I saw your other questions, I just don’t have an answer to them :slight_smile: I assume ACF 2021 has changed behind the scenes what needs to happen to associate the fusion context to the thread. I just don’t have any time to look at it ATM as it’s all undocumented and annoying to deal with.

The “real” solution to all of this IMO is when the CF engines both care enoguh to finally complete these tickets
https://luceeserver.atlassian.net/browse/LDEV-3960
https://tracker.adobe.com/#/view/CF-4213223

because the workarounds we do currently are full off issues like this.

Makes sense. It sounds like a real PITA. It was a pain for me to troubleshoot/replicate on my end also so I can’t even imagine how hard it would be to come up with a reliable workound.

Either way, I appreciate you taking the time to respond. :slight_smile:

Created an issue and a Github repo to reliably reproduce the problem:
https://ortussolutions.atlassian.net/jira/software/c/projects/COLDBOX/issues/COLDBOX-1212