NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Deployment Utility Command Line returned exit code in spite of pass

Hi All,

its my first issue entry and I hope im right here. My problme is this. I try to deploy a project with the command line feature of the deployment utility. If I use all necessary options the deploy starts and works fine. The project is being built successfully. But the command returns the exit code 2. I get the same exit code when the built isn't successfully.

Since I'm using the command line function in a Jenkins batch Script the Jenkins stage is always aborting.

 

Is that correct behavior? What can I do? The exit code should be zero if the built was successfully. I dont want to interpret the log file.

 

I use following command line options:

"C:\\Program Files (x86)\\National Instruments\\TestStand 2017\\Bin\\BuildTSD.exe" /deployTSWorkspace TRUE /workspacePath "example.tsw" /DeployEnvironmentFile TRUE /ActiveEnvironmentFile Environment\Environment.tsenv /createInstaller TRUE /installationName "Installer_example" /installerDirectory "example_Inst" /startMenuItemGroup "example" /defaultInstallationBaseDir ProgramFiles /doNotAskUserForInstallationDirectory FALSE /installerLanguage "German" /installTSEngine TRUE /hideLicenseDialog TRUE /manufacturer "example gmbH" /versionString "0.0.1" /copyLogFiles "deployLog" /SaveTSDFile "example.tsd" /UpgradesandPatchesToInclude "TSEngineandDrivers" "example.tsd"

 

Best regards

Lutz

0 Kudos
Message 1 of 3
(974 Views)

Too late for this reply, but this thread helped me to solve exit code 2 issue I chased around for a while

 

Exit code 2 stands for Aborted Build:The TSDU was aborted while building, the installer was not built.

 

Exit code 2 happened to me only when I built package using teststand environment file.  Without TS environment, there was no issue.  

Ajay_MV_0-1714577625448.png

A little note use $? command: $? helps to find that status of last exeuction True means all went well and False means something failed.  Second time sending $? basically fetchs result of previous $? execution, since it executed well and so you will find found the result of previous $? command.  You can also use $LastExitCode to know last execution status with exact exit code returned from execution.

 

What I found eventually is that, if the environment file path given in both places, one in command line using the argument /ActiveEnvironmentFile and second in the UI below, then exit code 2 occurs.

Ajay_MV_1-1714577753518.png

 

I unchecked "Use Environment File To Determine Deployed File Destinations" as well when I give below command.  I suspect that could also get conflict if I give in both command line and UI checkbox

/DeployEnvironmentFile true

 

--

Regards,

 

--
Ajay MV


0 Kudos
Message 2 of 3
(179 Views)

Other finding worth sharing here for anyone to help regarding TSD.

 

Error: We found build failed sometimes with error as Deploy files from directory field not found

 

Reason: Likely you have cloned repo to regular-user-documents location that caused this error. You may find, if you open TSD file from repo in non-user-documents folder like C:\Temp\ , the image and package destinations still points to users-documents though you have opened it from C:\Temp\

 

Solution: Keep the repo in non-user-documents folder like C:\Temp\ and update the destination again to the repo location like C:\Temp\Project\Builds location (inherently TSD determines the relative path when you choose Builds folder inside repo), then save TSD. 

--
Ajay MV


0 Kudos
Message 3 of 3
(73 Views)