validate
validate copied to clipboard
validate's error message is difficult to trace
One data label within a collection is incorrect, and validate fails on it, but the output is misleading and indicates that the problem is with the bundle.xml. I've pared down the input so that the problem looks trivial, but I encountered this in a collection with ~hundreds of labels, and it took me quite a while to realize which files actually had the problem.
The attached directory g2/ has the error. To fix the error, search for and correct "elements" in the one label for Product_Observational
I'd say this has low priority since the problem goes away if the input is correct
% validate --version
gov.nasa.pds:validate Version 1.25.0-SNAPSHOT Release Date: 2021-03-23 00:13:27
Copyright 2019, by the California Institute of Technology ("Caltech"). All rights reserved.
% validate -R pds4.bundle -t g2
PDS Validate Tool Report
Configuration: Version 1.25.0-SNAPSHOT Date 2021-03-23T20:12:29Z
Parameters: Targets [file:/Users/rchen/Desktop/g2/] Rule Type pds4.bundle Severity Level WARNING Recurse Directories true File Filters Used [*.xml, *.XML] Data Content Validation on Product Level Validation on Allow Unlabeled Files false Max Errors 100000 Registered Contexts File /Users/rchen/PDS4tools/validate/resources/registered_context_products.json
Product Level Validation Results
PASS: file:/Users/rchen/Desktop/g2/bundle_gbo.ast.catalina.survey.xml
1 product validation(s) completed
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
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:71)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at gov.nasa.pds.tools.validate.rule.pds4.LabelInFolderRule$1.run(LabelInFolderRule.java:154)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.NullPointerException
at gov.nasa.pds.label.object.ArrayObject.findDimensions(ArrayObject.java:104)
at gov.nasa.pds.label.object.ArrayObject.
PASS: file:/Users/rchen/Desktop/g2/calibration/collection_calibration.xml 2 product validation(s) completed
PDS4 Bundle Level Validation Results
FAIL: file:/Users/rchen/Desktop/g2/calibration/mflat.V06.20210118.fits.xml ERROR [error.label.schema] line 109, 60: cvc-elt.3.1: Attribute 'http://www.w3.org/2001/XMLSchema-instance,nil' must not appear on element 'elements', because the {nillable} property of 'elements' is false. ERROR [error.label.schema] line 109, 60: cvc-type.3.1.1: Element 'elements' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'nilReason' was found. ERROR [error.label.schema] line 109, 60: cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[0-9]+' for type 'elements'. ERROR [error.label.schema] line 109, 60: cvc-type.3.1.3: The value '' of element 'elements' is not valid. ERROR [error.validation.internal_error] Uncaught exception while validating: null 1 integrity check(s) completed
PASS: file:/Users/rchen/Desktop/g2/calibration/collection_calibration.xml 2 integrity check(s) completed
PASS: file:/Users/rchen/Desktop/g2/bundle_gbo.ast.catalina.survey.xml 3 integrity check(s) completed
Summary:
5 error(s) 0 warning(s)
Product Validation Summary: 2 product(s) passed 0 product(s) failed 0 product(s) skipped
Referential Integrity Check Summary: 2 check(s) passed 1 check(s) failed 0 check(s) skipped
Message Types: 4 error.label.schema 1 error.validation.internal_error
End of Report Completed execution in 6795 ms g2.zip