Hi there! :wave: I'm using Prefect v0.15.0 and fo...
# ask-community
t
Hi there! šŸ‘‹ I'm using Prefect v0.15.0 and following the docs to set up slack notifications and I'm getting an odd error:
Copy code
Exception raised while calling state handlers: ValueError("Failed to find current tenant None in result {'data': {'tenant': [{'slug': 'myTenant', 'id': myTenantId}]}}")
Any ideas to what could be causing this?
I've added a
SLACK_WEBHOOK_URL
secret in Prefect Cloud and have a flow set up like this:
Copy code
from prefect import Flow
from prefect.engine.state import Success
from prefect.tasks.secrets import PrefectSecret
from prefect.utilities.notifications import slack_notifier


handler = slack_notifier(only_states=[Success])

with Flow(
    "main_flow",
    ,...,
    state_handlers=[handler]
) as flow:
    secret = PrefectSecret("SLACK_WEBHOOK_URL")
    flow.add_task(secret)
The flow tasks succeed but the flow then fails on the given error
z
Hi @Tom Blake a few questions that should help us get to the bottom of this • what kind of agent are you running? • was this flow working before? • are you using an API Key or deprecated API Token?
t
Hi @Zach Angell! Thanks for helping out šŸ™‚ • We're running a kubernetes agent on AKS - this agent has no altered config from the one generated when running
prefect agent kubernetes install
• Yup this flow was working before. We only started seeing the error when we added the slack handler. The tasks all succeed as usual but now it's failing when calling the state handler • We're using a Service account API key
z
Thanks for the info! This seems like a bug in Prefect 0.15.0. We're tracking down the root cause and I'll keep you updated when the fix is out
šŸ’Ŗ 1
t
Legend - cheers Zach šŸ‘
z
Hi @Tom Blake upgrading your agent to the latest Prefect Core release, 0.15.1, should fix the bug you were seeing https://github.com/PrefectHQ/prefect/releases/tag/0.15.1. Please let me know if you're still running into trouble!
āœ… 1
t
The notifications are coming through! šŸŽ‰ Thanks for the quick turnaround @Zach Angell šŸ‘
šŸš€ 1