Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack trace being created during successful validate execution #380

Closed
1 task done
jordanpadams opened this issue Jul 28, 2021 · 3 comments
Closed
1 task done

stack trace being created during successful validate execution #380

jordanpadams opened this issue Jul 28, 2021 · 3 comments
Assignees
Labels
B12.0 bug Something isn't working s.high

Comments

@jordanpadams
Copy link
Member

jordanpadams commented Jul 28, 2021

🐛 Describe the bug

Follow-on to #344, this comment and #379, the stack trace output file is causing numerous issues.

🕵️ Expected behavior

stack trace only outputs when a fatal error occurs or uncaught exception.

📚 Version of Software Used

v2.0.7


⚙️ Engineering Details

  • perform full scrub of validate and pds4-jparser (if necessary) to ensure every instance of the creation of a write to the stack trace is warranted.
    • this should only occur on uncaught exceptions or fatal errors
@qchaupds
Copy link
Contributor

qchaupds commented Aug 3, 2021

@jordanpadams Do you have a particular test case that you'd seen this behavior? I am not able to reproduce the error you'd mentioned.

@msbentley
Copy link

Hi @jordanpadams and @qchaupds it would be good to clarify exactly what is expected. #344 discusses the generation of the log during successful validation, but from @jordanpadams's description above, I would not expect the log to be generated with validation failure - since this is not an application error, but application success ;-)

As in that linked ticket, one simple example is to mis-name the data file referenced in the label (e.g. referenced in a Table_Delimited or other class), which results in Error occurred while trying to read table and a stack trace log.

qchaupds pushed a commit that referenced this issue Aug 4, 2021
… optional with new command line parameter --enable-stack-printing

1. Add test resource :src/test/resources/github379
2. Add test resource :src/test/resources/github380 (Directory is required due to quirkiness with behave)
3. Add logic to enable stack printing :src/main/java/gov/nasa/pds/tools/util/FileService.java
4. Add house keeping of stackPrintingFlag variable :src/main/java/gov/nasa/pds/tools/util/FlagsUtil.java
5. Fix bug with printStackTraceToFile(0 function :src/main/java/gov/nasa/pds/tools/validate/rule/pds4/TableDataContentValidationRule.java
6. Add parsing ENABLE_STACK_PRINTING parameter :src/main/java/gov/nasa/pds/validate/ValidateLauncher.java
7. Add ENABLE_STACK_PRINTING parameter :src/main/java/gov/nasa/pds/validate/commandline/options/Flag.java
8. Add ENABLE_STACK_PRINTING option :src/main/java/gov/nasa/pds/validate/commandline/options/FlagOptions.java
9. Add tests for github379 and github380 :src/test/resources/features/validate.feature

Refs:

#379 FileService:printStackTraceToFile:ERROR when validating a product with overlapping fields
#380 stack trace being created during successful validate execution
qchaupds pushed a commit that referenced this issue Aug 12, 2021
1. Add setSeverity() to 0 when --debug-mode is used at command line :src/main/java/gov/nasa/pds/validate/ValidateLauncher.java
2. Modify --enable-stack-printing to --debug-mode :src/main/java/gov/nasa/pds/validate/commandline/options/FlagOptions.java
3. Modify --enable-stack-printing to --debug-mode :src/test/resources/features/validate.feature

Refs:

#379 FileService:printStackTraceToFile:ERROR when validating a product with overlapping fields
#380 stack trace being created during successful validate execution
@jordanpadams
Copy link
Member Author

closed per #385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B12.0 bug Something isn't working s.high
Projects
None yet
Development

No branches or pull requests

4 participants