NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand database error with ITSDBLog.LogResults call

Specifics

Windows 11 enterprise

TestStand 2021

ODBC client connector 8.0.42

ODBC database server 5.7.33

 

This is a follow-on to another question I had, then decided was not the issue and closed.  

Background...

I have ported this code from NI2010 to NI2022 and have it working on my developer workstation and have installed the test code and NI2022 on a fresh Windows 11 install, which is not going well.

 

We have a production database server on a Linux system running mySQL 5.7.33 (according to mysql -V on the server) and on a fresh built Windows 11 enterprise system we have installed TS 2021 and the ODBC mysql connector 8.0.42.

I have correctly set up the connector in the 32-bit ODBC as Data source and tested its connection to the database: Successful.

 

In TestStand, I have configured database options, built the connection string and it tests successfully.  I have the schema set and it validates with no errors.

But the call to TSDBLog.LogResults fails.  I don't get an error reason, it just fails.  I have not found any log file from TestStand that tells me why the call fails either.

I told the ODBC data source configuration to log debug queries to %TEMP%\myodbc.sql so I can see what went to the connector. I see SQL queries for information the test (via a VI) gets from the database, but the LogResults call does not send anything, so it fails before getting there.

This precisely exactly the same setup that is on my development computer running the same OS, and works fine.  But the package installed on the fresh Windows 11 enterprise computer gives an error.  

 

Where can I find a log telling me why this failed?  Or where can I turn this logging on?  With other errors from VIs I get TestStand log descriptions, but not with ActiveX calls.

 

My only "hint" is in the Parameters.DatabaseOptions.ResultFilterExpression string there is an error:

Error in argument 1, ‘Logging.stepResult.TS.stepType’ in call to the expression function ‘Left’.
(Left(Logging.StepResult.TS.StepType, 7) != "NI_Flow" gives “unknown variable or property name ‘Logging’.

I suspect that is because the sequence is paused and the context may be different because ThisContext.Logging does not have that variable.

 

I didn't write this code and have no idea why the original authors have done a custom database logging rather than the default TestStand one.  So, I only half understand what some of this stuff does.  Any help will be appreciated!

 

be well,

DLC

0 Kudos
Message 1 of 7
(243 Views)

DLC, is the step that "fails" Log Results to Database in LogToDatabase sequence of NI-DatabaseLogger.seq, and if so, does it fail or error? If it errors, what is the full error message?

Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 7
(208 Views)

@Scott_Richardson wrote:

DLC, is the step that "fails" Log Results to Database in LogToDatabase sequence of NI-DatabaseLogger.seq, and if so, does it fail or error? If it errors, what is the full error message?


Scott,

The original authors have a custom database sequence (why?  I don't know) but, yes, it is in the LogToDatabase subsequence of the custom database logger.  The specific call is:

ITSDBLog.LogResults. The step immediately fails.  No error is given, so I don't know why it failed.  I have the ODBC connector logging, no SQL commands are sent.

I could address the issue if I knew what it was, but no reason is given.  I assume that it must issue an error message, but...  The attached screen shot is the line in the sequence file.

I enabled result recording, but still got no error.

-- edit --

I did find an error in the parameters list.

Variables.Parameters.DataBaseOptions.ResultFilterExpression: Error in argument 1, ‘Logging.stepResult.TS.stepType’ in call to the expression function ‘Left’.
(Left(Logging.StepResult.TS.StepType, 7) != "NI_Flow" throws: “unknown variable or property name ‘Logging’. Error accessing ‘Logging’.

However, during debugging I do indeed see the variable Logging and it does have that entire path there.  Because the Parameters.Database options is passed to LogResults, could this be what caused the error?  The field the "Left" function is interested in is there in that Parameters cluster though, why is the "Left" function call failing on this computer, but not the one I develop on?

be well,

DLC

 

0 Kudos
Message 3 of 7
(184 Views)

DLC, the parameter that you are talking about comes from the configured Database Options, see below:

Scott_Richardson_0-1766202947357.png

If you change the dropdown value to All Results, the underlying expression is "True" and should rule out that as an issue.

I am not sure why you do not see a Logging property as the 2nd step in the Setup step group creates the property:

Scott_Richardson_1-1766203443815.png

 

Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 7
(165 Views)

@DLMC wrote:

@Scott_Richardson wrote:

DLC, is the step that "fails" Log Results to Database in LogToDatabase sequence of NI-DatabaseLogger.seq, and if so, does it fail or error? If it errors, what is the full error message?


Scott,

The original authors have a custom database sequence (why?  I don't know) but, yes, it is in the LogToDatabase subsequence of the custom database logger.  The specific call is:

ITSDBLog.LogResults. The step immediately fails.  No error is given, so I don't know why it failed.  I have the ODBC connector logging, no SQL commands are sent.

I could address the issue if I knew what it was, but no reason is given.  I assume that it must issue an error message, but...  The attached screen shot is the line in the sequence file.

I enabled result recording, but still got no error.

-- edit --

I did find an error in the parameters list.

Variables.Parameters.DataBaseOptions.ResultFilterExpression: Error in argument 1, ‘Logging.stepResult.TS.stepType’ in call to the expression function ‘Left’.
(Left(Logging.StepResult.TS.StepType, 7) != "NI_Flow" throws: “unknown variable or property name ‘Logging’. Error accessing ‘Logging’.

However, during debugging I do indeed see the variable Logging and it does have that entire path there.  Because the Parameters.Database options is passed to LogResults, could this be what caused the error?  The field the "Left" function is interested in is there in that Parameters cluster though, why is the "Left" function call failing on this computer, but not the one I develop on?

 

be well,

DLC

 


As it turns out, my very last question was the one to ask.

(Left(Logging.StepResult.TS.StepType, 7) != "NI_Flow"

...

The field the "Left" function is interested in is there in that Parameters cluster though, why is the "Left" function call failing on this computer, but not the one I develop on?

In fact, yes, it IS different. This field is now in:

Logging.MainSequenceResults.StepResult.TS.StepType.

Doesn't TestStand create both that filter AND the Logging parameter?  How did they get out of step?

 

I tried changing parameter address to the correct location before allowing the step to run, and it still failed the same way even though I carefully set the variable path to that which was there.  The function still failed unable to find "Logging".

Regardless, I changed the Database configure  "exclude flow control" to "All Results" and the call still fails with no explanation.  😞 

 

be well,

DLC

0 Kudos
Message 5 of 7
(77 Views)

DLC, in one of my images above I showed a breakpoint and the Logging property existing, does that property exist when you break at that step? I am still unclear how this is manifesting, so can you share any screenshots of what step(s) are failing or erroring when running the execution, and why you say there are no details to go on?

Scott Richardson
https://testeract.com
0 Kudos
Message 6 of 7
(47 Views)

@Scott_Richardson wrote:

DLC, in one of my images above I showed a breakpoint and the Logging property existing, does that property exist when you break at that step? I am still unclear how this is manifesting, so can you share any screenshots of what step(s) are failing or erroring when running the execution, and why you say there are no details to go on?


Yes.  The property exists when I break at the step that fails.  I am making assumptions that the Logging parameter is created by TestStand when you configure database logging and I have seen the filter details change when I don't filter anything out in the database config screens as well.

 

Be well,

DLC

Download All
0 Kudos
Message 7 of 7
(33 Views)