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

Array object validation regression in v3.0.3 #564

Closed
jordanpadams opened this issue Dec 1, 2022 · 3 comments · Fixed by #566
Closed

Array object validation regression in v3.0.3 #564

jordanpadams opened this issue Dec 1, 2022 · 3 comments · Fixed by #566
Assignees

Comments

@jordanpadams
Copy link
Member

🐛 Describe the bug

Looks like new version of validate is not properly validating array objects.

📜 To Reproduce

The data providers for the MRO SHARAD clutter sims bundle are running into an issue when using the new version of validate. These errors keep occurring:

$ validate-3.1.0-SNAPSHOT/bin/validate -t ~/test/geo_issue_20221201/s_07171001_sim.xml
 
  FAIL: file:/zippy/MARS/targ/modl/simc/pds/mro_sharad_simulations/data/s_0717xx/s_07171001/s_07171001_sim.xml
    Begin Content Validation: file:/zippy/MARS/targ/modl/simc/pds/mro_sharad_simulations/data/s_0717xx/s_07171001/s_07171001_sim.img
      FATAL_ERROR  [error.array.bad_file_read]   array 0: Error occurred while reading data file: Error occurred while trying to read data at location (2879, 607): null
      FATAL_ERROR  [error.array.bad_file_read]   array 0: Error occurred while reading data file: Error occurred while trying to read data at location (2879, 607): null
      FATAL_ERROR  [error.array.bad_file_read]   array 0: Error occurred while reading data file: Error occurred while trying to read data at location (2879, 607): null
    End Content Validation: file:/zippy/MARS/targ/modl/simc/pds/mro_sharad_simulations/data/s_0717xx/s_07171001/s_07171001_sim.img
        15 product validation(s) completed

🕵️ Expected behavior

Validates successfully

📚 Version of Software Used

3.0.3

🩺 Test Data / Additional context

Test data offline, but should be able to test with any product that has multiple arrays defined.


🦄 Related requirements

⚙️ Engineering Details

@jordanpadams
Copy link
Member Author

When adding a stacktrace to the exception thrown in ArrayContentValidator here:

https://github.com/NASA-PDS/validate/blob/main/src/main/java/gov/nasa/pds/tools/validate/content/array/ArrayContentValidator.java#L253

I get the following exception:

java.nio.channels.ClosedChannelException
	at java.base/sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:156)
	at java.base/sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:353)
	at java.base/sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:58)
	at gov.nasa.pds.objectAccess.array.ArrayAdapter$MappedBuffer.createNewBuffer(ArrayAdapter.java:297)
	at gov.nasa.pds.objectAccess.array.ArrayAdapter$MappedBuffer.getBuffer(ArrayAdapter.java:280)
	at gov.nasa.pds.objectAccess.array.ArrayAdapter.moveToPosition(ArrayAdapter.java:207)
	at gov.nasa.pds.objectAccess.array.ArrayAdapter.getDouble(ArrayAdapter.java:195)
	at gov.nasa.pds.label.object.ArrayObject.getDouble(ArrayObject.java:277)
	at gov.nasa.pds.tools.validate.content.array.ArrayContentValidator.validatePosition(ArrayContentValidator.java:234)
	at gov.nasa.pds.tools.validate.content.array.ArrayContentValidator.process(ArrayContentValidator.java:157)
	at gov.nasa.pds.tools.validate.content.array.ArrayContentValidator.process(ArrayContentValidator.java:148)
	at gov.nasa.pds.tools.validate.content.array.ArrayContentValidator.validate(ArrayContentValidator.java:122)
	at gov.nasa.pds.tools.validate.rule.pds4.ArrayValidator.validateDataObjectContents(ArrayValidator.java:100)
	at gov.nasa.pds.tools.validate.rule.pds4.ArrayValidator.validate(ArrayValidator.java:62)
	at gov.nasa.pds.tools.validate.rule.pds4.DataDefinitionAndContentValidationRule.validate(DataDefinitionAndContentValidationRule.java:87)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at gov.nasa.pds.tools.validate.rule.AbstractValidationRule.execute(AbstractValidationRule.java:64)
	at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
	at gov.nasa.pds.tools.validate.task.ValidationTask.execute(ValidationTask.java:130)
	at gov.nasa.pds.tools.validate.task.BlockingTaskManager.submit(BlockingTaskManager.java:26)
	at gov.nasa.pds.tools.label.LocationValidator.validate(LocationValidator.java:284)
	at gov.nasa.pds.validate.ValidateLauncher.doValidation(ValidateLauncher.java:1402)
	at gov.nasa.pds.validate.ValidateLauncher.processMain(ValidateLauncher.java:1688)
	at gov.nasa.pds.validate.ValidateLauncher.main(ValidateLauncher.java:1737)

Looks like we are not properly opening/closing the object reader

jordanpadams added a commit that referenced this issue Dec 1, 2022
Previous functionality opened and closed the reader within a recursive method. Moved thie open/close up a level in execution.

Resolves #564
@acraugh
Copy link

acraugh commented Dec 2, 2022

We ran into this problem validating Atlas data at SBN/UMD and were just about to report it. If you need a tester for the fix, we're standing by.

jordanpadams added a commit that referenced this issue Dec 2, 2022
Previous functionality opened and closed the reader within a recursive method. Moved thie open/close up a level in execution.

Resolves #564
@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.

3 participants