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

Fix uncaught exception error when validating an array object #155

Closed
Tracked by #30
fran-vallejo opened this issue Nov 19, 2019 · 7 comments · Fixed by #543
Closed
Tracked by #30

Fix uncaught exception error when validating an array object #155

fran-vallejo opened this issue Nov 19, 2019 · 7 comments · Fixed by #543

Comments

@fran-vallejo
Copy link

Describe the bug
validate raises an exception while validating a product.
As the product is invalid, I expect a message indicating what the problem is instead of one indicating there has been an uncaught exception.

The problem with the product is there is an inconsistency between the number of axes declared and the number of axes defined for an array object.

<Array>
  <name>Integration_Time</name>
  <local_identifier>Integration_Time</local_identifier>
  <offset unit="byte">13484630</offset>
  <axes>2</axes>
  <axis_index_order>Last Index Fastest</axis_index_order>
  <description>Integration_Time</description>
  <Element_Array>
    <data_type>SignedLSB8</data_type>
  </Element_Array>
  <Axis_Array>
    <axis_name>index</axis_name>
    <elements>1</elements>
    <sequence_number>1</sequence_number>
  </Axis_Array>
</Array>

The declared value for Array>axes is 2, but then only one Array>Axis_Array entity has been defined.Changing the axes value from 2 to 1 the exception messages disappear.

To Reproduce
@msbentley will send / attach the product.

Expected behavior
As the product is invalid, a proper message indicating what the problem is instead of one indicating there has been an uncaught exception.

Version of Software Used
PDS Validate Tool Report

Configuration:
Version 1.17.5
Date 2019-11-19T10:01:35Z
...
Product Level Validation Results

PASS: gov.nasa.pds.validate.ValidateLauncher
WARNING [warning.product_not_registered] Non-registered context products should only be used during archive development. All context products must be registered for a valid, released archive bundle.

FAIL: file:/home/fvallejo/TestData/strofio/srn_raw_strofio_re-hq-tof_20190405_20190406.xml
ERROR [error.validation.internal_error] Uncaught exception while validating: null

FAIL: file:/home/fvallejo/TestData/strofio/srn_raw_strofio_re-lq-tof_20190405_20190406.xml
ERROR [error.validation.internal_error] Uncaught exception while validating: null

Validation complete.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04 LTS / Oracle Java 1.8.0_201
@fran-vallejo fran-vallejo added bug Something isn't working triage-needed labels Nov 19, 2019
@msbentley
Copy link

This issue was also discussed by email with @jordanpadams and @jshughes416 - possibly a two-part solution technical solution was needed, i.e. updated Schematron rule in the core dictionary to check the number instances of <Axis_Array> against and also address the error in validate. But the proposal was also made to re-visit allowing Array_1D rather than using the generic array class...

@jordanpadams jordanpadams changed the title Uncaught exception message when validating an array object Fix uncaught exception error when validating an array object Dec 12, 2019
@jordanpadams
Copy link
Member

@fran-vallejo would you mind attaching an example product for testing?

@fran-vallejo
Copy link
Author

@jordanpadams As we detected this problem validating a preliminary Bepi product that the user would prefer not to make public yet, I'll send you a copy by mail.

@msbentley
Copy link

msbentley commented Dec 13, 2019

As well as @fran-vallejo's email, find attached a test product which demonstrates the issue:
minimal_test_product_badarray.zip

which gives:

PDS Validate Tool Report

Configuration:
   Version                       1.17.5
   Date                          2019-12-13T16:14:01Z

Parameters:
   Targets                       [file:/home/mbentley/Dropbox/work/bepi/archive/minimal/array_test/]
   User Specified Catalogs       [/home/mbentley/Dropbox/work/bepi/xml_catalog_rewrite.xml]
   Severity Level                WARNING
   Recurse Directories           true
   File Filters Used             [*.xml, *.XML]
   Data Content Validation       on
   Product Level Validation      on
   Max Errors                    100000
   Registered Contexts File      /home/mbentley/Dropbox/software/pds/validate-1.17.5/resources/registered_context_products.json
   Non Registered Contexts File  /home/mbentley/Dropbox/work/bepi/repos/bepi.pds4/local_context_products.json



Product Level Validation Results

  PASS: gov.nasa.pds.validate.ValidateLauncher
      WARNING  [warning.product_not_registered]   Non-registered context products should only be used during archive development. All context products must be registered for a valid, released archive bundle. 

  FAIL: file:/home/mbentley/Dropbox/work/bepi/archive/minimal/array_test/minimal_test_product.xml
      ERROR  [error.label.context_ref_not_found]   line 36: 'Context product not found: urn:esa:psa:context:investigation:mission.test
      ERROR  [error.label.context_ref_not_found]   line 46: 'Context product not found: urn:esa:psa:context:instrument_host:spacecraft.test
      ERROR  [error.label.context_ref_not_found]   line 55: 'Context product not found: urn:esa:psa:context:instrument:test.test
      ERROR  [error.validation.internal_error]   Uncaught exception while validating: null

Validation complete.


Summary:

  4 error(s)
  1 warning(s)

  Message Types:
    3            error.label.context_ref_not_found
    1            error.validation.internal_error
    1            warning.product_not_registered

@jordanpadams jordanpadams added the duplicate This issue or pull request already exists label May 22, 2020
@jordanpadams jordanpadams reopened this Jul 30, 2020
@jordanpadams jordanpadams removed the duplicate This issue or pull request already exists label Jul 30, 2020
@jordanpadams
Copy link
Member

Note: this issue does not appear related to the memory footprint issue

@jordanpadams
Copy link
Member

implementation per #543 now throws a "bad_file_read" error.

@miguelp1986
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants