Written by

Full Stack Developer at Elo Consultoria LTDA
Question Cristiano Silva · Oct 1

Executing csession always return exit code 1.

Hi all,

I'm developing a Azure Pipeline to automate the deployment process in Caché.

I use selfhosted agent to execute code im my Caché Server.

My problem is that cession execution via cmd always terminate with exit code 1 and the pipeline finishes with error, but the execution in Caché is fine, the method executed returns $$$OK
I use the following line to execute a class in Caché.
C:\InterSystems\Cache\bin\csession.exe CACHE -U  %RELEASE_TRIGGERINGARTIFACT_ALIAS% "##Class(sgf.pipeline.DeploymentManager).ProcessDeployment()"
Bellow printscreen of execution in Azure:

The problem is the exit code 1


I did a local test printing the errorlevel environment variable before execution:

After execution:

Regards.

Product version: Caché 2018.1
$ZV: Cache for Windows (x86-64) 2018.1.4 (Build 505_1U) Thu May 28 2020 10:01:40 EDT

Comments

As a guess the routine is returning 1 and you can demo this using @Dmitry Maslennikov suggestion:

run do $zu(4,$job,1) and check errorlevel

run do $zu(4,$job,0) and check errorlevel

0
Dmitry Maslennikov  Oct 3 to Cristiano Silva

Not sure about Windows and Cache, but it works with IRIS and Linux

0
Cristiano Silva · Oct 2

Hy guys,

In the end, I had to use an intermediate file to signal an error when executing the Caché class, because using the environment variable didn't reflect it in the process that runs csession.

I'll create an Open Exchange application with the complete solution later.

0