5 Replies Latest reply on Feb 9, 2012 7:47 AM by ByteTheBullet

    Hung Server SIde Script Client?

    ByteTheBullet

      I've encountered an interesting problem over the weekend. I have a solution that uses a server side script to import some data from files in the server's FileMaker/FileMaker Server/Data/Documents directory. I tested the script a bunch of times before implementing it and it worked just fine. Over the weekend, I received an error email from the server stating that the script had aborted due to a time limit exceeded or server stopped, error number 691. Since the server hasn't stopped, I'm going with the assumption that the time limit for the script was exeeded. It shouldn't have been, but that's another issue for now. That error happened late Saturday night (the schedule calls for this particular script to run every day at 23:45). On Sunday, the script failed with the error number 2- no open databases to operate on. I check the server, and sure enough, the database in question is closed. However, it shows that it has one client connected to it, and that client is "FileMaker Script". Seeing as the database is being shown as closed, this seems odd to me. I tried to open the file, but received error number 38- the file is open by another application. I tried closing the file, and received error number 92- the file is not currently open. I tried disconnecting the "FileMaker Script" client, but nothing happens. No error message, but the client won't go away.

       

      Does anyone know of a way other than stopping and starting the FIleMaker servive to resolve this situation? There are a number of other databases on this server that are problematic to shut down during business hours due to use. Additionally, does anyone know what causes this sort of situation to occur, and what can be done to avoid it in the future? Thanks!

        • 1. Re: Hung Server SIde Script Client?
          Stephen Huston

          Did you try selecting the Client in the Clients tab of the Server admin panel and disconnecting that one client from there?

           

          Once the disconnect issue is resolved, check your script for server compatibility of all script steps, and be sure that the FM Server where the import source is located has read permissions by the FM Server.

           

          FM Server is very tight about which directories it can see when running Server-side scripts,

          • 2. Re: Hung Server SIde Script Client?
            ByteTheBullet

            Yep, I tried disconnecting from the client panel as well, and had the same result (no disconnection).

             

            As far as server side script step compatibility, I know the script is good, as it's run multiple times before without having any issues. I've also double and triple checked the script in ScriptEditor making sure that I have no incompatible steps. The script in question is used *only* by the server-side schedule.

             

            For permissions, the directory is in the FileMaker Documents directory on the server, which I understand is one fo the few places that FMS can read from.

            • 3. Re: Hung Server SIde Script Client?
              Stephen Huston

              Are the permission in the Documents directory explicitly set for FM Server to read/write?

              • 4. Re: Hung Server SIde Script Client?
                ByteTheBullet

                They are. Like I said, the script ran successfully for a few days before having the issue Sunday morning.

                 

                I ended up having to reboot the entire server to resolve things. I first tried simply stopping the FileMaker Server via the admin tool. The service seemed to stop, but I was unable to restart it via the admin tool. After restarting the admin tool, it looked as if the service did *not* stop, and nothing I did would kill off the hung script. Once I rebooted the entire server, however, everything was back to normal. I'll be doing some more testing over the rest of this week to see if I can pin down a cause.

                • 5. Re: Hung Server SIde Script Client?
                  ByteTheBullet

                  To provide more information, I discovered yesterday that the issue was related to a change in data that was being provided to the database. One of the files that was being imported was improperly formatted, and some required data was missing from some records. An error code was captured and logged, but apparently the script was not able to abort the processing and simply hung.

                   

                  At this point, I'm not sure how to fix the underlaying problem of the server-side script hanging, since it was not a matter of an infinite loop or anything. There was one field that required data, and no data was provided to it. AFter hitting that point, the script just froze, and only a reboot of the entire server would kill it. I've since made that particular field not mandatory and put some other checks in place as a bandaid, but I still think that there's an issue when a server side script hangs and requires a server reboot to resolve.