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

CF2016 HF10 - Losing Application Setting

Community Beginner ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

Environment:

Unix Solaris

Apache 2.4.39

CF2016 HF10

I have been having this really weird intermittent issue with uploading files and the only thing I have been able to track it down to is the Application the web transaction is running as displayed in FusionReactor.

I'm monitoring for a post transaction and the only time it seems to fail is when it is being run as "Adobe Coldfusion 2016" application, when it normally is run as "XYZ Application" coded in the application.cfc.

When the app runs as Adobe Coldfusion 2016 it times out after 20s no JDBC transactions are started and it shows Tomcat WebSocket (JSR356) Filter.

A little bit of research and the default timeout for Tomcat connector is 20s

CFADMIN settings for timeout on this instance is set to 60s and have verified in server.xml the connector port settings are there.

When the application succeeds it usually completes in 4-7 seconds.

Since upgrading to HF10 I have run the wsconfig upgrade to bring the connectors up to mod_jk/1.2.46

We have pushed the application data back out to the environment, cleared all caches, restarted the instances and it is still behaving the same way.

Anyone have any idea where to start with troubleshooting why the application is occasionally/intermittently running as different applications?

Views

535

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 ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

in the application.cfc are you setting the application name with the this.name or this.applicationName?  or application.name, application.applicationName is the way to go.

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
Community Beginner ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

Currently the application is set as.

<cfset this.name = "XYZ_Application" />

Thank you for the response, I will get this over to our dev team to see if that fixes it.

Is there a reason "this.name" shouldn't be used, deprecated?

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
Community Expert ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

kevinr1985  wrote

Currently the application is set as.

<cfset this.name = "XYZ_Application" />

Correct. That is in fact the way to do it.

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
Community Expert ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

Before you start debugging, leave all the settings in the ColdFusion Administrator, server.xml, etc., at their default value. If you experiment with the settings, you will complicate the issue from the beginning.

Could you share the Application.cfc code with us? Might the application be intermittently using a second Application.cfc? (In your posts above, you mention "XYZ Application" and "XYZ_Application")

Do you have ColdFusion Enterprise or Standard? In any case, the first place to start debugging is the ColdFusion logs. Have you had a look at the coldfusion-error, coldfusion-out, exception and application logs?

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
Community Beginner ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

We are using CF Enterprise.

Have checked all of the logs, nothing is showing in logs when it fails. FusionReactor shows the request as 200 code.

Apache logs show 200 codes for the URL

On the user side they get a page with error "ERR_CONNECTION_RESET"

I will see if I can post up the Application.cfc code, I'm the Sys Admin and haven't written the code.

Additional information:

Environment is 2 production servers and 4 instances clustered, 2 instances per server.

The issue is happening across all 4 instances.

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
Community Beginner ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

Application.cfc

<cfcomponent output="false">

    <cfset this.name = "DPS_20190102" />

    <cfset this.applicationTimeout = createTimeSpan( 0, 1, 0, 0 ) />

    <cfset this.sessionManagement = true />

    <cfset this.setClientCookies = false />

    <cfset this.sessionTimeout = createTimeSpan( 0, 1, 0, 0 ) />

    <cfset this.securejson=false>

  

    <cffunction name="onApplicationStart">

      <cfset application.primary_software_error_contact =  "">

      <cfset application.secondary_software_error_contact = "">

      <cfset application.planning_schema =  "wdresplanlog">     

      <cfset application.standard_project_list = "Developer,Public works">

      <cfset application.dry_utility_project = "Dry utility">

      <cfset application.dry_utility_list = ListAppend( application.standard_project_list, application.dry_utility_project )>

      <cfinvoke component="universal.environment" method="Get"  p_subdirectory = "from_dps"  returnvariable="local.temp">

      <CFSET application.datasource = local.temp.datasource>

      <cfset application.file_directory = local.temp.file_path>

      <cfset application.link = local.temp.link>

      <cfset application.level = local.temp.level>

    

      <cfSET application.scheduling_db_source="inspect_sched_dev">

      <cfif local.temp.level eq "prod">

        <cfSET application.scheduling_db_source="inspect_sched">

      <cfelseif local.temp.level eq "qa">

        <cfSET application.scheduling_db_source="inspect_sched_qa">

      </cfif>

      <cfset application.awpr_cutoff_id = 20000>

      <cfset application.insp_to_be_ignored = "GPSUG,GPSFNL,GPSLOC,GPSRLN,QA-UG,QA-FNL">    

    

      <cfset application.partial_data_entry_status = "Partial Data Entry">

      <cfset application.complete_data_entry_status = "Data Entry Complete">

  <cfset application.easementStatusStruct = StructNew()>

      <cfset StructInsert( application.easementStatusStruct, "easement_cancel",  "No longer required" )>

      <cfset StructInsert( application.easementStatusStruct, "easement_approve",  "Approved" )>

      <cfset StructInsert( application.easementStatusStruct, "easement_recorded",  "Document Recorded" )>

      <cfset StructInsert( application.easementStatusStruct, "old_style_easement", "Old Style" )>

    <cfset application.org_type_list = "Individual,Corporation,Partnership, Limitied Liability Company (LLC),Government,Other">

      <cfset application.ibc_list = "I-A,I-B,II-A,III-A,V-A,IV H.T.,II-B,III-B,V-B">

      <cfinvoke component="universal.security.security" method="GetKey" app_name="DPS" key_type="IMM" returnvariable="application.imm_token" />

      <cfreturn />

    </cffunction>

    <cffunction name="onSessionStart">

       <cfset session.datasource = application.datasource>

       <cfset session.validate = createObject( "component", "universal.validate" )>

       <cfinvoke component="universal.environment" method="Get" returnvariable="session.environment">     

       <cfset session.dispatch_only = false>

       <cfinvoke component="universal.environment" method="Get" p_subdirectory = "dpr/HGL_Requests" returnvariable="local.temp">

       <cfset session.hgl_results_path = local.temp.file_path>

       <cfset session.hgl_link_path = local.temp.link>

       <cfreturn />

    </cffunction>

    <cffunction name="onRequestStart">

      <!--- If xyz.com is not in the server name then something is a miss, so redirect to home page. --->

      <cfif findnocase( "xyz.com", cgi.server_name ) eq 0>

        <cflocation url="/" addtoken="no">

      </cfif>

      <cfsetting showdebugoutput="no">

      <cfheader name="cache-control" value="no-cache, no-store, must-revalidate">

      <cfheader name="pragma" value="no-cache">

      <cfheader name="expires" value="#getHttpTimeString(now())#">

      <cfinclude template="_functions.cfml">

      <cfinclude template="_form_functions.cfml">

      <cfinclude template="/universal/dps/GenerateDPSEmail.cfml">

      <cfinvoke component="universal.security.security" method="secureRedirect" />

      <cfif Not IsDefined("session.datasource")>

        <cfinvoke component="universal.environment" method="GetDatasource" returnvariable="session.datasource" />          

      </cfif>

      <cfif Not IsDefined("application.ReviewStruct")>

        <cfinvoke component="cfc._data_reader" method="PopulateReviewStruct" returnvariable="application.ReviewStruct" />

      </cfif>

      <cfif Not IsDefined("session.validate")>

        <cfset session.validate =  createObject( "component", "universal.validate" )>

      </cfif>

     <cfif Not IsDefined("session.sched")>

        <cfset session.sched = createObject("component", "universal.inspection-scheduling._imm_sched")>  

      </cfif>

      <cfif Not IsDefined("session.is_internal_user") and IsDefined("session.mode" )>

        <cfset session.is_internal_user = ( session.mode eq "i" )>

      </cfif>

      <cfif Not IsDefined("session.display")>

        <cfset session.display = createObject( "component", "cfc._display" )>

      </cfif>

      

      <cfif Not IsDefined("session.dataReader")>

        <cfset session.dataReader = createObject( "component", "cfc._data_reader" )>

      </cfif>

      <cfif Not IsDefined("session.dataWriter") or true>

        <cfset session.dataWriter = createObject( "component", "cfc._data_writer" )>

      </cfif>

      <cfif Not IsDefined("session.planningReader")>

        <cfset session.planningReader = createObject( "component", "cfc._planning_reader" )>

      </cfif>

      <cfif Not IsDefined("session.planningWriter")>

        <cfset session.planningWriter = createObject( "component", "cfc._planning_writer" )>

      </cfif>

      <cfif Not IsDefined("session.access")>

        <cfset session.access = createObject( "component", "cfc._access_validator" )>

      </cfif>

      <cfif Not IsDefined("session.ExtData")>

        <cfset session.ExtData = createObject("component", "universal.dps._external_data")>  

      </cfif>

    <cfif Not IsDefined("session.inspectionQuery")>

        <cfinvoke component="#session.ExtData#" method="GetInspectionQuery" returnvariable="session.inspectionQuery" />

      </cfif>

      <cfif Not IsDefined("application.inspections_requiring_service_points" )>

        <cfinvoke component="#session.ExtData#" method="GetServicePointInspections" returnvariable="application.inspections_requiring_service_points" />

      </cfif>

      <cfif Not IsDefined("session.inspection_results")>

        <cfset session.inspection_results = StructNew()>

      </cfif>

    

      <cfif Not IsDefined("session.ProjectHubUserType") and IsDefined("session.mode")>

        <cfset session.ProjectHubUserType = MapUserType( session.mode )>

      </cfif>

      <cfif Not IsDefined("session.ProjectListQuery") and IsDefined("session.mode") and session.mode neq "i"  and IsDefined("session.master_login_list")>

        <cfinvoke component="#session.ExtData#" method="GetProjectsForCompany" companyList="#session.master_login_list#" returnvariable="session.ProjectListQuery" />

      </cfif>

      <cfif Not IsDefined("application.status_lookup" )>

        <cfinvoke component="#session.ExtData#" method="GetInspectionStatusStruct" returnvariable="application.status_lookup" />

      </cfif>

      <cfif Not IsDefined("session.feature_toggle_na_has_developer_contact") and IsDefined("session.environment")>

        <cfif session.environment.level eq "dev">

          <cfset session.feature_toggle_na_has_developer_contact = true>

        <cfelse>

          <cfset session.feature_toggle_na_has_developer_contact = false>

        </cfif>

      </cfif>

      <cfset session.feature_toggle_na_has_developer_contact = false>

      <cfset session.feature_toggle_developer_from_list = true>

      <cfinvoke component="#session.DataReader#" method="GetDefaultDate" returnvariable="default_date" />

      <cfsavecontent variable="complete_tab">

      <img src="/universal/icons/check.gif" alt="Complete" />

      </cfsavecontent>

      <cfset at_risk_ht = 400>

      <cfset at_risk_wd = 800>

      <cfset at_risk_cancel_title ="Project Status-May be Cancelled">

      <cfset at_risk_expire_title ="Project Status-Expiring">

    

      <cfset morning_label = "07:00 am-11:30 am">

      <cfset afternoon_label = "12:00 pm-4:00 pm">

      <cfset all_day_label = "07:00 am-4:00 pm">

      <cfSET insp_phone = "">

      <cfset poc_request = "Point of connection">

      <cfset record_drawing_request = "Record drawing">

    

      <cfset password_language = "Passwords must be at least 10 characters, include at least one number, a lowercase letter, an uppercase letter, and a special character.">

      <CFIF ( NOT IsDefined("session.IsLoggedIn") or

              NOT IsDefined("session.mode") or

              NOT IsDefined("session.login_id") )   AND

              FindNoCase("contact_administrator.cfml", CGI.SCRIPT_NAME) EQ 0 and

              FindNoCase("popup_terms.cfml", CGI.SCRIPT_NAME) EQ 0 and

              FindNoCase("login_terms.cfml", CGI.SCRIPT_NAME) EQ 0 and

          FindNoCase("accept.cfml", CGI.SCRIPT_NAME) EQ 0 and

          FindNoCase("account_locked.cfml", CGI.SCRIPT_NAME) EQ 0 and

          FindNoCase("_login_form.cfml", CGI.SCRIPT_NAME) EQ 0 and

              FindNoCase("login_as.cfml", CGI.SCRIPT_NAME) EQ 0 and

              FindNoCase("forgot_password.cfml", CGI.SCRIPT_NAME) EQ 0 and

          FindNoCase("index.cfml", CGI.SCRIPT_NAME) EQ 0 and

  FindNoCase("index-alt.cfml", CGI.SCRIPT_NAME) EQ 0 and

          FindNoCase("expired.cfml", CGI.SCRIPT_NAME) EQ 0>

            <CFLOCATION URL="expired.cfml" addtoken="no" >

      </CFIF>

      <cfif FindNoCase("login.cfml", CGI.SCRIPT_NAME) EQ 0 and

            FindNoCase("contact_administrator.cfml", CGI.SCRIPT_NAME) EQ 0 and

            FindNoCase("popup_terms.cfml", CGI.SCRIPT_NAME) EQ 0 and

            FindNoCase("login_terms.cfml", CGI.SCRIPT_NAME) EQ 0 and

        FindNoCase("accept.cfml", CGI.SCRIPT_NAME) EQ 0 and

            FindNoCase("account_locked.cfml", CGI.SCRIPT_NAME) EQ 0 and

        FindNoCase("_login_form", CGI.SCRIPT_NAME) EQ 0 and

            FindNoCase("login_as.cfml", CGI.SCRIPT_NAME) EQ 0 and

    FindNoCase("forgot_password.cfml", CGI.SCRIPT_NAME) EQ 0 and

        FindNoCase("index.cfml", CGI.SCRIPT_NAME) EQ 0 and

            IsDefined("session.IsLoggedIn") and

