3 Replies Latest reply on Oct 20, 2015 10:55 AM by Steve Sommers

    Variables scope variable suddenly not working

    WolfShade Level 4

      Hello, all,

       

      Can anyone suggest reasons as to why, after 8 months of working fine, a variable set specifically in the VARIABLES scope would suddenly stop working?

       

      In my Application.cfc file, within the "onRequestStart" function, I have the following line:

       

      <cfset variables.praglink = "//" & cgi.server_name />
      
      
      

       

      It's been working since March of this year.  This morning, I open a page in the browser (my DEV environment uses one physical machine for CF, one physical machine for DB, and my development system), and get the following error message:

       

      Element PRAGLINK is undefined in VARIABLES
      The error occurred in {dev path}/wwwroot/public/header.cfm: line 20
      
      
      

       

      header.cfm line 20 is:

       

      <link rel="stylesheet" type="text/css" href="<cfoutput>#variables.praglink#</cfoutput>/style/public.css" />
      
      
      

       

      It was working fine, Friday; today, not at all.

       

      All the other variables set in the variable scope are present.  CFDUMP shows the rest are working.  Just not PRAGLINK.

       

      I've reboot the server, restarted the CF service, no change.

       

      Thoughts?

       

      V/r,

       

      ^_^

        • 1. Re: Variables scope variable suddenly not working
          BKBK Adobe Community Professional & MVP

          Even if it worled, you would have been taking chances. The scope to use in onRequestStart is request.praglink. What's in a name? Then again, I am sure you know that already.

          • 2. Re: Variables scope variable suddenly not working
            WolfShade Level 4

            Hi, BKBK,

             

            (shrug) I was in a hurry when I wrote it; I can change it. 

             

            And I figured out what was wrong, and it really annoys me that CF couldn't point-blank TELL me what the issue was.

             

            As it turns out, there is a query that runs on every page load.  The database backup folders were taking up all the disk space on the database.  So, the DSN was breaking because of "ORA-00257; archiver error.  Connect internal only, until freed."  Instead of the error page being displayed, which also emails me the error details, it just decided to not set that variable (just that ONE variable) and break my stuff.

             

            I manually set the variable in my header.cfm document.  That's when I finally got my error message with details emailed to me.

             

            WTF???  Nothing in the logs to indicate why the error template was not triggered.

             

            V/r,

             

            ^_^

            • 3. Re: Variables scope variable suddenly not working
              Steve Sommers Level 4

              Request is a better scope to use but this may be a secondary error you are seeing here. If you have code executing before the cfset that throws an exception, and you have an error trap that uses a common output template, this may be a case where variables.praglink really is not set (I know, I have had similar issue like this).