• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Could not find the included template

New Here ,
Feb 19, 2013 Feb 19, 2013

Copy link to clipboard

Copied

I am getting an odd error and looking for help.

Every so often I get the error "could not find the included template"

eg.

"Could not find the included template /includes/CT_MCT_checklogin.cfm."

"Could not find the included template /tools/CheckSettings.cfm."


The scripts are running a lot but the error only occurs about 0.003% of the time. (ie. one script is run every 60 seconds but the error only occurs about 3-4 times every day.)

The randomness of the error has me baffled as to what to do to handle this. When the error occurs I can refresh the page in the browser and it works again.

Has anyone else ever encountered this problem?

Note: we upgraded from Coldfusion 7 to 10 a few weeks ago and this has been happening ever since.

Views

5.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2013 Feb 19, 2013

Copy link to clipboard

Copied

Are the base paths physical directories within the CF root, or are they mappings? If the latter, where are the mappings set: CFAdmin or Application.cfc?

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2013 Feb 19, 2013

Copy link to clipboard

Copied

These are physical directories from the web root directory.  The odd thing is that they work 99.997% of the time but cause an error on the other 0.003%.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

The same thing is happening to me. I'm using physical directories as well but I'm seeing random "Could not find the included template" errors. It only seems to happen when robots visit the website like GoogleBot and BingBot. Not sure what to do about it but it's very annoying.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

Hey Kurt,

I'm curious. Are you still seeing this issue? I am most certainly seeing it, 6 times today so far and all are GoogleBot.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

If anyone is having the same issue please vote for the bug request:

https://bugbase.adobe.com/index.cfm?event=bug&id=3519649

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 07, 2016 Jun 07, 2016

Copy link to clipboard

Copied

This issue still exists in CF10 (3 years later) and is listed as an open bug with the status "CannotReproduce".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 07, 2016 Jun 07, 2016

Copy link to clipboard

Copied

Hi James,

Could you please help us with the reproducible case, I will work with the team to get this addressed.

Thanks,

Priyank

Thanks,
Priyank Shrivastava

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 07, 2016 Jun 07, 2016

Copy link to clipboard

Copied

I wish I could reproduce it.  I wish I could generate a test case.  It's been occurring on all ColdFusion 9 older-Fusebox-hybrid framework websites when we migrate to ColdFusion 10.  They worked fine on ColdFusion 6, 7, 8 & 9.  After moving to CF10, it occasionally throws the error.  I have FusionReactor installed.  I do not have template caching enabled.

Windows Server 2012 R2

CF 10,0,17,295085

Java 1.8.0_77

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 27, 2016 Jun 27, 2016

Copy link to clipboard

Copied

I too have this problem. Here are some notes, which may help others that have it, or may help Adobe track down the root cause.

  1. It appeared on a site that ran for over ten years with no evidence of this problem. Currently it runs on CF10, Windows 2008.
  2. The problem appeared when the site re-launched with a modified framework, which moved the header and footer includes to a subdirectory of the root. So before it would use template='footer.cfm', whereas now it uses template='/util/footer.cfm'.
  3. The site uses no mappings for the include folders. The called templates are in the root, and the include folders are right under it.
  4. There are many includes used by the framework, but three are called far more than the others: header, footer and authentication.
  5. Virtually all errors occurred on the include statement for the footer, which is the last line of the templates that form the pages of the site. Pages that include the footer always include the header first, as well as the authentication template, but no errors have been logged regarding these templates.
  6. By far most, but not all, errors occurred in the most frequently called template. The error has been occurring about a dozen times per day, which is a tiny fraction of the overall site traffic.
  7. Moving the footer template into the root, where the templates that include it are, seems to have alleviated the problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 27, 2016 Jun 27, 2016

Copy link to clipboard

Copied

Can you log the cfcatch or error object? I'm guessing it's something with SES directory traversal and the error object would confirm this.

I have experienced this or something very similar using the fusebox framework and it was related to the SES functionality that is built in to FB. I'm in the process of changing most everything to FW1 and I have not had the issue since.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 30, 2016 Jun 30, 2016

