esm-tools / esm_tools

Simple Infrastructure for Earth System Simulations
https://esm-tools.github.io/
GNU General Public License v2.0
26 stars 12 forks source link

esm_master stores available config files and crashes due to outdated pickle file, in case one is removed #1227

Open hajlaci opened 1 month ago

hajlaci commented 1 month ago

Error message:

esm_master
Traceback (most recent call last):
  File "/home/a/a270270/.local/bin/esm_master", line 33, in <module>
    sys.exit(load_entry_point('esm-tools', 'console_scripts', 'esm_master')())
  File "/home/a/a270270/esm_tools/src/esm_master/cli.py", line 103, in main
    main_flow(parsed_args, target)
  File "/home/a/a270270/esm_tools/src/esm_master/esm_master.py", line 30, in main_flow
    setups2models = setup_and_model_infos(vcs, main_infos, parsed_args)
  File "/home/a/a270270/esm_tools/src/esm_master/compile_info.py", line 348, in __init__
    self.config, self.relevant_entries = combine_components_yaml(parsed_args)
  File "/home/a/a270270/esm_tools/src/esm_master/compile_info.py", line 92, in combine_components_yaml
    asyncio.get_event_loop().run_until_complete(
  File "/sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/a/a270270/esm_tools/src/esm_master/compile_info.py", line 147, in get_all_package_info
    await asyncio.gather(*tasks, return_exceptions=False)
  File "/home/a/a270270/esm_tools/src/esm_master/compile_info.py", line 177, in get_one_package_info
    comp_config = esm_parser.yaml_file_to_dict(default_file)
  File "/home/a/a270270/esm_tools/src/esm_parser/yaml_to_dict.py", line 237, in yaml_file_to_dict
    raise FileNotFoundError(
FileNotFoundError: All file extensions tried and none worked for /home/a/a270270/esm_tools/configs//components/lpj-guess/lpj-guess.yaml

remove the pickle file under config esm_software/esm_master did not help

mandresm commented 1 month ago

Hi!

I think I found the problem, ESM-Tools expects that each folder in the components has at least one file called like the component itself followed by .yaml. You guys have removed the yaml file but not the directory (configs//components/lpj-guess), and hence the error.

I'll be fixing this hopefully this week, esm_master should not crash in this instance if the directory is empty, it should simply not list this component.