Skip to main content
Inspiring
March 26, 2018
Answered

An established connection was aborted by the software in your host machine

  • March 26, 2018
  • 3 replies
  • 24646 views

Since moving to CF2016 I've been seeing quite a lot of the error below in the exception log file. I did some research and can't quite figure out what is going on and if this is indeed having an impact on the end user. I've tested the download link on http://www.hiddentoolbox.com and it appears to work fine

"Error","ajp-nio-8016-exec-6","03/26/18","11:55:46","myapp","The cause of this output exception was that: org.apache.catalina.connector.ClientAbortException: java.io.IOException: An established connection was aborted by the software in your host machine. The specific sequence of files included or processed is: C:\ACS\hiddentoolbox\downloadfile.cfm, line: 15 "

coldfusion.tagext.OutputException: The cause of this output exception was that: org.apache.catalina.connector.ClientAbortException: java.io.IOException: An established connection was aborted by the software in your host machine.

I was wondering if this is as simple as people closing their browser before the download is completed, although I could not replicate myself by starting and closing a browser before it had completed.

Could anybody help throw some light on it?

Thanks

Mark

This topic has been closed for replies.
Correct answer ACS LLC

It does indeed work without the CFABORT and plain text, giving this (Will change to this as the right answer)

 

<cftry>
<cfcontent type="application/unknown" file="#downloadlocation#\toolbox.exe" />
<cfcatch>
</cfcatch>
</cftry>

 

3 replies

Community Expert
January 23, 2020

I'd recommend that you remove the CFABORT and the plain text output in your CFCATCH - or at least try that and see if it's happening. I can easily see that breaking some clients downloading your files.

 

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC
ACS LLCAuthorCorrect answer
Inspiring
January 23, 2020

It does indeed work without the CFABORT and plain text, giving this (Will change to this as the right answer)

 

<cftry>
<cfcontent type="application/unknown" file="#downloadlocation#\toolbox.exe" />
<cfcatch>
</cfcatch>
</cftry>

 

BKBK
Community Expert
January 6, 2020

We might be able to throw some light on the matter if shared with us the code that caused the error. Namely:

C:\ACS\hiddentoolbox\downloadfile.cfm, line: 15 

Was it the cfcontent line you posted later?

 

ACS LLCAuthor
Inspiring
January 6, 2020

Here's the code

 

<CFIF #ISDefined('url.aff')# AND #ISDefined('url.sub1')#>
<CFCOOKIE NAME="aff" VALUE="#val(URL.aff)#" expires="never">
<CFCOOKIE NAME="sub1" VALUE="#left(URL.sub1,50)#" expires="never">
</CFIF>

<cfparam name="cookie.aff" default="0">
<cfparam name="cookie.sub1" default="0">


<CFSET downloadfilename = "HiddenToolboxInstaller" & "_a" & "#cookie.aff#" & "_r" & "#left(urldecode(cookie.sub1),50)#">

<cffile action = "append" file = "c:\acs\hiddentoolbox\control\logs\downloadfile_cfm.txt" attributes = "normal" output = "AFF:#cookie.aff# - SUB1:#cookie.sub1# - #now()# - #remote_addr# - #CGI.HTTP_USER_AGENT#">

<cfheader name="Content-Disposition" value="attachment; filename=#downloadfilename#.exe" />
<cfcontent type="application/x-msdownload" file="#downloadlocation#\toolbox.exe" />

 

 

James Moberg
Inspiring
January 6, 2020

I recommend on using a date.  Many browsers and security extensions convert "never" cookies to session-based.
<CFCOOKIE NAME="aff" VALUE="#val(URL.aff)#" expires="720">

Add FileExists() to ensure that there's a file.  If not, return a legitimate 404 error (or other if prerequisite data is missing.)  If a Form POST is required, add that pre-condition too.

Regarding the mime-type, use "application/unknown" as it will force a download.
<cfcontent type="application/unknown" file="#downloadlocation#\toolbox.exe" />

For content-disposition, add double quotes around the filename in case the value contains a space.
<cfheader name="Content-Disposition" value="attachment; filename=""#downloadfilename#.exe""" />

 

Regarding the EXE extenstion, this could be problematic.  Some browsers, plugins, anti-malware/virus software and proxies may automatically block it.  If you are serving up EXE files (not recommended), ensure that IIS is configured to allow it as I believe it's disabled by default.  (We don't allow files with EXE extensions to be uploaded or downloaded.)

Here's where you'd add try/catch to prevent it from being added to the cf error log:

<cftry>
    <cfcontent type="application/unknown" file="#downloadlocation#\toolbox.exe" />

    <cfcatch><!--- log, etc --->Aborted<cfabort></cfcatch>

</cftry>

ACS LLCAuthor
Inspiring
September 20, 2018

I took another look at this and it appears to be the use of CFCONTENT.

I have a simple page with:

<cfheader name="Content-Disposition" value="attachment; filename=#downloadfilename#.exe" />

<cfcontent type="application/x-msdownload" file="#downloadlocation#\toolbox.exe" />

The code does function, the EXE is triggered for download, and yet I'm getting all these errors in the log file

Does anybody have any idea why?

WolfShade
Brainiac
September 20, 2018

We have been seeing this, too.  A lot.  I, also, have not been able to reconcile what is happening.  We have keyword searchable PDFs, and it is always a user clicking on a link to view a PDF that is triggering it.

V/r,

^ _ ^

ACS LLCAuthor
Inspiring
September 20, 2018

It certainly was not there on CF8. No idea at all what's causing it and I can't find any other posts either.