IsDefined("session.mode") and

session.mode neq "i" and

( Not IsDefined( "session.terms_accepted" ) or session.terms_accepted eq false )>

              <cflocation url="#application.link_path#/login_terms.cfml" addtoken="no">

      </cfif>

      <cfset doing_zyx = true>

      <cfreturn>

    </cffunction>

    <cffunction name="onRequest">

      <cfargument name="template" type="string" required="true" />

      <cfinclude template="#arguments.template#" />

    </cffunction>

  

    <cffunction name="onSessionEnd">

        <cfargument name = "SessionScope" required="true">

        <cfargument name = "AppScope" required="true">

        <cfset StructClear(arguments.SessionScope)>

    </cffunction>

    <cffunction name="setPathing" output="no" returntype="void">

  <cfif findnocase( 'mojave', server_name ) gt 0>

        <cfset application.link_path = replace( getdirectoryfrompath(getbasetemplatepath()), "/xyzwebdev", "" )>

        <cfset application.link_path = mid(application.link_path, 1, (len(application.link_path) -1 ))>

        <cfset application.etc_path = replace( application.link_path, "/engineering-resources/dps", "" )>

      <cfelse>

        <cfset application.link_path = "/engineering-resources/dps">

        <cfset application.etc_path = "">

      </cfif>

      <cfreturn>

    </cffunction>

</cfcomponent>

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
Community Beginner ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

Just found 2 other apps having the same symptoms.

They are using "<Cffile action=upload" as well not the same file type being uploaded all three are uploading different types .pdf .dwf .dwfx .png.

Just thought I would add that in if it helps shed any light.

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 ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

Try adding

<cfset this.applicationName = "DPS_20190102" />

AFTER

<cfset this.name = "DPS_20190102" />

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
Community Expert ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

LATEST

kevinr1985  wrote

Just found 2 other apps having the same symptoms.

What do you define as an app in this context? A bunch of code sharing the same Application.cfc file? Do the 2 apps run on the same ColdFusion instance?

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
Community Expert ,
May 09, 2019 May 09, 2019

Copy link to clipboard

Copied

kevinr1985  wrote

    <cfset this.name = "DPS_20190102" />

   

Is the value of this.name unique for every Application.cfc? It should be.

<cfset this.setClientCookies = false />

You make extensive use of session variables. I therefore expected

   <cfset this.setClientCookies=true />

<cfset this.applicationTimeout = createTimeSpan( 0, 1, 0, 0 ) />

...

<cfset this.sessionTimeout = createTimeSpan( 0, 1, 0, 0 ) />

An application owns the sessions within it. I think it's impractical for application and session to have the same timeout, namely 1 hour. After sessions end, the Application needs time to clear up. I would use something like

<cfset this.applicationTimeout = createTimeSpan( 0, 12, 0, 0 ) />

<cfset this.sessionTimeout = createTimeSpan( 0, 1, 0, 0 ) />

<cfreturn />

These tags are ambiguous, as the functions have no returntype attributes. So delete them.

However, if you insist on using cfreturn - which may be relevant particularly for onApplicationStart and onRequestStart - then add the returntype. Something like this:

<cffunction name="onApplicationStart" returntype="boolean">

...

<cfreturn true>

</cffunction>

<cffunction name="onRequestStart" returntype="boolean">

...

<cfreturn true>

</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