The error was because the CA Common Services task CAIRIM was not started yet.
This is required for any CA product to run.
CAIRIM is started in on of several ways. It can be as a started task CAIRIM or run under the subsystem CAMASTER or as a batch job.
I recommend looking at your automation to see what method you use. This is the link to the doc that explains the methods in detail.