I have a database in server 1 which refers to multiple databases in server 2 for record validation purposes. When the scheduled agent runs, it encounters an "Object Variable not set" error. However, when I tried to manually run the agent (Right click agent name, click Run) it runs smoothly without error.
I simulated the database setup in 2 virtual servers and was able to reproduce the error. Line by line debugging shows that the error occurred when it tries to open the database in the other server. Since manual run works smoothly, I do not think the code or variables (server & database path) is wrong.
I've check the ACL for all databases to include the signer and server, also tried to schedule run the agent in all 3 security modes (Restricted, Unrestricted and Restricted with Admin Right). I've looked into the server document and security and allowed access to and from both servers. Anything else that I may have missed?