Dekel R
05/11/2022, 7:50 AMException raised while calling state handlers: ClientError([{'path': ['secret_value'], 'message': 'An unknown error occurred.', 'extensions': {'code': 'INTERNAL_SERVER_ERROR'}}])
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/prefect/client/secrets.py", line 137, in get
value = secrets[self.name]
KeyError: 'SLACK_WEBHOOK_URL'
I get this error randomly once in a while - anyone have the same issue?
I didn’t reregister or touched the 2 flows for at least 2 months now.
ThanksAnna Geller
05/11/2022, 11:07 AMDekel R
05/11/2022, 12:19 PMhandler = slack_notifier(only_states=[Failed])
@task(state_handlers=[handler])
def get_relevant_dates(param_date: str) -> datetime.date:
logger = prefect.context.get(LOGGER_NAME)
if param_date is None:
param_date = pendulum.yesterday(tz="America/New_York").subtract(days=1).date()
else:
try:
param_date = datetime.strptime(param_date, '%d-%m-%y').date()
except Exception as e:
logger.error(e)
return param_date
Anna Geller
05/11/2022, 12:26 PMKevin Kho
05/11/2022, 1:29 PMslack_notifier
handler that they attached to the taskslack_notifier
multiple times in the Flow, you can add the secret to storage
flow.storage = Storage(…, secrets=["SLACK_WEBHOOK_URL"])
Anna Geller
05/11/2022, 1:31 PMSlackTask(message=msg).run()
insteadDekel R
05/11/2022, 2:17 PMAnna Geller
05/11/2022, 2:41 PM