From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW CLI doesn't work when called from Jenkins

Solved!
Go to solution

I've been struggling with getting my team moving with CI for the better part of a year now. I even managed to convince management to push an upgrade to LV2018 as was recommended to me here: 

https://forums.ni.com/t5/LabVIEW/LabVIEWCLI-Error-1039/m-p/3897470#M1105904

 

The good news is that I no longer receive the error 1039--hence the new thread. The bad news is that I receive highly inconsistent behavior. I have a simple test vi that checks the exec.state of an application launcher, reporting whether or not it is broken. I use the following command to do this:

labviewcli -Verbosity Diagnostic -OperationName RunVI -VIPath "c:\<path_to_vi>\checkApplicationExecStates.vi" 

 This is successful when I command directly from a terminal about 85% of the time. When I use the exact same command as an Execute Windows batch command Build Step in Jenkins, I get an error -35000 returned about 85% of the time. Calling this directly from the terminal demonstrate VI Server connectivity is not the issue here but I'm at a loss. Any help here would greatly help my future sanity.

 

0 Kudos
Message 1 of 5
(2,837 Views)
Solution
Accepted by topic author jcopetre

One relevant delta occurs to me between the two scenarios presented: whereas manually keying the command into a terminal necessarily requires the operation to be conducted under my user account--which has an LV license associated with it--I have Jenkins configured to run as a service on the system account which does not have a license associated with it. As such, LV never starts when commanded by Jenkins--the -35000 error is indeed accurate but the returned error in this scenario could be made more precise or at the very minimum the Verbose option should indicate that LV never makes it past the registration screen.

Having Jenkins run as a service under an LV licensed user account does indeed allow Jenkins to execute the command successfully. 

Message 2 of 5
(2,740 Views)

Hello Jcopetre,

 

I have almost the same problem, when I try to run the LabVIEWLCI on Jenkins I always got the error -350000 (it seems always after the timeout limit). Of course this call works on my PC and as far I see the problem is that the LabVIEWCLI can not start the LabVIEW instance and what is even weirder that after the timeout the LabVIEW starts and the next LabVIEWCLI call can connect (mostly) to the LabVIEW.

Im not sure that I understand your solution, could you explain it again please?

 

Best reagards,

Balint

0 Kudos
Message 3 of 5
(2,451 Views)

Hi ViltBalint

 

When defining how the Jenkins service runs, you can have it run as a specific user. In this case, that specific user should be associated with a LabVIEW license. 

Jenkins by default will run as SYSTEM, so you’ll need to set this up yourself. 

Here are some instructions for how to do that on Windows: https://querysurge.zendesk.com/hc/en-us/articles/205761136-Setting-an-Agent-to-Run-Under-a-Specific-...

 

Hope this helps

Message 4 of 5
(2,439 Views)

Hello Jcopetre,

 

thank you for your answer, I checked it and it was already set. In the meanwhile I found an another thread (https://forums.ni.com/t5/Continuous-Integration/NI-LabVIEW-CLI-won-t-start-LabVIEW-VI-Server-fast-en...) where I found the solution to my problem. In a nutshell, the LabVIEW CLI has some pre-defined timeout configured in it's .ini file, I increased it which solved the problem.

 

Best regards,

Balint

 

0 Kudos
Message 5 of 5
(2,400 Views)