Hey folks - I'm having an issue setting up Slack n...
# ask-community
c
Hey folks - I'm having an issue setting up Slack notifications within my local environment. More information in 🧵
I went through this process of setting up a webhook https://docs.prefect.io/core/advanced_tutorials/slack-notifications.html#installation-instructions And I saved the webhook URL within my
.prefect/config.toml
file per the instructions
I used Postman to send a test "Hello, World" message to the Slack channel and was able to receive it. I also executed
Copy code
print(prefect.context.secrets.get("SLACK_WEBHOOK_URL"))
within my Python code to ensure that I can receive the webhook URL
However when I run the Flow locally, I get this error message:
Copy code
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=4200): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8328313c70>: Failed to establish a new connection: [Errno 61] Connection refused'))
k
This looks like a different error than the Slack Webhook URL? Are you on Server or Cloud?
c
I've got the following versions of the modules installed:
Copy code
prefect==0.14.21
requests==2.25.1
urllib3==1.26.5
I included the latter two modules since I figured they may be relevant to this error message, but I'm unsure.
I believe we're on the Cloud
k
It seems like you’re hitting server. Can you try doing
prefect backend cloud
in the command line?
c
Executed the command line and it informed me that it switched to the cloud. I get a different error message now when executing the Flow locally, which I believe I understand.
Copy code
ERROR - prefect.TaskRunner | Unexpected error while calling state handlers: ClientError('Malformed response received from Cloud - please ensure that you have an API token properly configured.')
Seems to be a matter of getting the API token configured?
k
Did you run flows successfully already?
I am wondering if you were on server instead of cloud
c
Not yet - had to step away from the computer for a bit, but I'm looking at this again. Will provide an update in a bit
Got it figured out! I never actually went through the setup on my local machine to have a Cloud token on it after we switched from Server to Cloud, so once I got that setup done, I was able to send Slack messages successfully. So cool! Many thanks for the assistance! I'll make a note to read through the Prefect documentation for getting things set up correctly.
k
Oh no worries at all! I was just trying to figure out if you were on server or cloud. Glad you got it sorted out!
🙏 1