Copy link to clipboard

Copied

Here is the stack trace for one of the errors.

coldfusion.tagext.lang.IncludeTag$NoSuchIncludeTemplateException: Could not find the included template /util/footer.cfm.

at coldfusion.tagext.lang.IncludeTag.setTemplate(IncludeTag.java:368)

at cflistinglist2ecfm1678004570.runPage(C:\home\xxxxxxx.com\wwwroot\listinglist.cfm:757)

at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)

at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)

at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799)

at cfApplication2ecfc579331529$funcONREQUEST.runFunction(C:\home\xxxxxxx.com\wwwroot\Application.cfc:62)

at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)

at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)

at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)

at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)

at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)

at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108)

at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:300)

at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:424)

at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)

at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)

at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)

at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)

at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)

at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)

at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)

at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)

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 sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)

at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)

at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:299)

at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)

at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)

at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)

at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)

at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:246)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at com.seefusion.Filter.doFilter(Filter.java:49)

at com.seefusion.SeeFusion.doFilter(SeeFusion.java:1500)

at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)

at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)

at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:246)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:219)

at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:333)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)

at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

at java.lang.Thread.run(Thread.java:662)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

We started experiencing the same issue when we upgraded to ColdFusion 2016 from ColdFusion 9.  We did go from a single instance of ColdFusion to a cluster of 3 ColdFusion instances when we upgraded.  I have wondered if it was related to that architecture changed.  We have the same exact issue though.  The cfinclude works the majority of the time and we have had zero user reports of an issue when it does happen.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

Same issue I am facing when migrating from CF11 to CF2021. The Error coming only in a few pages rest are working fine. If you came out from this issue then guide me. I have already mapped the path in CF admin setting but still same error. If removing CF include from that particular page throwing an error related to their header footer.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

To work around this inconsistent bug ColdFusion 10, I started adding the sub-directories to the root application.cfc as "mapped" directories.  (I'm not sure if this works in CF11 or is needed in CF2016, but it can't hurt.)  After doing this, we haven't seen any recurring errors in our log files.

this.rootDir = getDirectoryFromPath(getCurrentTemplatePath()); this.mappings = {}; this.mappings[ "/includes" ] = "#this.rootDir#includes/"; this.mappings[ "/tools" ] = "#this.rootDir#tools/";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2023 Apr 10, 2023

Copy link to clipboard

Copied

LATEST

We have been experiencing the NoSuchIncludeException on Coldfusion 2018 Update 15.  We introduced a fix based on the this.mappings suggestion.  The number of occurrences looks lower and smoother than before the code change, but it still flares up from time to time.  This happens across several servers at intermittent times.  Our solution has been to watch for a server that has several occurrences in a small timespan and pull it out for a reboot before an important area of the application gets affected.

Austin242072224eeg_0-1681134037024.png

We have been addressing some occurrences by changing the code from an absolute path to a relative file path like the error message itself suggests, but we have seen the error message on relative paths on a few occasions too. 

 

The code in Application.cfc looks like this:

<!--- called first in onApplicationStart like <cfset setMappings() /> --->
<cffunction name="setMappings" returnType="void" output="false" access="private">
        <cfif (NOT structKeyExists(this, "rootDir") OR this.rootDir EQ "")>
            <cfset this.rootDir = ExpandPath(path="./") />
        </cfif>
        <cfif (NOT structKeyExists(this, "mappings") OR NOT isStruct(this.mappings))>
            <cfset var tempMappings = {} />
            <cfset var rootLevelFolders = DirectoryList(ExpandPath(path = "./"), false, "path", "*", "asc", "dir") />
            <cfloop array="#rootLevelFolders#" index="local.folderPath">
                <cfset var mappingKey = getMappingKey(local.folderPath) />
                <cfif Left(mappingKey, 2) EQ "/.">
                    <cfcontinue />
                </cfif>
                <cfset tempMappings[mappingKey] = local.folderPath />
            </cfloop>
            <cfset this.mappings = tempMappings />
        </cfif>        
    </cffunction>

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation