6 Replies Latest reply on Mar 7, 2007 11:49 AM by Rimshot

    Cookie Error

      Hi all -

      I've been scratching my head over this one. Any help would be appreciated...

      Every 1 to 6 days I receive an error like the following: "Element is undefined in a Java object of type class coldfusion.runtime.CookieScope referenced as The specific sequence of files included or processed is: /var/www/html/mysite/www/js/myjs.cfm, line: 418"

      Attached code shows the page code snippet that apparently causes the error. This is the code at the very top of the page and the rest of the page code just outputs database variables into text strings for display.

      The page doesn't have anywhere near 418 lines even considering INCLUDEd files, and the code doesn't explicity do any cookie manipulation.

      When I remove the cfcache the problem stopped for 16 days, at which time I put the cfcache back in. This indcates that the cfcache is at least part of the problem, and is probably is most or all of it.

      Some considerations are:
      1) I'm running CFMX 7,0,2,142559
      2) I'm running on a Linux box
      3 I'm setting Domain cookies in the Application.cfm
      4) In the web server logs I find that the error occurs when a browser requests the cfm file at the same time (or within a second or two before) the site IP itself calls the template to recache it. (The site's IP calls the template with a cfnocache=true URL param to force the recache.) If a browser calls the template immediately after the recache then there is no error.

      Any ideas for workarounds?
        • 1. Cookie Error
          Rimshot Level 1
          Assistance would be appreciated
          • 2. Re: Cookie Error

            Have you had any luck with this?

            I receive the same error but under different circumstances
            http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=12 21011&enterthread=y
            • 3. Re: Cookie Error
              EricOConnell Level 1
              I too have just run into this problem on a production site, which is running CF MX 7 on Windows Advanced Server 2003, so it doesn't seem to be an OS-specific bug. It happens when going from the site index to a cached page. I noticed that I am also occasionally receiving this error:

              ColdFusion could not delete the file "C:\CFusionMX7\cache\cfcache_16D2F95B7C39C4F3BC185ECA2F3469CF.tmp" for an unknown reason. <br>The error occurred on line 1.

              Is this evidence of some kind of race condition? Do I need to use cflock when flushing the cache?
              • 4. Re: Cookie Error
                Rimshot Level 1
                I have not yet determined the problem. On the bright side, I have found numerous ways to not fix it.

                Since my original posting on 11/27 I have tried the following:
                1) Found somethign on the web indicating that "Macromedia" does not recmmend using ServerCache as and "action" type. I changed it to plain old "cache", but still receive the error.

                2) Moved the server cache directory to a custom location (to ease debugging). My expectations that this would not help were fulfilled.

                3) Added server and port params to match what was used by default in previous version of ColdFusion, but which no longer are defaults. Didn't help.

                4) Attempted cflock, but that caused an error no matter where it was placed.

                5) Removed all timeout/timespan params from the cache tag, then set up a scheduled task to run action="flush" every x minutes. Didn't help.

                I'm currently at a loss for what else to try. The only solution I can think of is to remove the cfcache altogether and hope browser caching of the file will relieve the server enough.

                It does indeed appear to me to be a race condition, but I can't get cflock to work - not sure what to wrap in the cflock tag.
                • 5. Re: Cookie Error
                  EricOConnell Level 1
                  Well I've continued to receive these errors, but I did find one interesting piece of information: they only seem to occur with a user agent of MSIE. I could not find any other browser associated with these. Statistically, it seems unlikely that they are unrelated. Can you check your logs to see if that's true?

                  • 6. Re: Cookie Error
                    Rimshot Level 1
                    On the site experiencing this issue we are not capturing browser information in the web server (Apache) logs, so I can't answer your question. I don't believe the issue would be considered weighty enough by those above me in my organization to allow changing the log settings either.

                    I found one bug report since my last post that I thought would be appropo, as apparently cfcache works in tandem with cfhttp in the background: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=95f66fd8 indicates
                    that intermittent connection issues between CFHTTP and CFMX when CFMX is used in combination with Sun 1.3 and 1.4 JVM's. I tried the recommended solution, however, and it didn't fix anything. I am still in search of an answer. At this point I receive one of these errors about every 4 days.