jonvet
06/13/2022, 10:35 AMslack_failure_sensor = make_slack_on_run_failure_sensor(
channel=f"#dagster-notifications-{os.getenv('RUNTIME_ENVIRONMENT')}",
slack_token=os.getenv("DAGSTER_SLACK_TOKEN"),
blocks_fn=get_error_blocks,
)
I checked that the daemon has those 2 environment variables set, here is the slack channel. I’m omitting the slack token of course, but it is set as well.
>>> import os
>>> print(f"#dagster-notifications-{os.getenv('RUNTIME_ENVIRONMENT')}")
#dagster-notifications-prd
When a pipeline fails I’m getting this error:
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: <https://www.slack.com/api/chat.postMessage>)
The server responded with: {'ok': False, 'error': 'channel_not_found'}
any idea where I’m going wrong here? our slack has the channel `dagster-notifications-prd`I should also say that it works when I run it locally (run dagster & dagit & daemon on my laptop & make a job fail -> it posts on our slack)jonvet
06/13/2022, 10:55 AMfrom slack_sdk.web.client import WebClient
slack_client = WebClient(token=os.getenv("DAGSTER_SLACK_TOKEN"))
slack_client.chat_postMessage(channel=f"#dagster-notifications-{os.getenv('RUNTIME_ENVIRONMENT')}", blocks=[], text="asd")
but before I was able to that I had to pip install dagster-slack
on the daemon. I wasn’t able to import
from slack_sdk.web.client import WebClient
I think that means that my daemon isn’t running the correct image. I didn’t set it explicitly so I’m guessing it’s just running the image "<http://docker.io/dagster/dagster-celery-k8s|docker.io/dagster/dagster-celery-k8s>"
. is there an image that has all dagster dependencies (including dagster-slack
) installed?jonvet
06/13/2022, 11:08 AMdagster-slack
isn’t part of the docker image or should that be added?daniel
06/13/2022, 3:40 PMdaniel
06/13/2022, 3:40 PMjonvet
06/13/2022, 3:47 PMdagster-user-deployments
has dagster-slack
installeddaniel
06/13/2022, 3:48 PMjonvet
06/13/2022, 3:54 PMdagster-user-deployments
might actually be missing my RUNTIME_ENVIRONMENT
environment variable. sorry thought that had to be set in the daemonjonvet
06/13/2022, 3:54 PM