Install Issue

I also tracked down why it looks like this, you know I am personally sick of hearing that you guys can’t duplicate the most simple problems, please don’t read into that too much. But if you want to test, then maybe doing so on a clean machine instance would help greatly.

I have found why this new release can’t be installed, which now introduces another error once we get past the DSN-Installer and too be honest, all it took was a clean machine too find this bug.

The problem is that ContentBox V2 when trying to install has ContentBox as a DSN hardcoded and doesn’t use the DSN entered.

May I suggest when doing testing, you deploy a staging server that can be fired up that is a clean instance that you can do your testing on, but personally the amount of simple bugs that I am forced to find because the developers here are too lazy to actually do proper clean installs for testing is beyond a joke.

http://127.0.0.1:82/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/index.cfm/cbadmin/modules/modules/modules/modules/modules/modules/modules/modules/modules/modules/contentbox-dsncreator

If it is not correctly installed, the redirection that has been employed is way off. The following is the culprit.

// Asset root assetRoot = "../contentbox-admin";

// Create or Use
if( action eq “process” ){

// Process or create?
if( dsnCreated ){
// Update datasource
request.cfHelper.updateAPP( dsnName );
// Relocate to installer now
location( url="…/…/index.cfm", addToken=“false”);
}
// Create new DSN
else{
results = request.cfHelper.createDSN(cfmlPassword=cfpassword,
dsnName=dsnCreateName,
dbType=dbType,
dbHost=dbServer,
dbName=dbName,
dbUsername=dbUsername,
dbPassword=dbPassword);
// Check for errors?
if( !results.error ){
// Update APP DSN Now!
request.cfHelper.updateAPP( dsnCreateName );
// Relocate to installer now
location( url="…/…/index.cfm?cbInstaller=true", addToken=“false” );
}
else{
// Mark Errors
errors = results.messages;
}
}
}

signature0.jpg

Ok, I think I was able to reproduce this.

I think this is a bug with ColdFusion and using the same part of the URL in our mappings.

I dropped the contentbox source in my webroot under a folder called /cb

This basically does not work as ACF get’s confused with the routing in ContentBox “cbInstaller”. I renamed the folder to “MySite” and it worked no problem. I renamed it to “contentbox” and it does not work.

This is in the installation guide:

Due to a bug in some CFML engines, DO NOT use the subfolder name contentbox, usecbox or site or whatever you like if you will be deploying under a subfolder.

So in conclusion, for some odd reason, using the same name as the internal mapping in the folder blows up, and also if you use “cb” as the folder name.

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

signature0.jpg

The problem is not the redirection Andrew. It was the mapping conflict with the folder name. What folder name did you use?

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

signature0.jpg

I am running on ColdFusion 10 & 11 and have never had that issue, anyway here is what lead me to the finding. I have no DSN called ContentBox, nor did I use a DSN called ContentBox when trying to setup as per my steps.

It still doesn’t populate the Database as another error comes up, as it tries to go to

http://127.0.01:82/index.cfm

Which throws this error as there is nothing in the DB, attached at bottom is the DSN error ColdFusion throws.

I am not sure what you mean by sub folder Luis, I have never ever used subfolders.

Setting cb_site_layout not found in settings collection

Registered settings are:

The error occurred inD:/Projects/ColdFusion/ContentBox2.0/modules/contentbox/model/system/SettingService.cfc: line 120
Called from D:/Projects/ColdFusion/ContentBox2.0/modules/cronus-ui/interceptors/layoutInterceptor.cfc: line 253
Called from D:/Projects/ColdFusion/ContentBox2.0/coldbox/system/web/context/InterceptorState.cfc: line 369
Called from D:/Projects/ColdFusion/ContentBox2.0/coldbox/system/web/context/InterceptorState.cfc: line 260
Called from D:/Projects/ColdFusion/ContentBox2.0/coldbox/system/web/context/InterceptorState.cfc: line 121
Called from D:/Projects/ColdFusion/ContentBox2.0/coldbox/system/web/services/InterceptorService.cfc: line 142
Called from D:/Projects/ColdFusion/ContentBox2.0/coldbox/system/web/services/LoaderService.cfc: line 88
Called from D:/Projects/ColdFusion/ContentBox2.0/coldbox/system/Coldbox.cfc: line 71
Called from D:/Projects/ColdFusion/ContentBox2.0/Application.cfc: line 88

