1 Reply Latest reply on Mar 4, 2014 5:48 AM by jmw

    Filemaker schedule job throwing 401 error



      Filemaker schedule job throwing 401 error



           We have a schedule job thats failing with 401 error. when the same script runs in client side it works perfectly. the script is like this

           error capture[on]

           perform find[restore]


           exit script[]


           sort records

           export records[]

           end if


           my findings were: we have given two criteria in the perform find: which has an AND condition. when i do not give the AND condition the script works well . whenever the AND condition is given the if(get{count)) returns only 0. But when i run it from client side the script runs very perfectly. i tried giving find and constraint find also. Still this particular script is throwing an error.I am unable to find out the root cause for this and fix it since when i run it from client side the perform find is happening perfectly. Only when i am running from server side this issue comes. please help me out with the same.

           Additionally there are no security issues related with this. i have thoroughly checked the same.


        • 1. Re: Filemaker schedule job throwing 401 error

               This is a thing from FM Server. 

               The 401 error means that no records are found, so I too am guessing that it is the Perform Find command that returns no records which is seen as an error by FileMaker. Using ErrorCapture seems logical, except that it only works within a client solution, not from within Server. So Server still thinks it is an error and logs it. Just like it does when in a loop the step Go To Next Record, Exit After Last produces an error after the last record; there is no next record after all, so again an error is logged.

               If you Google it a bit you'll find a couple of posts, f.e.: http://fmforums.com/forum/topic/86055-no-records-found-401-filemaker-script-error/

               There are several opinions on this across the net; I personally think a find command which produces no records is not an error, merely a FoundCount of 0, that is all. Others are on the side of FileMaker, so take your pick.

               I have never found a reliable workaround for this; suggestions that a script should end with a step that does not produce an error would not result in the logentries seemed to work sometimes but mostly not at all.

               Now, as a side note, the Export Records command is also tricky for Server as Server can only access specific folders. I think that it would produce a different error, but just for testing purposes you might want to disable it to make sure it is the find command.