[coldbox-3.8] Environment test in ColdBox config randomly failed using Lucee 4.5

I have a couple sites still using ColdBox 3.8 where I use the environments structure within the Coldbox.cfc to determine my environment. The regex I have set up works and I have not had any issues until yesterday. When going to the test site, CB wasn’t able to identify the site as test and ended up giving it the production configuration. I upgraded from Railo to Lucee 4.5 a few weeks ago but this is the first time its happened. It never happened before the upgrade and we were doing a lot of automated testing then.

Restarting the Lucee service resolved the issue with no code changes needed.

My question is has anyone else seen this kind of issue where the environment config works normally, and then stops for some reason? I don’t know if this is Lucee specific or just a random occurrence regardless of the application server. If you have seen it, any suggestions on how to resolve it or at the least, implement a failsafe?

Thank you.


Daniel Garcia

The first hit to the site when the framework loaded was probably via the IP address or some other domain name. Put some logging in your environment detection to confirm this. Defaulting to production config is the safest thing to do from a ColdBox perspective. You can lock down your web server to ensure that it won’t serve up your site to other hostnames, but I can’t give more specifics without knowing what servlet container or web server is in play.



ColdBox Platform Evangelist
Ortus Solutions, Corp

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