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

Casting error during validation with dynamically compiled modules #297

Open
aj-stein-gsa opened this issue Dec 13, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@aj-stein-gsa
Copy link
Contributor

aj-stein-gsa commented Dec 13, 2024

Describe the bug

It is unclear to me if this OSCAL-specific enough. I presume it is only an issue with OSCAL models validate-content -m ... instance.xml -c constraints.xml, but we need to confirm the issue with other models (perhaps inline Metaschema's own module definitions). If you perform such a command with an OSCAL model and document instance, you will receive an exception and stack trace.

Who is the bug affecting

Developers and engineers using validate-content for iterative development and debugging.

How do we replicate this issue

  1. Run a command like below with OSCAL content.
  2. Review the exception.
me@computer fedramp-automation % ~/opt/bin/oscal-cli --version
~/opt/bin/oscal-cli metaschema validate-content '/home/me/fedramp-automation/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml' -m  ~/Code/oscal/src/metaschema/oscal_complete_metaschema.xml -c '/home/me/fedramp-automation/src/validations/constraints/fedramp-external-allowed-values.xml' -c '/home/me/fedramp-automation/src/validations/constraints/fedramp-external-constraints.xml' -c '/home/me/fedramp-automation/src/validations/constraints/oscal-external-constraints.xml' --show-stack-trace
oscal-cli 2.5.0-SNAPSHOT built at 2024-12-12 07:03 from branch develop (9f449aa) at Unknown
liboscal-java  built at 2024-12-11 15:12 from branch develop (de0fe18) at https://github.com/metaschema-framework/liboscal-java
oscal v1.1.3 built at 2024-12-11 15:12 from branch develop (b123c11) at https://github.com/usnistgov/OSCAL.git
metaschema-java 2.2.0-SNAPSHOT built at 2024-12-12T06:54:11+0000 from branch feature/282-node-functions (8f88271) at Unknown
metaschema 2.2.0-SNAPSHOT built at 2024-12-12T06:54:11+0000 from branch b6601f7430f83f1a53a11bf32575b69e131bc912 (b6601f7) at https://github.com/metaschema-framework/metaschema.git
Loading 'file:/home/me/fedramp-automation/src/validations/constraints/fedramp-external-allowed-values.xml'
Loading 'file:/home/me/fedramp-automation/src/validations/constraints/fedramp-external-constraints.xml'
Loading 'file:/home/me/fedramp-automation/src/validations/constraints/oscal-external-constraints.xml'
Validating 'file:/home/me/fedramp-automation/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml' as XML.
Loading 'file:/home/me/oscal/src/metaschema/oscal_complete_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_catalog_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_control-common_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_metadata_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_profile_metaschema.xml'
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_profile_metaschema.xml' at 415:31�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_profile_metaschema.xml' at 416:31�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_profile_metaschema.xml' at 417:31�[m
Loading 'file:/home/me/oscal/src/metaschema/oscal_component_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_implementation-common_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_ssp_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_assessment-plan_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml'
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1377:22�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1379:22�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1381:22�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1382:22�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1383:22�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1491:19�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1492:19�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1493:19�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1494:19�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1495:19�[m
�[1;33mMissing property value in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml' at 1687:13�[m
Loading 'file:/home/me/oscal/src/metaschema/oscal_assessment-results_metaschema.xml'
Loading 'file:/home/me/oscal/src/metaschema/oscal_poam_metaschema.xml'
�[1;33mThe assembly 'group' from metaschema 'oscal-profile' is shadowing 'group' from metaschema 'oscal-catalog'�[m
Generating Java classes in: /var/folders/_q/y32s9yw56lb81l1sjgtp7k080000gn/T/metaschema-cli-97029244178910196
�[1;33mClass name 'Group', based on 'group' in 'file:/home/me/oscal/src/metaschema/oscal_profile_metaschema.xml', clashes with another bound class. Using 'GroupOscalProfile' instead.�[m
�[1;33mClass name 'ControlImplementation', based on 'control-implementation' in 'file:/home/me/oscal/src/metaschema/oscal_ssp_metaschema.xml', clashes with another bound class. Using 'ControlImplementationOscalSsp' instead.�[m
�[1;33mClass name 'ImplementedRequirement', based on 'implemented-requirement' in 'file:/home/me/oscal/src/metaschema/oscal_ssp_metaschema.xml', clashes with another bound class. Using 'ImplementedRequirementOscalSsp' instead.�[m
�[1;33mClass name 'Statement', based on 'statement' in 'file:/home/me/oscal/src/metaschema/oscal_ssp_metaschema.xml', clashes with another bound class. Using 'StatementOscalSsp' instead.�[m
�[1;33mClass name 'SelectControlById', based on 'select-control-by-id' in 'file:/home/me/oscal/src/metaschema/oscal_assessment-common_metaschema.xml', clashes with another bound class. Using 'SelectControlByIdOscalAssessmentCommon' instead.�[m

Expected behavior (i.e. solution)

The validate-content command should complete execution successfully without exceptions.

Other comments

No response

@david-waltermire
Copy link
Contributor

@aj-stein-gsa I don't see a stack trace in the output above. Am I missing something?

@david-waltermire david-waltermire moved this from To Triage to Blocked in Spec and Tooling Work Board Dec 19, 2024
@aj-stein-gsa
Copy link
Contributor Author

@aj-stein-gsa I don't see a stack trace in the output above. Am I missing something?

Ugh, I didn't realize in my haste that the log (even in GitHub Gist) is truncated. I will update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Blocked
Development

No branches or pull requests

2 participants