Skip to main content
WolfShade
Legend
July 1, 2019
Answered

AJaX submit giving 404 after working for years [was: It worked.. until it didn't.]

  • July 1, 2019
  • 3 replies
  • 676 views

Hello, all,

I've got a CFC that accepts an AJaX submitted form that has been converted to JSON, converts it back into a form, does form validation, and then puts everything into an Excel spreadsheet.  Been working flawlessly for years.

I'm in the middle of changing the CAPTCHA, and suddenly I'm getting a 404 error in response.

Diagnostics: Failed to add HTML header. ColdFusion was unable to add the header 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 error occurred on line 352.

Line 352 of the CFC is:

returnSOrigin &= "<p style='margin:0 20px; text-indent:-20px;'>POE for Shipment Origin for Cargo #val(sdLoop)# does not exist in form.</p>" & application.crlf;

There is no CFFLUSH being used _anywhere_ in this process.  It was working on Friday, now this.  Any thoughts?

V/r,

^ _ ^

    This topic has been closed for replies.
    Correct answer WolfShade

    Nevermind.  It's apparently fixed itself.  And nothing was changed.  No config/settings.  No code.  No reboots of servers (workstations are rebooted automatically every night.)  It just.. started working, again.

    This is not an isolated case.  This has been happening for at least the 7+ years that I've been here.  Something works flawlessly; then it stops working for a day or two; then it miraculously is fixed.

    I've given up trying to understand it.  I just accept it as a part of working, here.

    V/r,

    ^ _ ^

    3 replies

    WolfShade
    WolfShadeAuthorCorrect answer
    Legend
    July 2, 2019

    Nevermind.  It's apparently fixed itself.  And nothing was changed.  No config/settings.  No code.  No reboots of servers (workstations are rebooted automatically every night.)  It just.. started working, again.

    This is not an isolated case.  This has been happening for at least the 7+ years that I've been here.  Something works flawlessly; then it stops working for a day or two; then it miraculously is fixed.

    I've given up trying to understand it.  I just accept it as a part of working, here.

    V/r,

    ^ _ ^

    Charlie Arehart
    Community Expert
    Community Expert
    July 2, 2019

    I doubt the problem has anything to do with the line indicated. That's simply "the straw that broke the camel's back". (Are we allowed to use that phrase anymore? Or do I need to fear triggering someone about the poor camel?)

    Instead, and assuming that the output buffer size has not been decreased (see James' comment), I'd question what has changed about the nature and VOLUME of the generated output on the page. You say you were only changing the captcha. If you revert to the original, does the problem go away? What is different about the new captcha?

    Have you compared the page source (in your browser) between the old and new code versions, to see what differs? Note there are underlying Java objects in CF (and Tomcat) that can track the actual output buffer, while it's being built in CFML. Finally, if you have FusionReactor, note that it has a nifty "Request content capture" feature, that can be turned on to track all the request and/or response content of every request. it can be dangerous if left on but for a quick need like this, it can be gold.

    /Charlie (troubleshooter, carehart. org)
    Charlie Arehart
    Community Expert
    Community Expert
    July 2, 2019

    And one more thing: make sure it's not perhaps caused by some change in the application.cfc or cfm under whose control your page runs.

    /Charlie (troubleshooter, carehart. org)
    James Moberg
    Inspiring
    July 2, 2019

    Are you generating any white space that may be in the output buffer that is forcing ColdFusion to start flushing?  Which version (& patch level) of ColdFusion are you using?  What is the size of your "Maximum Output Buffer size" ? Which web server are you using?

    WolfShade
    WolfShadeAuthor
    Legend
    July 2, 2019

    Hi, Jamo,

    No change has been made to what is returned after the form submit, so no whitespace has been added.  Matter of fact, nothing has been changed in the CFC that the AJaX submits to, other than checking the session scope for the value inserted into the image to make sure that they match what the user entered.  It's still using the same response (either it doesn't match, or nothing at all if it does match.)

    As far as CF version, we are on CF11 update 19.  Maximum output buffer size I can find out after our SA gets in, probably about an hour from now.  We are using Apache 2.2x.

    V/r,

    ^ _ ^