Skip navigation
CFGumby
Currently Being Moderated

Getting another 500 null

May 24, 2012 4:12 PM

Hello,

  we are having a weird problem that just popped up.  We are getting a 500 null.  I'm not new to these having been a CF programmer fo 12 years but this one really stumps me.  Here is the basics.

 

Program1 includes Program2

Program2 includes Program3

Program3 includes Program4

Program4 cfexits (exittemplate) back to Program3

Program3 cfexits (exittemplate) back to Program2

Program2 ends and Program1 continues until it hits a cflocation to Program5 which is a landing page.

 

The cflocation does not execute and at that point we get the 500 null.  I've had the programs send e-mails to myself just before the cflocation and at the beginning of Program5 and I get P4's e-mail but not P5's.

 

Now here is something interesting, there is a function in Program4 that gets executed just before the cflocation and if I add a cfflush in it, the cflocation, even though everything I've seen and read is not supposed to work, it does work and we don't get the 500 null.  Also, in Program3 there is a cfsilent.  If I comment it out we don't get the 500 null.

 

Determined to figure this out, I continued to debug and I added cfaborts in several key places.  If I add a cfabort in Program1 anywhere below the cfinclude to Program2 and above the cflocation, I get a 500 null.  Just as an fyi, my cfaborts alway include <cfoutput>xyz</cfoutput> so they are easy to find and remove.  If I add a cfabort prior to the cfinclude to Program2 or anywhere prior to the cfexit in Program3, I see my cfabort.  I think that may be relevant because to me it appears to be a displaying issue of some sort.

 

Other notes, everything seems to have run and updated just fine prior to the 500 null.  The include to Program2 is within a cftransaction but the cflocation is not.  (Removing the cftransaction did not have an effect.)  Currently this happens on two servers, our Dev and Test servers.

 

I'm going to continue debugging since this is an important process to our business.  If anyone has any ideas I'd be happy to hear them.

 

Thanks in advance.

 
Replies
  • Currently Being Moderated
    May 27, 2012 4:11 AM   in reply to CFGumby

    My initial instinct: a page is being opened, or a code procedure is being run, ad infinitum. A common cause of this is a cflocation tag in Application.cfc/Application.cfm.

     
    |
    Mark as:
  • Currently Being Moderated
    May 31, 2012 12:22 PM   in reply to CFGumby

    Cfexit? If you're not in a custom tag (and you don't seem to be), then cfabort will be more appropriate.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2012 5:03 AM   in reply to BKBK

    Cfexit? If you're not in a custom tag (and you don't seem to be), then cfabort will be more appropriate.

     

    It's fine to use <cfexit> in the way the OP describes in a non-custom tag.


    The docs for <cfexit> (http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461 172e0811cbec22c24-7fdd.html) are wrong.  Jamie Krug has annotated them with a correction.

     

    --
    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2012 5:15 AM   in reply to CFGumby

      I don't think that is our case here.  We are careful not to put cflocation's in our Application.cfm.  Since my last post, I've found out that the error occurs in all our environments, even in production it just has not been reported.  My beleif is it has to do with the cfsilent that surrounds the cfinclude and cfexit.  I broke up the cfsilent and it is working fine.  Perhaps the cfsilent didn't terminate correctly (???) and any display to the screen was not possible (unless the cfflush caused it).  I'm not sure but it's a puzzle.

     

     

    I have not seen this specific behaviour, but I have seen <cfsilent> mess with stuff before in very incoherent and illogical ways.  See https://bugbase.adobe.com/index.cfm?event=bug&id=3043734 for an example of this wherein it messes with variable assignments!  Strange but true.

     

    TBH, you've done the same sort of troubleshooting I'd suggest to do already, and having tracked it down to the <cfsilent>, I'd simply use your work around and move on.  I don't think there's going to be much to be had by investing your time getting to the bottom of it.

     

    Can you replicate this in a very scaled down / portable fashion, eg: something you could post as a repro case for us to have a look at?  At the very least having a repro would be handy for demonstrating it to Adobe if it seems a bug needs to be raised with them.  That would probably be time well spent.

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2012 9:40 AM   in reply to CFGumby

    In my opinion, there is neither rhyme nor reason in the code you've posted. I see no motivation whatsoever for the way cfinclude, cfsilent and cfexit have been used.

     

    When you replace each cfinclude with the respective code, you will get the following:

     

    Silent1.cfm

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>

    <head>

        <title>Untitled</title>

    </head>

    <body>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>

    <head>

        <title>Untitled</title>

    </head>

    <body>

    <cfsilent>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>

    <head>

        <title>Untitled</title>

    </head>

    <body>

    <cfexit method="EXITTEMPLATE">

    </body>

    </html>

    <cfexit method="EXITTEMPLATE">

    </cfsilent>

    </body>

    </html>

    </body>

    </html>

    <cflocation url="Silent5.cfm">

     

     

    Silent5.cfm

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>

    <head>

        <title>Untitled</title>

    </head>

    <body>

    It worked!

    </body>

    </html>

     

    I cannot begin to understand what is going on here, let alone what you wish to achieve.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 2, 2012 12:31 AM   in reply to CFGumby

    Fair enough.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points