10-02-2013 05:49 AM
I had an issue relating to APM today which I have managed to resolve but couldn't find any information on the subject online so thought I would post my results incase someone else hits the same problem.
We recently had a new installation of the EBI suite onto our server and had APM set up so we could take advantage of all the monitoring processes it does.
Aside from the ridiculous amount of notes that started turning up in everyone's log files everything was going ok until we tried scheduling some processes to run through the batch server. In our case using lsf.
(On another note, I surpressed the extra apm notes by editing the workspace server logconfig.apm.xml file as described at the bottom of this article http://support.sas.com/rnd/emi/APM93/apm93.faq.html )
Basically, every process we ran was being flagged as finishing with a non-zero exit code. Single step processes were still executing fine despite always sending failure emails, however for a more complicated flow which relies on previous step executing without error the flow wouldn't get past the first step.
Looking through the logs the exit code was caused by a warning very early in the process due to a non-existent environment variable queried by %sysget.
Since we don't use %sysget in any of our own code it wasn't hard to find the reference to %sysget in the %apm_armsetup macro.
Looking at the code in this macro it was coded to handle the situation where %sysget does not return any result however it does this after the warning has already been raised.
Luckily, once I had found the issue it was fairly simple to fix by altering the line in the macro from
%if sysfunc(sysexist(serverClass)) %then %let serverClass=%sysget(serverClass);
Which makes sure that %sysget is only run when the environment variable actually exists, preventing the Warning and allowing the batch processes to run as before.
Hopefully this will help someone else who hits this issue.
06-09-2015 03:32 AM
Great catch Tim. Thanks very much for a brilliant write up on this issue.
This certainly did help another person who also hit this issue.
06-09-2015 03:39 PM
- Check the current dir of the batch server it is not the home dir as normally expected
- the log file notation is 12hr based one , you would 24hr as normal
- when apm is active spaces in source names are not allowed anymore. I think this issue already exists in the batch server script. Using the foundation entry directly allows spaces when proper quoted.
Why this way to publish and not with TS fir a fix or kb note?