Product and version
Filemaker Server 16.0
OS and version
Windows Server 2016 Standard
Browser and version (for WebDirect only)
Server Side Scripts Don't Run
How to replicate
Good scripting practices
This is an occasional problem that I have encountered since the upgrade to FM Server 16. The problem is that server side scripts that have been running fine for hours/days//weeks suddenly won't run anymore; no server side script will run. It happens with every script not just some and it happens with both PSOS and with scripts that run on a schedule.
To get the scripts running again I use the command: FMSDAMIN RESTART FMSE which restarts the scripting engine on the server.
Here's what I think is causing the problem, and this is just a guess:
There are some script steps that are not compatible with the server. Show Custom Dialog, Adjust Window, Close Popover, etc. These often require user interaction which is impossible if the script is running on the server.
According to the Filemaker documentation these incompatible script steps should be ignored by the server when one is encountered. It is my experience that this is indeed the case. The script will perform all of the steps that it is capable of, skipping over the incompatible steps.
The problem is that even though all of the compatible steps were processed right to the end, the server thinks the script is still running. This matters because there is a limit on how many scripts can run concurrently. There is a setting on the server where you put a limit on the number of scripts that can be running at any one time.
So basically, one sloppily written script containing a FREEZE WINDOW step can halt ALL server side scripts after 30 executions if you have your limit set at 30.
The good news is that this is avoidable by either not including incompatible steps or by skipping over them with an IF statement. Example:
IF PatternCount ( Get ( ApplicationVersion ) ; "Server" ) = 0
Maybe I'm all wet but this seems to be what I've been experiencing since the upgrade to Filemaker Server 16. It could also be that only certain incompatible steps are the troublemakers while others are fine.
Anyway, this sounds like a bug that seasoned developers likely won't encounter. It's getting more infrequent for me as I have been cleaning up recently.