This was not supposed to be a two blog post day, but here I am living the dream…
I wanted to show how you can use EssCS Command Line Interface (CLI) to kick off various tasks in EssCS. And I will… But I found an interesting bug that I want to show you, as well, so if you are Googling on this error, you can see how to work around it (details later…sorry for the vagueness).
The EssCS CLI is a tool to do various tasks outside of the EssCS GUI. You can kickoff calc scripts, build dimensions, upload/download items, and do LCM imports/exports among other things. It’s kind of like MaxL for the cloud. I ran a few scripts and copied them to Notepad++ to show you what the commands look like and how the job status is returned. I’ve highlighted various commands in red boxes (I will get to the errors in just a minute…).
It’s a straightforward tool to use and doesn’t take as much understanding (or, at times, patience) as MaxL. The examples I showed were:
· Logging into EssCS CLI
· Executing a calculation
· Downloading a file (ie: a calc script, in my example)
· Listing all the files from my user
· Listing the version of EssCS I’m using
Something you may have noticed was each time I tried to execute a calculation, I would get an error “Error happened while executing Calculation job. Please make sure all artifacts exist and valid”. I logged into EssCS to see the Job console to see if I could get details on why the calc execution failed. However, I see that my calcs executed successfully. Hmm…
I decided to check the application logs to see if there was something in them to give me an answer… They also showed success.
Well, this is odd. I’m happy my scripts ran successfully, however, the CLI was not reporting back correctly. CLI gives an option of adding a “-v” to each command which tells the system to return “verbose output” for the command. I decided to use this for one of my calc scripts and got the following:
C:cli>esscs calc -v -application USG_WF -db Emp_Dets -script Calc2018.CSC
Picked up _JAVA_OPTIONS: -Xmx512M
POST: {“application”:”USG_WF”,”db”:”Emp_Dets”,”jobtype”:”calc”,”parameters”:{“script”:”Calc2018.CSC”}}
RETURN: {“JOB_ID”:40,”appName”:”USG_WF”,”jobfileName”:”Calc2018″,”dbName”:”Emp_Dets”,”startTime”:”2017-03-27 18:08:01 UTC”,”endTime”:”2017-03-27 18:08:01 UTC”,”jobInputInfo”:”{“calcScriptHasRTSV”:false,”calcScriptExecDefault”:false,”calcScriptName”:”Calc2018″,”calcScriptIsScript”:false}”,”userName”:”cloud.user”,”jobtype”:”Calc Execution”,”statusMessage”:”In Progress”,”status”:100,”jobOutputInfo”:””,”links”:[{“rel”:”self”,”href”:”http://localhost:9000/essbase/rest/v1/jobs”,”method”:”POST”},{“rel”:”canonical”,”href”:”http://localhost:9000/essbase/rest/v1/jobs”,”method”:”POST”},{“rel”:”Job Status”,”href”:”http://localhost:9000/essbase/rest/v1/jobs/40″,”method”:”GET”}]}
Error happened while executing Calculation job. Please make sure all artifacts exist and valid.
Okay…I’ve been playing around (and presented a couple times) with REST and recognize that’s what is occurring in the background. I decide to go to the first URL and see the jobs:
Nothing of real value. I then tried the second URL, the actual job number, and got the following. I have a handy JSON viewer plugin for my browser, so I got formatted JSON details:
I see all the details of my job. The status is 200, which in HTTP status code speak means “OK”. This is a total guess, but if you compare PBCS REST status codes, 0 means OK. Perhaps a translation misstep between 200 and 0 to signify success? I’m not really sure, but if you see this error using CLI, check in EssCS to see if it is really an error, or use the verbose command to get the REST URL for the job. It may just be this bug to look past for now!