[coldbox-4.2.0] autodeploy module

34 views
Skip to first unread message

Jacob Beers

unread,
Oct 24, 2016, 2:55:55 PM10/24/16
to ColdBox Platform
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!

br...@bradwood.com

unread,
Oct 25, 2016, 4:50:00 PM10/25/16
to col...@googlegroups.com
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: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/67a263b6-2165-4fc7-ac70-b5a7c4469a99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jacob Beers

unread,
Oct 26, 2016, 2:33:42 PM10/26/16
to ColdBox Platform
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
466 : 	private string function processException( required controller, required exception ){
467 : 		// prepare exception facade object + app logger
468 : 		var oException	= new coldbox.system.web.context.ExceptionBean( arguments.exception );
469 : 		var appLogger  	= arguments.controller.getLogBox().getLogger( this );
470 : 		var event		= arguments.controller.getRequestService().getContext();

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

Thanks

br...@bradwood.com

unread,
Oct 26, 2016, 2:52:56 PM10/26/16
to col...@googlegroups.com
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: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
Subject: Re: [coldbox:26080] [coldbox-4.2.0] autodeploy module
From: "Jacob Beers" <jbe...@diastolicdesign.com>
Date: 10/26/16 1:33 pm
To: "ColdBox Platform" <col...@googlegroups.com>

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.

Jacob Beers

unread,
Oct 26, 2016, 2:58:37 PM10/26/16
to ColdBox Platform
Yes, we have a mapping in our Application.cfc

br...@bradwood.com

unread,
Oct 26, 2016, 3:22:32 PM10/26/16
to col...@googlegroups.com
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?  
--------- Original Message ---------

Jacob Beers

unread,
Oct 26, 2016, 3:34:31 PM10/26/16
to ColdBox Platform
We are on up-to-date cf11, cb4.2.0, and autodeploy 1.2.0

br...@bradwood.com

unread,
Oct 26, 2016, 3:42:25 PM10/26/16
to col...@googlegroups.com
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.
--------- Original Message ---------
Reply all
Reply to author
Forward
0 new messages