[coldbox-4.2.0] autodeploy module

Hi all, I have a couple quick questions about the autodeploy module. We recently installed autodeploy into our app, which was straightforward, however we seem to be consistently getting an error when using the deploy tag.

If I update the deploy tag and then try and hit the site I get an error at /coldbox-4.2.0/system/Bootstrap.cfc: line 468.

If I immediately try to hit the site again the application will immediately load and everything will be fine. I traced the issue into postProcess() and if I comment out the line ‘log.info( “Deploy tag reloaded successfully.” );’
everything works as expected. I’m not sure if this is due to an issue with the way we have logging set up or what. Any suggestions?

Additionally I was looking through the code and noticed that ‘dateCompare( tagTimestamp, appTimestamp ) eq 1’ appears twice but the variables are never updated between checks. Is there something that I’m not understanding about the code that should update these variables? It appears to me as though they will always evaluate the same as they are both function scoped.

`

function postProcess( event, interceptData ){
// get the timestamp of the configuration file
var tagTimestamp = fileLastModified( variables.tagFilepath );

// Check if setting exists
if ( settingExists( “_deploytagTimestamp” ) ){
// get current timestamp
var appTimestamp = getSetting( “_deploytagTimestamp” );

//Validate Timestamp
if ( dateCompare( tagTimestamp, appTimestamp ) eq 1 ){
lock scope=“application” type=“exclusive” timeout=“25” throwOntimeout=“true”{
// concurrency lock
if ( dateCompare( tagTimestamp, appTimestamp ) eq 1 ){
try{
// commandobject
if( len( variables.deployCommandObject ) ){
getInstance( variables.deployCommandObject ).execute();
// Log
if( log.canInfo() ){
log.info( “Deploy command object executed!” );
}
}

// Mark Application for shutdown
applicationStop();

// Log Reloading
if( log.canInfo() ){
// the application errors once each time you do a deploy with the deploy tag
// subsequent requests work fine and the application appears to have reloaded
log.info( “Deploy tag reloaded successfully.” );
}
} catch(Any e) {
//Log Error
log.error( “Error in deploy tag: #e.message# #e.detail#”, e.stackTrace );
}
} // end if dateCompare
} //end lock

} // end if dateCompare

// stop interception chain
return true;

} // end if setting exists
else {
configure();
}
}

`

Thanks for the help! It’s greatly appreciated!

What was the actual error you received? Can you send a pull request with your improvements?

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

The actual error I got was:

Could not find the ColdFusion component or interface coldbox.system.web.context.ExceptionBean. |

  • |
    Ensure that the name is correct and that the component or interface exists. |

The error occurred in [path redacted]/coldbox-4.2.0/system/Bootstrap.cfc: line 468
Called from [path redacted]/coldbox-4.2.0/system/Bootstrap.cfc: line 289
Called from [path redacted]/coldbox-4.2.0/system/Bootstrap.cfc: line 353
|


<br>466 : private string function processException( required controller, required exception ){<br>467 : // prepare exception facade object + app logger<br>**468 : var oException = new coldbox.system.web.context.ExceptionBean( arguments.exception );**<br>469 : var appLogger = arguments.controller.getLogBox().getLogger( this );<br>470 : var event = arguments.controller.getRequestService().getContext();<br>

|

So far I can’t say I really have any improvements. Only commenting out line 73 of interceptors/Deploy.cfc

Thanks

Do you have a mapping for /coldbox? I see you’ve renamed your coldbox folder to coldbox-4.2.0. If so, is it a server mapping or application-specific?

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Yes, we have a mapping in our Application.cfc

That’s an odd error then-- it seems your ColdFusion mapping has disappeared in mid-request! What version of CF are you on and do you have all the latest updates?

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

We are on up-to-date cf11, cb4.2.0, and autodeploy 1.2.0

If it’s the same error every time, I’d put some debugging code there and dump out the current mappings at the time of the error to see if they’re present via getApplicationMetadata(). To be honest, I’ve mostly used the auto-deploy module on Lucee Server.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com