Sean Han
04/05/2023, 4:56 PM@slack_on_failure("#{channel}".format(channel=os.getenv("SLACK_CHANNEL")), dagit_base_url=os.getenv("DAGIT_BASE_URL"))
@job(resource_defs={"scheduled_date": make_values_resource(), 'slack': slack_resource}, op_retry_policy=default_policy)
def my_job():
...
@schedule(job=direct_mail_job, cron_schedule="0 0 * * *" , execution_timezone="US/Eastern")
def direct_mail_job_schedule(context: ScheduleEvaluationContext):
scheduled_date = context.scheduled_execution_time.strftime("%Y-%m-%d")
return RunRequest(
run_config={"resources": {"scheduled_date": {"config": scheduled_date,}, 'slack': {'config': {'token': os.getenv('SLACK_TOKEN')}}}}
)
It is working fine when I run in my local using launchpad. For some reason, when the job ran on a schedule in ECS, it failed with the following error. I have an environment variable SLACK_TOKEN
configured.
dagster._core.errors.DagsterInvalidConfigError: Error in config for job
Error 1: Value at path root:resources:slack:config:token must not be None. Expected "(String | { env: String })"
File "/usr/local/lib/python3.9/site-packages/dagster/_grpc/impl.py", line 498, in get_external_execution_plan_snapshot
create_execution_plan(
File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/api.py", line 958, in create_execution_plan
resolved_run_config = ResolvedRunConfig.build(pipeline_def, run_config, mode=mode)
File "/usr/local/lib/python3.9/site-packages/dagster/_core/system_config/objects.py", line 166, in build
raise DagsterInvalidConfigError(
second question, since this schedule, the job failed to run, it shows 'Failure' for this schedule (see screenshot below). How can I re-run this schedule if I fix the job?daniel
04/05/2023, 5:01 PMSean Han
04/05/2023, 5:27 PMdaniel
04/06/2023, 5:40 PM