Thread
#prefect-community
    s

    SImon Hawe

    2 years ago
    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

    josh

    2 years ago
    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

    SImon Hawe

    2 years ago
    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

    josh

    2 years ago
    Yeah the
    slack_message_formatter
    only attempts to talk to Cloud in the case of
    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

    SImon Hawe

    2 years ago
    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

    josh

    2 years ago
    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

    SImon Hawe

    2 years ago
    0.12.2 as posted above and thanks for opening a ticket
    j

    josh

    2 years ago
    Ah yes, my mistake, missed that. Definitely a bug, thanks for reporting it 👍