2

I have a process that when I run it manually, it runs fine with no errors. I have it set up in CF Administrator Scheduler to run daily at 3:00am. It runs and errors out at the same line every time. It has done this for the past week.
Error: Element DATEE is undefined in SESSION. The specific sequence of files included or processed is: C:\data\wwwroot\webapps\cfeis\commonapp\sftp\newpdfs.cfm, line: 45
I know this session variable exists, besauce it is used a couple lines before, and it works fine there.

 <!---Loops through selected folder. If .zip found, extracts all files into same folder--->
<cftry>
  <cfdirectory action="list" directory="#dropfolder#\#session.datee#" name="listRoot">
  <cfloop query="listRoot">
  <!---<cfif #listroot.name# contains ".zip">--->
    <cfif #listroot.name# contains ".zip" and #listroot.name# contains "Writing">
      <cfset session.foldname=#left(listroot.name, len(listroot.name)-4)#>
      <cfif not DirectoryExists("#dropfolder#\#session.datee#\#session.foldname#")>
        <cfset DirectoryCreate("#dropfolder#\#session.datee#\#session.foldname#")>
      </cfif>
      <cftry>
        <cfzip action="unzip" destination="#dropfolder#\#session.datee#\#session.foldname#" file="#dropfolder#\#session.datee#\#listRoot.name#" overwrite="yes" recurse="yes">
        <cfcatch>
          <cfsavecontent variable= "mailmessage">
            <cfoutput>
              #cfcatch.message#
            </cfoutput>
          </cfsavecontent>
          <cfmail from="eis-distributed-apps@lists.gatech.edu" to="lauren.robinson@oit.gatech.edu" subject="Unzip error" type="html">
            <cfmailpart type="text/html" charset="utf-8">#mailmessage#</cfmailpart>
            <cfmailpart type="text/plain" charset="utf-8">#textMessage(mailmessage)#</cfmailpart>
          </cfmail>
        </cfcatch>
      </cftry>
    </cfif>
  </cfloop>
  <cfcatch>
  </cfcatch>
</cftry>

<cfset session.funzip=0>
<cfset session.funzipArr=ArrayNew(1)>
<cfset sleep(10000)>
<cfdirectory action="list" directory="#dropfolder#\#session.datee#\#session.foldname#" name="listRoot">

The line it errors at is the last line shown in the code above. As you can see, the same variable is used 3-4 times earlier in the code. Can someone help me understand what could be causing this???

4

1 回答 1

4

会话和计划任务通常不能一起工作。会话通常用作登录过程的一部分。没有用户可以登录计划任务。

如果这是您的完整代码,您可以替换session.*request.*

于 2013-12-10T15:06:24.700 回答