118 : 		}
119 : 		throw(message="Setting #[arguments.name#](http://arguments.name#) not found in settings collection",
**120 : 			  detail="Registered settings are: #structKeyList(s)#",**
121 : 			  type="contentbox.SettingService.SettingNotFound");
122 : 	}

signature0.jpg

signature0.jpg

Doh, that is a module of mine kicking before the installer is kicking in so ignore that. If I remove them, the cbinstaller eventually runs. So the major issue is that the dsn-creator uses a hard coded value called ContentBox and not the value the user enters. Which causes it to not redirect correctly to the cbinstaller.

Took me a whole 10mins to locate and test for that…

signature0.jpg

signature0.jpg

You mean, when it does the replacement? It is hard coded, because that’s what the source code ships with. If the user alters the source, then yes, that can have repercussions.

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

signature0.jpg

signature0.jpg

Luis, without looking at the code that is what it appears to be doing. Without looking at the code here is what I know.

If there is NO DSN called ContentBox it will fail each and every time you use a DSN that is not called ContentBox. If you setup a fake DSN called ContentBox then the DSN-Creator will work.

Now without looking at the code, if you release a product that is reliant on a dummy DSN being setup, you have a coding error. I can see the Application.cfc is actually modified for the DSN we asked it to be, this means that the ORM has kicked in before this change takes place.

signature0.jpg

signature0.jpg

signature0.jpg

No that’s not the way it works.

The source ships with this.datasource = “contentbox”; as a placeholder. The dsn creator modifies the Application.cfc to remove the include relocation and also to update the dsn that you create in the installer.

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

signature0.jpg

signature0.jpg

signature0.jpg

I did a fresh install of 2.0 on a new server with no dsns and it worked just fine. no “contentbox” dsn needed.

signature0.jpg

signature0.jpg

signature0.jpg

signature0.jpg

Luis, I realise that is not how it is suppose to work. That is what is happening.

All I can tell you, is this.

  1. Stop ColdFusion and delete all logs.
  2. Create a folder and copy the source of ContentBox 2.0 into it.
  3. Setup IIS to point to this folder.
  4. Restart ColdFusion
  5. Browse to the new website

When you enter the information, whether it be a created DSN already or not the outcome is the same. It redirects back to the dsn-creator and in the ColdFusion logs you will find.

“Error”,“ajp-bio-8014-exec-1”,“06/28/14”,“08:11:07”,“ContentBox-Shell-2014.06.28.0016AECFCC6BCDA0F3510795C8A25AAC84B”,"Datasource contentbox could not be found.Ensure that you have spelled the name correctly and that the data source is registered in the ColdFusion Administrator Data Sources page. The specific sequence of files included or processed is: D:\Projects\ColdFusion\ContentBox2.0\index.cfm’’ "
coldfusion.sql.DataSourceFactory$DataSourceException: Datasource contentbox could not be found.
at coldfusion.sql.DataSourceFactory.getDataSource(DataSourceFactory.java:89)
at coldfusion.sql.Executive.getDatasource1(Executive.java:577)
at coldfusion.sql.Executive.datasourceExists(Executive.java:584)

I don’t see how it is saying that the DSN is ContentBox when I am not using anything similar to this, regardless of what you may say this was a fresh VM and I have since fired up 10 more and each VM has done the same thing. I then moved it to a hosting server and tried my luck there, which I got the same results as I got locally.

signature0.jpg

What was the name of the DSN that you tried Curt, like I have stated very clearly if you use anything other than ContentBox you will find this error in the logs and I have now tried 10 VMS a production server and 25 client machines all with the exact same problem.

