Occasionally, but apparently unpredictably, the suite I’m developing fails during a run for an odd (to me) reason. The Cylc Users Guide tells me that CYLC_SUITE_OWNER is a variable defined by Cylc and available to my suite task scripts. I access it in a Python task script with:
CYLC_SUITE_OWNER = os.environ[‘CYLC_SUITE_OWNER’]
But occasionally, this command fails: the environment variable is unknown, e.g.
$ more job.err Traceback (most recent call last): File "~/cylc_work/NIMO/bin/fetch_dynamic_params.py", line 11, in <module> from NIMO_utils import writelog, debug_var_dump, cleanup_workspace, \ File "~/cylc_work/NIMO/bin/NIMO_utils.py", line 11, in <module> from constants_cylc import * File "~/cylc_work/NIMO/bin/constants_cylc.py", line 29, in <module> CYLC_SUITE_OWNER = os.environ['CYLC_SUITE_OWNER'] File "/opt/rh/rh-python36/root/usr/lib64/python3.6/os.py", line 669, in __getitem__ raise KeyError(key) from None KeyError: 'CYLC_SUITE_OWNER' 2020-05-27T20:45:03Z CRITICAL - failed/EXIT $
Maybe 49 out of 50 runs, this doesn’t come up; but I just got bit by the 1/50 again, and decided to ask. Anyone have any idea why this would happen? Using cylc-flow-7.8.3.