Enabling NOTIFICATIONS may lead to errors with NOTIFY_ON (or if it's not present)
Autosubmit Version
master
, 4.1.11
Summary
If you create a simple workflow, with just one task, and enable notifications with this:
mail:
# Enable mail notifications for remote_failures
# Default:True
NOTIFY_ON_REMOTE_FAIL: True
# Enable mail notifications
# Default: False
NOTIFICATIONS: True
# Mail address where notifications will be received
TO: bruno@blabla.blabla
Without adding NOTIFY_ON
to the sole job, you will get:
Successful check job command: nohup kill -0 623 > /dev/null 2>&1; echo $?
Successful check job command: nohup kill -0 633 > /dev/null 2>&1; echo $?
Job a030_20221101_fc0_1_A is RUNNING
Traceback (most recent call last):
File "/home/kinow/Development/python/workspace/autosubmit/bin/autosubmit", line 36, in main
return_value = Autosubmit.parse_args()
File "/home/kinow/Development/python/workspace/autosubmit/autosubmit/autosubmit.py", line 711, in parse_args
return Autosubmit.run_experiment(args.expid, args.notransitive,args.start_time,args.start_after, args.run_only_members, args.profile)
File "/home/kinow/Development/python/workspace/autosubmit/autosubmit/autosubmit.py", line 2264, in run_experiment
Autosubmit.job_notify(as_conf,expid,job,job_prev_status,job_changes_tracker)
File "/home/kinow/Development/python/workspace/autosubmit/autosubmit/autosubmit.py", line 1837, in job_notify
if Status.VALUE_TO_KEY[job.status] in job.notify_on:
AttributeError: 'Job' object has no attribute 'notify_on'
[CRITICAL] Unexpected error: 'Job' object has no attribute 'notify_on'.
Please report it to Autosubmit Developers through Git
More info at https://autosubmit.readthedocs.io/en/master/troubleshooting/error-codes.html
The issue was found by @apuiggro.
Steps to reproduce
# local project, you can use SCRIPT instead
EXPERIMENT:
DATELIST: 20221101 #Startdate
MEMBERS: fc0
CHUNKSIZEUNIT: month
# SPLITSIZEUNIT: day
NUMCHUNKS: 2
CHUNKSIZE: 2
#SPLITSIZE: 1
CHUNKINIT: ''
SPLITPOLICY: flexible
CALENDAR: standard
JOBS:
A:
FILE: wait_1_hour.sh
RUNNING: chunk
PLATFORM: fake-ssh
# NOTIFY_ON: RUNNING
PLATFORMS:
fake-ssh:
TYPE: ps
HOST: fake-ssh
SCRATCH_DIR: /tmp
USER: autosubmit
mail:
# Enable mail notifications for remote_failures
# Default:True
NOTIFY_ON_REMOTE_FAIL: True
# Enable mail notifications
# Default: False
NOTIFICATIONS: True
# Mail address where notifications will be received
TO: bruno@blabla.blabal
What is the current bug behavior?
Python error.
What is the expected correct behavior?
Nothing, no notification as there is no notify_on.
Relevant logs and/or screenshots(if applicable)
Above.
Any other relevant information(if applicable)
()