6 Replies Latest reply on Jun 8, 2010 9:48 AM by philmodjunk

    FMS11 Scheduled Script always fail?

    user12546

      Title

      FMS11 Scheduled Script always fail?

      Your post

      Hi,

       

      Just been adding a scheduled server script in FMS11 to perform a maintenance script every 10 minutes. It works fine however it always ends up as "failed" in status with a silly error 401 (no records found)

       

      Is there any way to get past the error message as the script IS running, it performs as it should but if one of the perform finds in the script doesn't find any records it ends up "failing" the script and doesn't put a date/time in "Last performed" in Server Admin.

       

      It's rally annoying as it's actually good that the script doesn't find anything to do but :p

       

      Any suggestions?

       

      Regards

      David

        • 1. Re: FMS11 Scheduled Script always fail?
          philmodjunk

          I'm using FMS 10.

           

          I have a scheduled script that also logs such "errors" but is reported as "OK" after the scheduled script runs. Is this find the last step of the script?

          Perhaps there's another reason the script is reporting "failed" instead of OK.

          • 2. Re: FMS11 Scheduled Script always fail?
            JFFortier

            Maybe your can add those steps

             

            Allow User Abort [ Off ]
            Set Error Capture [ On ]

             

            I'm my script I use

             

            Perform Find [ ]
            If [ Get ( FoundCount )=0 ]
                Exit Script [ ] Or whatever you like
            End If

            • 3. Re: FMS11 Scheduled Script always fail?
              user12546

              @PhilModJunk

              Well yeah, FileMaker Server 10 does it "right", it reports it in logs and ends up reporting the script as "OK"

              But FileMaker Server 11 doesn't, it only get "failed".

               

              And no, it's the find that finds 0 records, as in error 401, it's stated in the logs. If it finds any record its all ok.

               

               

              @JFFortier

              Those steps are already included, still does it report as "failed with error 401"

               

              • 4. Re: FMS11 Scheduled Script always fail?
                user12546

                Hm, what the hell, I get the same issue in FileMaker Server 10 aswell now...now if any subscript have a Go to next record (Exit after last record)

                • 5. Re: FMS11 Scheduled Script always fail?
                  Chicago

                  Yes, it's a stupid non-error that I certainly hope FMS 12 will ignore with "set error capture on", but for now, a simple workaround is this - avoid finds that return 0 records. For example, we're running a server-side script that checks for email records to be sent out every 5 minutes. The old find step was "omit sent_flag = 1" (i.e. null sent_flag).  Since most of the time none are found, it always looks like the script fails. So I changed it to find "sent_flag=1", which always succeeds, then added a "show omitted" step after that, followed by "if( get(foundcount)). Voila!  No more errors in the FMS Admin Console.  

                   

                  If you can't come up with a good "reverse find", you could add a test for the validity of records in a relationship before you do the find, or use "Go to Related Record".

                   

                  Good luck.

                  • 6. Re: FMS11 Scheduled Script always fail?
                    philmodjunk

                    Maybe you can just add a simple do nothing script step or two after the find.

                     

                    Using FMS 10, my script routinely hits a no records found--which is logged as an error--but reports the script status as "OK" not as "Failed". Perhaps the difference is that my scripts do many other operations after these finds before they finally terminate.