-
Notifications
You must be signed in to change notification settings - Fork 18
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
Journal error_channel
raises errors, which mask subsequent raised errors
#129
Comments
Related to this: @gracebato and I noticed that when you run older YAMLs with an updated COMPASS, the workflow fails since the schema has changed (as expected), but the error message is buried in the middle of a long traceback: $ s1_cslc.py geo_runconfig_20180902_t087_185679_iw1.yaml
journal: Validation fail for s1_cslc_geo runconfig yaml stack-no-lut/runconfigs/geo_runconfig_20180902_t087_185679_iw1.yaml.
Traceback (most recent call last):
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/utils/runconfig.py", line 64, in load_validate_yaml
yamale.validate(schema, data)
File "/u/aurora-r0/staniewi/miniconda3/envs/mapping/lib/python3.10/site-packages/yamale/yamale.py", line 43, in validate
raise YamaleError(results)
yamale.yamale_error.YamaleError: Error validating data 'stack-no-lut/runconfigs/geo_runconfig_20180902_t087_185679_iw1.yaml' with schema '/u/aurora-r0/staniewi/repos/COMPASS/src/compass/schemas/s1_cslc_geo.yaml'
runconfig.groups.processing.geocoding.output_format: Unexpected element
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/u/aurora-r0/staniewi/miniconda3/envs/mapping/bin/s1_cslc.py", line 8, in <module>
sys.exit(main())
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/s1_cslc.py", line 49, in main
run(parser.run_config_path, parser.args.grid_type)
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/s1_cslc.py", line 40, in run
cfg = GeoRunConfig.load_from_yaml(run_config_path, 's1_cslc_geo')
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/utils/geo_runconfig.py", line 65, in load_from_yaml
cfg = load_validate_yaml(yaml_path, workflow_name)
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/utils/runconfig.py", line 67, in load_validate_yaml
error_channel.log(err_str)
journal.ext.journal.ApplicationError: runconfig.load_validate_yaml: application error The final line, where the most relevant error usually is, doesn't say anything useful in this case, and the first error line from journal only starts to give the hint If we were to change this section where there's a lot of COMPASS/src/compass/utils/runconfig.py Lines 38 to 80 in a8252f5
to just something like schema = yamale.make_schema(f'{helpers.WORKFLOW_SCRIPTS_DIR}/schemas/{schema_name}.yaml', parser='ruamel')
data = yamale.make_data(yaml_runconfig, parser='ruamel')
yamale.validate(schema, data) Then the error becomes more clear at the bottom: $ s1_cslc.py stack-no-lut/runconfigs/geo_runconfig_20180902_t087_185679_iw1.yaml
Traceback (most recent call last):
File "/u/aurora-r0/staniewi/miniconda3/envs/mapping/bin/s1_cslc.py", line 8, in <module>
sys.exit(main())
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/s1_cslc.py", line 49, in main
run(parser.run_config_path, parser.args.grid_type)
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/s1_cslc.py", line 40, in run
cfg = GeoRunConfig.load_from_yaml(run_config_path, 's1_cslc_geo')
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/utils/geo_runconfig.py", line 65, in load_from_yaml
cfg = load_validate_yaml(yaml_path, workflow_name)
File "/u/aurora-r0/staniewi/repos/COMPASS/src/compass/utils/runconfig.py", line 51, in load_validate_yaml
yamale.validate(schema, data)
File "/u/aurora-r0/staniewi/miniconda3/envs/mapping/lib/python3.10/site-packages/yamale/yamale.py", line 43, in validate
raise YamaleError(results)
yamale.yamale_error.YamaleError: Error validating data 'stack-no-lut/runconfigs/geo_runconfig_20180902_t087_185679_iw1.yaml' with schema '/u/aurora-r0/staniewi/repos/COMPASS/src/compass/schemas/s1_cslc_geo.yaml'
runconfig.groups.processing.geocoding.output_format: Unexpected element |
This is fixable with some config setting for Additionally (requiring an issue in
|
Right now we have a number of places that do something like
but that way
journal
is set up, anything logged to theerror
channel or higher (the fatal channel) will raise it's own python error:( in
testjournal.py
)I think we have two options
raise ....
statements after all our logging with journal to the error channelValueError, OSError, PermisionsError
) to be raised, we'll need to change which channel we're logging twoI only bring up 2 as an option because the error raised will always be a
journal.ext.journal.ApplicationError
The text was updated successfully, but these errors were encountered: