Matthew Blau
02/01/2021, 7:40 PMException raised while calling state handlers: ClientError('400 Client Error: Bad Request for url: <http://host.docker.internal:4200/graphql>\n\nThe following error messages were provided by the GraphQL server:\n\n GRAPHQL_VALIDATION_FAILED: Cannot query field "secret_value" on type "Query".\n\nThe GraphQL query was:\n\n query($name: String!) {\n secret_value(name: $name)\n }\n\nThe passed variables were:\n\n {"name": "SLACK_WEBHOOK_URL"}\n')
what am I doing wrong? I have @task(state_handlers=[slack_notifier]) set for the task I am testing out the notification for.Kyle Moon-Wright
02/01/2021, 7:50 PMSLACK_WEBHOOK_URL
by some means, perhaps as a secret in your config.toml file? Just checking here first.
If this isn’t the issue, then there may be some version mismatch - so I’d recommend updating to the latest version of Prefect or at least ensuring the flow you are submitting is a lesser version than your Server and Agent.Matthew Blau
02/01/2021, 7:51 PMKyle Moon-Wright
02/01/2021, 7:57 PMMatthew Blau
02/01/2021, 8:24 PM[1 Feb 2021 3:21pm]: Exception raised while calling state handlers: ClientError('400 Client Error: Bad Request for url: <http://host.docker.internal:4200/graphql>\n\nThe following error messages were provided by the GraphQL server:\n\n GRAPHQL_VALIDATION_FAILED: Cannot query field "secret_value" on type "Query".\n\nThe GraphQL query was:\n\n query($name: String!) {\n secret_value(name: $name)\n }\n\nThe passed variables were:\n\n {"name": "SLACK_WEBHOOK_URL"}\n')
So it would appear that something is working, but is failing further down the chain of execution. I have the Slack Cloudhook set in the UIAmanda Wee
02/01/2021, 8:31 PMKyle Moon-Wright
02/01/2021, 8:35 PMstate_handler
using Slack rather than the slack_notifier
.Matthew Blau
02/02/2021, 3:19 PMdef post_to_slack(task, old_state, new_state):
my_secret = Secret("SLACK_WEBHOOK_URL").get()
if new_state.is_retrying():
msg = "Task {0} failed and is retrying at {1}".format(task, new_state.start_time)
# replace URL with your Slack webhook URL
<http://requests.post|requests.post>(my_secret, json={"text": msg})
elif new_state.is_failed():
msg = "Task {0} failed".format(task)
# replace URL with your Slack webhook URL
<http://requests.post|requests.post>(my_secret, json={"text": msg})
return new_state
following that link you provided @Kyle Moon-Wright and I am still experiencing the error in my initial message. Not completely sure what I am doing wrong at present