4 Replies Latest reply on Sep 9, 2014 4:56 PM by wimdecorte

    Abort server schedule


      Is it common for a scheduled script that is set to Abort after time limit is reached to keep the user logged in?


      I have a problem with a FileMaker server scheduled script. It's a listener, set to run every 15 minutes. It's got a script time limit of 12 minutes and it is set to abort when that time limit is reached.


      The script checks to see if there are any records flagged, and if so, sends an e-mail for each record and resets the flag.


      It runs ok, sometimes for a week, sometimes just a day, and then chokes on something. I can't figure out what is causing the script to hang. But when it does, it never aborts. The error logs show "time limit exceeded or server stopped" but the server "user" stays logged in and the database server gets completely stalled. No users can successfully log in (including all subsequent server scripts) and we have to restart the entire machine. It's a total meltdown.


      I've considered the possibility that it's not the script hanging, but the server itself, and the script hanging is a symptom. That doesn't seem to be the case. If I turn off that scheduled script, I never run into a hang state.


      I'm working on the script itself, but what I don't understand is why doesn't the server script abort log out the user? Has anyone had success with this abort option?


      Also, why even have the option to *not* abort the script? Under what circumstances would someone have a time limit and let the script run after the time limit??

        • 1. Re: Abort server schedule

          The abort is usually very reliable.


          A couple of things:

          - make sure to refresh the admin console's view by closing all admin consoles and doing a restart on the admin server from the command line

          - the most common cose of a schedule being stuck is through a validation error; check any validations you have set up on fields.  This behavior is very similar to what a regular client would see: not being able to get out of anything.  So check the data that is being processed very carefully.  9 times out of 10 that's where I find the issue

          • 2. Re: Abort server schedule

            Do you have Allow User Abort[off] in the script?



            • 3. Re: Abort server schedule

              I don't see any validation issues. The script has been *mostly* "read only" and the fields that get set aren't referenced in a validation calc and doesn't have one themselves.


              The solution also has CWP clients logging in, often in response the server script (which is sending e-mails). It's possible there have been record locking conflicts between CWP clients and the server script. So, today, I reduced the script to "read only" except for a single Set Field[], which I pre-fix with an Open Record and error capturing, hopefully that solves it.


              Unfortunately, I believe the hang has happened when CWP logins were unlikely. I'll set up a session logger on the PHP side (not into FileMaker) which may isolate that.




              I've tried doing a command line restart, but it was taking so long, I thought it had hung. Maybe I need to give it more time. What's the longest successful time it could take to get a command line response?




              Allow User Abort is set to Off.

              • 4. Re: Abort server schedule

                a command line restart of the admin server part is usually very very fast.  I've never seen it take more than a few seconds, usually much faster.