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

Validate fails to read files on Windows systems after Internal Reference check updates (#308) #809

Closed
jennifergward opened this issue Jan 12, 2024 · 19 comments · Fixed by #818
Assignees
Labels
B14.1 bug Something isn't working i&t.done s.high

Comments

@jennifergward
Copy link

jennifergward commented Jan 12, 2024

Checked for duplicates

Yes - I've already checked

🐛 Describe the bug

For a CSV containing multiple tables, validate 3.1.1 reports the following error on a table that we think is properly defined in the label:

ERROR  [error.label.invalid_object_definition]   line 2: Invalid object definition for object #2.  The previously defined object ends at byte 354958. Offset defined in label: 25
ERROR  [error.label.invalid_object_definition]   line 3: Invalid object definition for object #3.  The previously defined object ends at byte 354958. Offset defined in label: 7751  
Note: The PDS4Viewer opens this file with no issues.

We tried to check with validate 3.4.1 to see if this issue has been fixed already, but we get another error:

FAIL: file:/X:/staff-folders/ward/clipper/RSS001E01_2031066T0241_EURGRVL20XXXXXXGSFC_COV010.xml
      ERROR  [error.validation.internal_error]   Uncaught exception while validating: null

🕵️ Expected behavior

We think the CSV and XML are valid and validate shouldn't be reporting any errors.

📜 To Reproduce

validate RSS001E01_2031066T0241_EURGRVL20XXXXXXGSFC_COV010.xml -R pds4.label -r report.txt
(note: you will get errors due to the absence of the Clipper Mission dictionary which isn't online yet. I can send a copy if helpful.)

🖥 Environment Info

  • Version of this software: v3.1.1, v3.4.1
  • Operating System: Windows

📚 Version of Software Used

Validate v3.1.1 and Validate v3.4.1

🩺 Test Data / Additional context

validate_bug.zip

🦄 Related requirements

🦄 #308

User also indicated seeing this on the discussion board: #811

⚙️ Engineering Details

After some investigation and testing on Windows, we started getting these errors on Windows when trying to resolve a path:

Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 2: 
...

which can be traced to https://github.com/NASA-PDS/validate/blob/main/src/main/java/gov/nasa/pds/tools/validate/CrossLabelFileAreaReferenceChecker.java#L19

Per https://stackoverflow.com/questions/43972777/java-nio-file-invalidpathexception-illegal-char-at-index-2, on Windows, we need to translate the URL to a URI vs. a path.

I&T

TestRail Test ID: T8681197

@jordanpadams
Copy link
Member

@jennifergward it doesn't look like the CLIPPER SCH/XSD are posted online yet. Can you provide those as well?

@jordanpadams
Copy link
Member

@jennifergward for v3.4.1, if I remove the CLIPPER references, and validate, it appears to execute successfully:

~/test/validate-3.4.1/bin/validate -t ~/Downloads/validate_bug/RSS001E01_2031066T0241_EURGRVL20XXXXXXGSFC_COV010.xml

My guess is it may have to do with your catalog file. Can you also supply that?

@jennifergward
Copy link
Author

When I remove the Clipper references, I get the attached error in report_noclipper.txt. I'm using your same command above with version 3.4.1.

Attached is my catalog file and also the Clipper dictionary. Thanks for the help!
attachments.zip

@jordanpadams
Copy link
Member

@jennifergward can you confirm you have tested this with the latest v3.4.1 of validate? I am having difficulty replicating this error.

@jennifergward
Copy link
Author

@jordanpadams Confirmed. We also tested v3.4.1 on other files and bundles, and confirmed that this issue is bigger than the EC file. Attached are validate reports after running 3.1.1 vs. 3.4.1 on a bundle. We're thinking this is a Windows issue.
arcdr_bundle_3-1-1.txt
arcdr_bundle_3-4-1.txt

@jordanpadams
Copy link
Member

Thanks @jennifergward we will take a look.

@github-project-automation github-project-automation bot moved this to Release Backlog in B14.1 Jan 23, 2024
@jordanpadams jordanpadams changed the title Validate has issues with CSV containing multiple tables Validate fails to read files on Windows systems after Internal Reference check updates (#308) Jan 24, 2024
jordanpadams added a commit that referenced this issue Jan 24, 2024
When using Path.of() we need to pass a URI on a Windows machine, not the Path.

Resolves #809
@jordanpadams
Copy link
Member

@jennifergward I have a beat on a fix. Just awaiting a review from someone on the team and we should be good to go. Will tag and release with the update as soon as we have it.

#818

@github-project-automation github-project-automation bot moved this from Release Backlog to 🏁 Done in B14.1 Feb 9, 2024
@jordanpadams
Copy link
Member

@jennifergward can you try out the latest SNAPSHOT of validate and let me know if it works? https://github.com/NASA-PDS/validate/releases/tag/v3.5.0-SNAPSHOT

@jennifergward
Copy link
Author

@jordanpadams It still doesn't work.

validate_report_240212.txt

screenshot

@jordanpadams
Copy link
Member

@jennifergward copy! Sorry about that. I wasn't running it exactly as you were. But looks like a different error, which is great! :-)

@jordanpadams
Copy link
Member

@jennifergward what version of java are you running?

java -version

@jennifergward
Copy link
Author

@jordanpadams
Looks like the machine I had just used has a pretty old version of java. This one produces the errors I sent this morning.
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

Using a different machine with a newer version produces the old errors from my initial ticket
(validate_report_240212_java11.0.12.txt)
openjdk version "11.0.12" 2021-07-20 LTS
OpenJDK Runtime Environment Zulu11.50+19-CA (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM Zulu11.50+19-CA (build 11.0.12+7-LTS, mixed mode)
I've been told by various sources that this error isn't seen when a non-Windows machine is used.

@jordanpadams
Copy link
Member

@jennifergward ok. I have been testing all of this on a windows virtual machine and it works for some reason. I will revisit in the morning and see if there is something I’m missing.

@jennifergward
Copy link
Author

jennifergward commented Feb 13, 2024 via email

@jennifergward
Copy link
Author

I did goof and now confirm that I get that same java error with the new 3.5.0 Snapshot no matter which version of java.

screenshot_240213

screenshot_240213_2

@jordanpadams
Copy link
Member

@jennifergward I think something weird may be happening here. Can you verify if you have a JAVA_HOME set in your environment variables that points to Java 8?

It appears your PATH may have the correct Java 11 loaded, but your JAVA_HOME may be still pointed at Java 8.

@jordanpadams
Copy link
Member

echo %JAVA_HOME%

@jennifergward
Copy link
Author

@jordanpadams Is Java 11 required to run the newest validate?

@jordanpadams
Copy link
Member

@jennifergward Yes. Unfortunately, Java 8 was end of life in 2019, so we upgraded ~1-2 years ago. We just started using some of the new methods in Java 11+ in the past 6-12 months, which is why I believe you encountered this exception.

For more information on the system requirements see: https://nasa-pds.github.io/validate/install/index.html#java-runtime-environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B14.1 bug Something isn't working i&t.done s.high
Projects
No open projects
Status: 🏁 Done
Development

Successfully merging a pull request may close this issue.

3 participants