BKBK
Community Expert
BKBK
Community Expert
Activity
‎May 01, 2025
05:28 AM
Thanks for the update and for sharing the solution.
... View more
‎May 01, 2025
01:19 AM
Hi @presuhn1111 ,
Here is a suggestion for a test. It is to check whether file-access-permissions are indeed the cause of the issue.
Store a test file, test.pdf, within the current directory.
Run the following code in a CFM file.
Verify whether the file is copied. <cftry>
<cfset source = expandPath('.') & '\' & 'test.pdf'>
<cfset destination = "\\srv-cfdev\stcnet1\branchcontrol\files\testCopy.pdf">
<cfset filecopy(source, destination)>
Does destination file exist? Answer: <cfoutput>#fileExists(destination)#</cfoutput>
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
​
... View more
‎May 01, 2025
12:56 AM
Hi @Byron Byron_756 , Thanks for the comprehensive update, and for sharing your solution.
... View more
‎Apr 30, 2025
09:52 AM
I think you're right. Until now, I was going by your message 'file upload error "Error occurred while copying the file from source"'. After your last post I took another look at the attachment in your initial post.
There the error is clearly "Access Denied". You could therefore conclude that the PDF is uploaded, but ColdFusion's uploader does not have (network) access to the file.
First guess: check to make sure ColdFusion has suffcient Active Directory permissions.
... View more
‎Apr 30, 2025
09:36 AM
That might explain the difference:. Could it be that the path is defined in Production, but not in Development?
... View more
‎Apr 30, 2025
09:04 AM
To be clear, is "\\srv-cfdev\stcnet1\branchcontrol\files" a path on file system (for example, by means of a mapping srv-cfdev), a UNC network path or a path in the Virtual File System (ram://)?
... View more
‎Apr 30, 2025
08:05 AM
Are you using ColdFusion's Virtual File System(VFS)?
... View more
‎Apr 30, 2025
07:49 AM
The cause of the problem is likely to be the attribute:
destination="#application.files#"
The destination attribute must be a path to a directory. However, the value is currently a path to a file.
... View more
‎Apr 30, 2025
06:06 AM
Hi @Byron Byron_756 ,
There appears to be an obvious mistake. You are apparently on ColdFusion 2023. However, the Add-On download you used is for ColdFusion 2021.
To get the correct Add-On installer for ColdFusion 2023:
Go to the ColdFusion downloads page.
From the drop-down list, select the option "Adobe ColdFusion (2023 release)"
Click to open the section "Download Adobe ColdFusion (2023 release) Developer Tools".
There you can download the Windows 64-bit Add-on Services Standalone Installer
... View more
‎Apr 29, 2025
11:03 AM
Hi @Dave Watts ,
You've made a big point there. Great advice, too. If the developer can find dedicated, specialist Websocket software that integrates with ColdFusion, then that will be the preferable solution. In fact Separation-of-Concerns and GRASP (Information Expert, Modularity, High-Cohesion) suggest that that is best-practice.
... View more
‎Apr 29, 2025
10:52 AM
@mattf48248714 's setup used the proxy, which would ignore those settings. CF admin hides those settings when you select "Use Proxy".
I spent sometime with Charlie on looking at my specific issue which is similar to Matt's. I'm believing more and more that these "ghosts" connections are the culprit. In my case, a chat application, makes it so that each client must be connected to the socket at all times to receive messages. I think each time a client somehow disconnects, and reconnect, it opens a "new" connection and the old one is never cleaned up properly. I now have my application pool recycling at midnight (thanks @Charlie Arehart !) and that has helped me so far. It's been a few days since I've had to flat out restart the cf app service. I think now if i can figure out how to remove these "ghost" connections, it would be far more stable.
By @Michael_Evolve
My suggestion amounts to this:
whatever websocket server you use - whether ColdFusion, Proxy or any other - you should experiment by changing the socketTimeout and the Frame-size when you suspect there are problems with connections.
... View more
‎Apr 29, 2025
08:06 AM
Hi @Byron Byron_756 and @Vikram_Kumar_M , thanks for the update.
When you find the solution, could you please share it? Not just to satisfy my curiosity; I am sure it will benefit many fellow developers.
... View more
‎Apr 29, 2025
07:58 AM
Thanks for the update and for sharing the solution.
... View more
‎Apr 29, 2025
02:33 AM
@Michael_Evolve ,
You say, "BKBK, I don't believe the suggestions for the theory of resource exhaustions are applicable to this case", followed later by "I'm believing more and more that these "ghosts" connections are the culprit." That leads me to think that there are a few misunderstandings to clarify.
First of all, your two statements contradict each other. In my suggestion, a "ghost" connection may be one of the results of resource exhaustion.
Anyway, to be clear, my explanation is about "resource exhausion" (singular). And I didn't suggest it as a theory. More as a hypothesis, backed up by something practical for you to test.
That said, I am glad to hear that you have made some headway towards a solution.
... View more
‎Apr 29, 2025
01:58 AM
Hi @Byron Byron_756 , did you try clearing Felix-cache, as suggested by Charlie and Vikram_Kumar_M?
This cache is the directory {COLDFUSION_INSTANCE_HOME}\bin\felix-cache.
The idea is to delete everything from the directory, in the hope that ColdFusion will do a reset when you restart.
As for the ColdFusion_2023_Addon_WWEJ_win64.exe installation, try running it with your usual user login, not "as administrator".
... View more
‎Apr 28, 2025
10:30 AM
@mattf48248714 , your description of the issue is exemplary. Even before I finished reading it for the first time, I had an idea of what could be the problem. I immediately thought of resource exhaustion. But I needed to look further into it.
First of all, the IIS settings in workers.properties (worker.wss.connection_pool_size, worker.wss.connection_pool_timeout, worker.wss.max_reuse_connections) could matter. As you will see in a moment, one of your settings is problematic. But it seems like something else is causing the problem you're seeing (that is, clients connecting instantly but failing to subscribe later).
The IIS settings control the AJP connector between IIS and ColdFusion. They determine, for example, how many AJP connections can be open and reused. So, for the overall traffic and general health of your server, you will need to use the optimal IIS settings.
Suggestions:
A connection_pool_size of 20 seems far too low. Set it to the same value as max_reuse_connections, namely, 5000.
Make sure the settings in workers.propoerties match the corresponding settings in server.xml. Therefore, worker.wss.max_reuse_connections=5000 / maxthreads="5000"; worker.wss.connection_pool_timeout=60 / connectionTimeout="60000"
See https://www.petefreitag.com/blog/tuning-tomcat-iis-connectors/
Nevertheless, I now think that resource exhaustion is ithe main cause of the issue. 5000 - 10 000, that's a lot of concurrent connections. That is likely to exhaust resources as follows:
If clients connect or disconnect frequently or are idle for too long, the websocket server may not properly clean up old, defunct subscriptions or sockets. If so, then, sooner or later, websocket's channel list will get polluted with these invalid or "ghost" subscribers.
ColdFusion's websocket implementation lacks explicit settings with which to fine-tune the configuration of sockets. Think of settings such as heartbeat or keepalive, Their absence can have consequences: "zombie" connections. On the client side, browsers, firewalls and proxies can silently drop TCP connections if these idle too long. ColdFusion wouldn't always notice that. It means your websocket channel may think clients are still subscribed, but they aren't really reachable anymore. This was reported on ColdFusion 2016 in 2018. Adobe did acknowledge it is a bug, but its status is still "To Fix". See https://tracker.adobe.com/#/view/CF-4203142
Suggestions:
Reduce socketTimeout: Since your system is not hitting any (memory or CPU) resource limits, chances are that there are a lot of idle connections. Therefore, you might want to decrease the socketTimeout, so idle connections are terminated more quickly. You can do so by editing the file /lib/neo-websocket.xml. Use a value much lower than the default 300, say, 120.
Experiment with an increased framesize and with a decreased framesize: FrameSize controls the maximum size of each websocket frame that can be sent or received over a websocket connection. Each frame represents a chunk of data transmitted over the connection. The default value in ColdFusion's websocket is 1024 KB. It is the setting Max Data Size on the page Server Settings > Websockets in the ColdFusion Administrator. Equivalently, it is the element maxFrameSize in /lib/neo-websocket.xml. Larger frame sizes allow the websocket to handle larger payloads in one go. If your application has large websocket messages, then the connection issue you're seeing might be due to fragmentation and reassembly of too many messages that exceed the framesize. If so, increasing the framesize might help. Granted, increasing the frameSize may lead to higher memory usage, as large frames need to be buffered, transmitted, and processed. However, as you have said, you aren't hitting any memory limits. So it is worth experimenting by increasing the framesize. Say, to 4096 KB. On the other hand, since you're experiencing connection failures, decreasing the framesize can help. That is because smaller frames reduce the chance of overloading the traffic with too much data at once. In so doing, smaller frames are more efficient, especially when dealing with a large number of concurrent users, as in your situation. The one big assumption is that most of the messages are small. If indeed so, then experiment by decreasing the framesize to, say, 256 KB.
... View more
‎Apr 27, 2025
03:24 AM
See https://tracker.adobe.com/#/view/CF-4226393
... View more
‎Apr 26, 2025
08:05 AM
No worries.
... View more
‎Apr 26, 2025
03:23 AM
Thanks for the update. Very interesting test result indeed!
It confirms my new hypothesis that ColdFusion, in general, and CFCs, in particular, are not necessarily denied access to Tomcat's tmp directory. Rather, it is the call getFileInfo() that is being denied permission.
Has getFileInfo() been denied read/write permissions in the sandbox, perhaps? I think it's a good idea to ask the server administrator.
Out of curiosity, did you, for the sake of rigour, use this code:
fileopen(form['files[]'])
Should the cflock encompass more of the code, like right from the <form>?
By @paul_8809
Good question. As answer, here is a suggestion:
upload.cfm
<cflock name = "uploadLock123" type = "exclusive" timeout = "60" throwOnTimeout = "yes">
<form method="post" name="post-form" enctype="multipart/form-data" action="upload_action.cfm">
<input type="File" name="test">
<input type="Submit">
</form>
</cflock>
upload_action.cfm
<cflock name = "uploadLock123" type = "readonly" timeout = "60" throwOnTimeout = "yes">
<cfset fileInfo = GetFileInfo(form.test) />
<cfdump var="#fileInfo#">
</cflock>
... View more
‎Apr 25, 2025
05:17 PM
Hi @paul_8809 , That's an interesting question. ColdFusion's designers had actually anticipated it, and provided an answer: the cffile struct or, alternatively, the result struct.
Take another look at your last printscreen. You will see that the struct contains keys such as filesize, clientFileExt, contentType and more besides.
However, the question remains why the call getFileInfo(filepath_in_Tomcat_tmp_directory) results in ("access denied", "java.io.FilePermission"). Yes, access is denied and, yes, it's a permissions issue. But from what you've shown us so far, the permissions that have been denied have been "read" or "write".
That gets me wondering now whether this is really about Tomcat's security against ColdFusion. What if it instead has to do with concurrency. By this I mean, for example, a situation whereby one thread tries to read a file while a second thread is still busy writing to it. What if "Access Denied" is just a means of preventing such a race condition?
One way to test this hypotheses is by using a lock. Try the following in your test, and see what happens:
upload_action.cfm
<cflock name = "uploadLock" type = "readonly" timeout = "60" throwOnTimeout = "yes">
<cfset fileInfo = GetFileInfo(form.test) />
<cfdump var="#fileInfo#">
</cflock>
... View more
‎Apr 25, 2025
02:31 AM
Alternatively, if you insist on using the "result" attribute:
<cffile action="upload" fileField="files[]" destination="#CFDirForUploadedFiles#" nameConflict="makeUnique" result="upload">
<cfset var filepath = CFDirForUploadedFiles & "/" & upload.clientfile>
<!--- Debugging code: Dump cffile to see the properties of the upload --->
<cfdump var="#upload#" label="Properties of the upload">
... View more
‎Apr 25, 2025
01:11 AM
@paul_8809 , you have actually not copy-pasted my code as I suggested. Anyway, you're almost there.
I think you get the error because you introduced the attribute "result". That attribute is mutually exclusive to "cffile".
So delete
result="upload"
... View more
‎Apr 24, 2025
01:33 AM
BKBK, I tried your suggestion and I get the error:
Element CLIENTFILE is undefined in CFFILE.
By @paul_8809
The error suggests that ColdFusion couldn't find the uploaded file. Anyway, this motivated me to create a fuller test=case, based closely on your code.
Here it is. Both the CFM and CFC are assumed to be in the same directory. If they aren't, then use the appropriate relative path for the form's action.
Upload.cfc
<cfcomponent>
<cffunction name="init" access="remote" returnformat="json">
<cfscript>
var options = {
"uploadPath" : "",
"uploadURL" : "",
"maxFileSize" : 1 * 1024 * 1024,
"okExtensions" : "jpg,jpeg,gif,png",
"watermark": {
"enabled" : true,
"watermarkPath" : "watermark/watermark.png",
"watermarkPossX": "right",
"watermarkPossY": "bottom",
"transparency" : 50
},
"thumbnails":
{
"enabled" : false,
"width" : "100",
"height" : "100",
"uploadPath": "",
"uploadURL" : "",
"interpolation" : "highestQuality"
}
}
if (GetHttpRequestData().method == "GET")
{
if (structKeyExists(url,"file") && url.file != "")
return DELETE(options);
}
else if (GetHttpRequestData().method EQ "POST")
{
return POST(options);
}
</cfscript>
</cffunction>
<cffunction name="POST" >
<!--- Other stuff --->
<!--- Define full path to a directory for uploads. Define any, as long as ColdFusion has access to it --->
<cfset CFDirForUploadedFiles = expandpath('.')>
<cftry>
<!--- ColdFusion uploads file to a directory of your choice--->
<!--- Requirement for the upload: the uploading form must have multipart/form-data attribute.
That is, <form enctype="multipart/form-data"> --->
<cffile action = "upload"
fileField = "files[]"
destination="#CFDirForUploadedFiles#"
nameConflict = "overwrite">
<!--- If upload succeeds, ColdFusion will automatically create the 'cffile' structure --->
<cfset filepath = CFDirForUploadedFiles & "/" & cffile.clientfile>
<cfset fileInfo = GetFileInfo(filepath)>
<p>
<!--- Debugging code: Dump cffile to see the properties of the upload --->
<cfdump var="#cffile#" label="Properties of the upload">
<p>
<cfdump var="#fileInfo#" label="FileInfo">
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
<!--- Other stuff --->
</cffunction>
</cfcomponent>
uploadIt.cfm
<form action="Upload.cfc?method=init" method="post" enctype="multipart/form-data">
<input name="files[]" type="file" id="fileupload">
<input type="submit" name="sbmt" value="Submit">
</form>
... View more
‎Apr 23, 2025
02:27 PM
1 Upvote
Send an e-mail to cfinstal[at]adobe.com and request their help.
Please let us know how it goes afterwards.
... View more
‎Apr 23, 2025
02:18 PM
Hi @Scott_Stewart3951 ,
I have voted for the SAML issue to be resolved. However, I do not believe it is related to the STAX warning in coldfusion-out.log.
See my STAX post in this previous thread: https://community.adobe.com/t5/coldfusion-discussions/what-is-unable-to-determine-dialect-of-the-stax-implementation-warning/m-p/14410770
... View more
‎Apr 23, 2025
02:06 PM
As I have explained, upload is NOT the problem. The problem is the CFC's attempt to read a file within Tomcat by means of
<!---
form['files[]'] is the full path of a file within Tomcat.
That is, C:\ColdFusion2023\cfusion\runtime\work\Catalina\localhost\tmp\neotmp14670862617474925576.tmp.
"Access Denied" indicates that Upload.cfc is not allowed to read the file.
--->
<cfset fileInfo = GetFileInfo(form['files[]']) />
In fact, the explanation I've mentioned comes with a fully worked out code example. I wrote the code in such a way as to enable you to copy-paste it in your application. 🙂
... View more
‎Apr 23, 2025
08:56 AM
I think the 2 dashes in
--Dcoldfusion.searchimplicitscopes=true
are just a typing error. I say this because I believe that, with those two dashes instead of one, the Java Virtual Machine would not have allowed ColdFusion to start.
... View more
‎Apr 23, 2025
05:25 AM
Thanks, Charlie. I have looked back following your last post. Only now do I notice your suggestion to use cffile action="upload". My apologies. If I had noticed it earlier I would of course have referred to it.
... View more
‎Apr 23, 2025
12:55 AM
Hi @paul_8809 .
After thinking about this a bit more, I now have second thoughts. Even if either of my two proposed solutions worked, I would no longer recommend them.
"Access Denied" is a serious security message. The fact that access is denied to ColdFusion's own code can mean one of two things. Either this results from a bug, or else the ColdFusion code may not have access to that file in Tomcat.
It is unlikely that this is a bug. I have looked around and cannot find use-cases where ColdFusion code reads a file from within Tomcat. This means there is a good security reason for the "Access Denied".
That being the case, I would strongly dissuade you from using either of the two solutions. In fact, I hereby withdraw them. Sorry.
Nevertheless, I have a third suggestion. Though you're uploading using Javascript, what if the CFC imitates what ColdFusion itself does during an upload? Something like this:
<cffunction name="POST" >
<!--- Other stuff --->
<!--- Define full path to a directory for uploads. Define any dir path, as long as ColdFusion has access to it --->
<cfset var CFDirForUploadedFiles = expandpath('.')>
<cftry>
<!--- ColdFusion uploads file to a directory of your choice--->
<!--- Requirement for the upload: the uploading form must have multipart/form-data attribute. That is, <form enctype="multipart/form-data"> --->
<cffile action = "upload"
fileField = "files[]"
destination="#CFDirForUploadedFiles#"
nameConflict = "overwrite">
<!--- If upload succeeds, ColdFusion will automatically create the 'cffile' structure --->
<cfset var filepath = CFDirForUploadedFiles & "/" & cffile.clientfile>
<cfset var fileInfo = GetFileInfo(filepath)>
<cfdump var="#fileInfo#">
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
<!--- Other stuff --->
</cffunction>
... View more
‎Apr 22, 2025
11:55 PM
Hi @jose_9162 , Thanks for the update. Glad you hear you've resolved the issue.
All is well that ends well.
... View more