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?
Tom Blake
07/09/2021, 8:13 AM
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
Zach Angell
07/09/2021, 1:21 PM
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
Tom Blake
07/10/2021, 6:40 AM
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
Zach Angell
07/11/2021, 5:55 PM
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
Tom Blake
07/12/2021, 12:24 AM
Legend - cheers Zach š
z
Zach Angell
07/13/2021, 2:08 PM
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
Tom Blake
07/14/2021, 9:20 AM
The notifications are coming through! š
Thanks for the quick turnaround @Zach Angell š
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.