Can you tell us a bit more about your set-up?
- Are all the hosted files in the same folder on the server?
- Does the account you are using to run the script have a privilege set that allows access to the layouts in question, plus access to any fields that are required for the relationship between the files?
- Have you changed anything recently--updates, accounts, schedules, schema, etc?
If you've changed absolutely nothing, can you write a new script that tries to access the same file/relationship (I've experienced some wacky script corruptions, where one particular script refuses to run properly, but a newly constructed twin works fine.)
Thanks for taking the time to reply.
All databases are in the databases folder
The thing is. It worked one day and then not the next. Nothing has been moved or edited since it was working. No updates done. The server may have been rebooted, I'm not sure. And it runs happily enough when not being triggered by the script scheduler.
I haven't tried a newly constructed script but I have duplicated and modified slightly to give me feedback when the script runs/fails. That returns the same issue.
If I get the opportunity today/tomorrow I'll try a completely new script that calls on a connected database and I'll host it in a different database, just in case it's the database itself causing the issue.
I plan to set the system back to before the problem occurred and see if that fixes it. If not then I'll have to think of something else.
My wackiest issue was a subscript not running, but without reporting any errors. Even the 'last run' status said 'OK', but the subscript had clearly not run. The parent script was simply a hold-all, running a series of housekeeping subscripts, so there was no reason why the subscript would not be attempted.
As with you, it ran perfectly normally when run in a client, but not when scheduled serverside.
I tried reducing the subscript to ever-simpler forms to find the error (eventually, I reduced it to simply writing a timestamp to local field to prove that it had been activated). No luck.
Then I found that the subscript ran normally when scheduled serverside as a standalone script. A newly built identical copy of the parent script did the trick—it looks like, for some reason, that the parent script could no longer 'see' the subscript, even when I replaced the script-step calling the subscript.
Let me know how you get on, and I'll see if I can offer any further advice,
Finally able to reset the system back to before the problem occurred.
The script now runs from the server scheduler.
Using my login details for the script. Changed back to the server login it failed.
I must have changed the server account password to the connected database (Why? Who knows. Stuff happens.) without realising the implication. Made sure the passwords were the same and now it is working.