“Error”,“ajp-bio-8014-exec-1”,“06/28/14”,“08:11:07”,“ContentBox-Shell-2014.06.28.0016AECFCC6BCDA0F3510795C8A25AAC84B”,"Datasource contentbox could not be found.Ensure that you have spelled the name correctly and that the data source is registered in the ColdFusion Administrator Data Sources page. The specific sequence of files included or processed is: D:\Projects\ColdFusion\ContentBox2.0\index.cfm’’ "
coldfusion.sql.DataSourceFactory$DataSourceException: Datasource contentbox could not be found.
at coldfusion.sql.DataSourceFactory.getDataSource(DataSourceFactory.java:89)
at coldfusion.sql.Executive.getDatasource1(Executive.java:577)
at coldfusion.sql.Executive.datasourceExists(Executive.java:584)
at coldfusion.orm.hibernate.HibernateConfiguration.validateDatasource(HibernateConfiguration.java:228)
at coldfusion.orm.hibernate.HibernateConfiguration.validateDatasource(HibernateConfiguration.java:238)
at coldfusion.orm.hibernate.HibernateConfiguration.initHibernateConfiguration(HibernateConfiguration.java:196)
at coldfusion.orm.hibernate.HibernateConfiguration.(HibernateConfiguration.java:183)
at coldfusion.orm.hibernate.ConfigurationManager.initConfiguration(ConfigurationManager.java:67)
at coldfusion.orm.hibernate.HibernateProvider.InitializeORMForApplication(HibernateProvider.java:184)
at coldfusion.orm.hibernate.HibernateProvider.beforeApplicationStart(HibernateProvider.java:80)
at coldfusion.filter.ApplicationFilter.fireBeforeAppStartEvent(ApplicationFilter.java:611)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:330)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:141)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at

signature0.jpg

signature0.jpg

signature0.jpg

signature0.jpg

I used the name “DB” and it worked fine. If your Application.cfc still says "contentBox that means something in the installer didn’t run correctly. Perhaps a permissions error or aggressive of cached templates. Do you have trusted cache turned on?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

signature0.jpg

signature0.jpg

signature0.jpg

signature0.jpg

There is nothing to enable in SQL Server. The settings that need enabled in CF should all already be in the Application.cfc.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

signature0.jpg

Yes, I saw it but it was just the “Table cb_comment defined for cfc contentbox.model.comments.Comment does not exist.” error and we already know why you’re getting that-- because there’s no tables in your DB. That’s just a downstream symptom of having no tables. I want to know if any other errors are being thrown earlier in the install process that are preventing the tables from being created. They may not appear on your screen, but may be only output in ColdFusion’s log files.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

signature0.jpg

If CF is allowed to process the Application.cfc before the data source exists, it will blow up. Therefore, we have to redirect the user away to the DSN installer first. Once the data source is created, we can allow ORM to load. And once ORM loads (and creates the tables) we can start the second installer that actually populates bootstrap data into those tables.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

signature0.jpg

Brad is there already a DSN named ContentBox on your CF Installation?

Trusted cache did fix this and if that is the reason then you will need to look at a better detection method. People who install this on shared hosting will not be able to have that switched off.

There is actually. I deleted it though and it still worked with a new name of “test123”.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

I doubt shared hosting ever uses trusted cache because then people would never be able to upload new code! But, no, trusted cache must be turned off for the installer’s changes to be picked up as well as any time an update is applied. There’s really no way around that no matter what we do. Perhaps we display a warning message to the user.

Greg, if you’re still with it-- do you happen to have trusted cache enabled on your machine?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Brad,

Actually there is a way around it.

Is there any reason why ORM is not disabled, then when you make changes to the Application.cfc you do the same to re-enable the ORM. This would allow the DSN-Creator then be a self sufficent module without the need for a hack of adding an include at the beginning of the Application.cfc, I see no technical reason why it could not have been done that way.