tracker issue : CF-4199485

select a category, or use search below
(searches all categories and all time range)
Title:

ColdFusion is not flushing automatically

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Maulik Naik / Maulik Naik ()

Created: 08/15/2017

Components: CFForm

Versions: 11.0

Failure Type: Others

Found In Build/Fixed In Build: NA /

Priority/Frequency: Normal /

Locale/System: / Windows 7

Vote Count: 0

Problem Description:

Code generates error as below. 

Unable to add text to HTML HEAD tag. 
 
ColdFusion was unable to add the text you specified to the output stream. This is probably because you have already used a CFFLUSH tag in your template or buffered output is turned off.  


The CF Admin > Settings > Maximum Output Buffer size is set as 1024 KB. Though, it says that when the limit is reached, it will automatically flush the output steam. If that was the case, then we should not see the related error. 

PLEASE NOTE: There is no CFFLUSH in the code, so error message is misleading to developers. 



Steps to Reproduce:

The error log file shows error at <cfselect tag within <cfform tag. By view source, it shows the last output content is the <form tag output by the <cfform tag. Even though there is HTML code right after that, it does not show in the view source.  But still, the last output content is the <form tag, and always the error log says issue with <cfselect tag irrespective of where that tag is.

Actual Result:

ERROR as described below.

Expected Result:

Not ERROR

Any Workarounds:

Re-write the app without using <cfform and related UI tags.

Attachments:

Comments:

Please share the repro code for this. Also le me know the Update level of CF11 on which you are facing the issue.
Comment by Nitin K.
411 | August 28, 2017 08:26:42 AM GMT
ColdFusion 11 Update 12 Below is the test code: This is a test page to test OutputBuffer <cfoutput> <cfform action="test"> Some text before the cfselect And some more <cfselect name = "test"> <option value = "">Select All</option> <cfloop index = "LoopCount" from = "1" to = "500000"> <option value = "This is some long text looped over multiple lines #LoopCount#">This is some long text looped over multiple lines #LoopCount#</option> </cfloop> </cfselect> </cfform> </cfoutput> The output HTML shows as below: This is a test page to test OutputBuffer <form name="CFForm_1" id="CFForm_1" action="test" method="post" onsubmit="return _CF_checkCFForm_1(this)"> As you can notice that there is no HTML output after the <form tag - even if there is a text before the <cfselect tag, but still it does not output. The CF Admin > Settings > Maximum Output Buffer size is set as 1024 KB. Though, it says that when the limit is reached, it will automatically flush the output steam.
Comment by Maulik N.
412 | August 30, 2017 05:42:51 PM GMT
Hi Maulik, With the code you have provided I see Java heap error rather than any error related to cfflush. "Error","http-bio-8502-exec-6","09/15/17","11:30:46",,"*Java heap space* The specific sequence of files included or processed is: C:\ColdFusion11\cfusion\wwwroot\test1.cfm, line: 8 "   In the code if you change the loop count to 400000. The code works as expected (keeping Maxm O/P buffer size 1024 ) . Attaching a screenshot   Just wanted to check if this is a valid usecase to have 500000 select dropdowns ? Can you update CF11 to update 13 and revert me by attaching latest log file (after you run the code).   Thanks
Comment by Nitin K.
413 | September 15, 2017 06:16:00 AM GMT
For the Java heap error, you may just need to increase your JVM size and run again to see the HTML output. Also, I understand that if the size of output is reduced below 1 MB then it works. My purpose to report the issue was that if the the output size is more than 1024 and using <cfform then it doesn't flush output buffer if it reaches 1024 . The sample code to reproduce the issue was just for the purpose of showing that if the content output within <cfform is more than 1024 then it doesn't flush output steam.
Comment by Maulik N.
414 | September 15, 2017 06:03:35 PM GMT
I tried to tweak the Maximum Buffer Size (as suggested in your previous comment) but couldn't reproduce the issue.   Attaching another screenshot ( which shows 500000 dropdown items of cfselect) .Not sure if this is valid scenario to have this many drop down items   Sharing your exception log on running the above code will help . Can you update CF11 to update 13 and revert with your findings.
Comment by Nitin K.
415 | September 29, 2017 12:51:51 PM GMT
Hi Maulik, Any update on this ? Thanks, Nitin
Comment by Nitin K.
416 | October 30, 2017 06:50:07 AM GMT