Hey guys. I have a question regarding prefect 0.12...
# prefect-community
s
Hey guys. I have a question regarding prefect 0.12.2 and the slack_notifier. We are running on prefect core without prefect cloud. By default, the slack notifier tries to connect to the prerect cloud server to get some api token in slack_message_formatter in notifications.py. looks like if there is a prefect.context.flow_run_id and prefect.config.backend is set to cloud, try to connect to cloud. I have tried to both set flow_run_id to None and also backend to "cloud" but that only had an effect when the flow itself tried to connect to slack. It did not had an effect on individual tasks. Is there any propper way of configuring this, other than a local prefect/backend.toml?
j
Hi @SImon Hawe the Slack notifier should not need to be used in conjunction with a backend API. Here’s a tutorial for using it that is entirely local https://docs.prefect.io/core/advanced_tutorials/slack-notifications.html#slack-notifications
s
Thanks. This is basically exactly what we are doing. What I was referring to is from the prefect core code the function slack_message_formatter which tries to access prefect cloud to update the notification payload
j
Yeah the
slack_message_formatter
only attempts to talk to Cloud in the case of
Copy code
if prefect.context.get("flow_run_id"):
which means that if you’re running in an instance where this value isn’t placed in context then it shouldn’t be of any concern since it will be skipped over.
s
yes, that's what I have seen. However it gets set somewhere. Need to find that out as I can't remember actively setting that one
j
Which version of prefect are you on? Looking into it I actually think something may have been changed recently which could be causing this 🤔
@SImon Hawe I think I found the bug an opened a ticket here https://github.com/PrefectHQ/prefect/issues/2930
s
0.12.2 as posted above and thanks for opening a ticket
j
Ah yes, my mistake, missed that. Definitely a bug, thanks for reporting it 👍