Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to add a Slack channel with specific name to Alerts #19664

Closed
hayzem opened this issue Jul 1, 2020 · 15 comments
Closed

Not able to add a Slack channel with specific name to Alerts #19664

hayzem opened this issue Jul 1, 2020 · 15 comments

Comments

@hayzem
Copy link

hayzem commented Jul 1, 2020

Important Details

How are you running Sentry?
Saas (sentry.io)

Description

Added sentry to two private channels #api and #api-log.
On Alerts section of the project added new alert for #api which worked fine.
Then I wanted to switch channel to #api-log but it complained that:
The slack resource "api-log" does not exist or has not been granted access in the {workspace name} Slack workspace.
But this message is not correct since @sentry added to both channels and working well on the other channel(#api).

While I was writing this on I wanted to give another shot with different names and they worked fine.
#the-team worked (so it is not just a dash issue)
#api-p-log-stage also worked.

Steps to Reproduce

  1. Add @sentry app to channels one has dash(-) or underscore(_) or log in the name, the other just letters.
  2. Add an Alert on Sentry
  3. The channel named #api-log will not be added.

Good items to include here include:
The slack resource "api-log" does not exist or has not been granted access in the {workspace name} Slack workspace.

What you expected to happen

Being able to add channel to Alerts.

Possible Solution

Unfortunately, no suggestion.
I'm wondering if this is related to any specific settings for that channel. I will research and update here.

@pratheekhegde
Copy link

pratheekhegde commented Jul 1, 2020

This has been bugging me from last two days, seems like the steps described in https://forum.sentry.io/t/how-to-configure-slack-in-your-on-prem-sentry/3463 doesn't work anymore. I'm trying to setup slack in a sentry onprem instance.

@harshulj
Copy link

harshulj commented Jul 2, 2020

I am facing the same issue. Any workaround for this ?

@phyzical
Copy link

phyzical commented Jul 3, 2020

getsentry/self-hosted#563

for the fix :)

@pratheekhegde
Copy link

Issue fixed after adding slack.legacy-app: false to config.yml and restarting the server by sudo docker-compose restart web cron.

Thank you @phyzical

@jonesphillip
Copy link
Contributor

@hayzem were you able to get this working? Can you try removing @sentry from #api-log and then re-adding it. I have a feeling you may have multiple sentry bots and the wrong one was invited to the channel.

@hayzem
Copy link
Author

hayzem commented Jul 16, 2020

@jonesphillip just tried what you suggested. sentry alerts giving me the same error. here is what I did:

there is only one @sentry bot in the workspace. I removed it via View N apps in api-log in channels settings. Re-added @sentry again via Add apps from channel settings. then I tried to add a new alert on sentry's project settings. it is still giving me the same error.

btw, I have not try the standalone solution suggestions, since our account is Saas. just let me know if I can apply those suggestions somehow.

@ericjeker
Copy link

Not sure it's related but I am having a lot of difficulties with that as well. There are now 3 different Sentry apps in Slack:
image

On the most recent one (I guess, with the pink icon), they mention a @sentry2 but I have no idea where that is as I only have a @sentry:
image

I've added the bot in the private channel I want to notify:
image

But I still get an error when I am adding a notification:
image

We use Slack SaaS. I've not idea how to fix that.

@hbish
Copy link

hbish commented Jul 16, 2020

We are having the exact same issue with the SaaS Sentry, could not set up notifications to Slack. Our legacy integration worked but we can't rollback anymore as it's no longer available in the Slack marketplace.

@MeredithAnya
Copy link
Member

@hayzem @ericjeker @hbish Is it possible that the channels you are trying to add were previously public channels?

You can check this by opening Slack in your browser, going to the channel and checking the url, if the last part (e.g. CSG031XMH/details/ has a 'C' but is a private channel that would mean it was initially public.

We recently had a change from using the channels.list endpoint (which is deprecated) to the conversations.list endpoint. And I just tested out locally that in the response back from Slack - if my channel was public -> private, it's not included in my list of channels.

@hayzem
Copy link
Author

hayzem commented Jul 16, 2020

@MeredithAnya I can't recall it being public but yes the channel url's last part starts with C, except the /details, that part is missing.

@ericjeker
Copy link

@MeredithAnya, seems that that particular channel's ID starts with a C. So then, how can we solve that? It seems that it's a problem on Slack's side.

@MeredithAnya
Copy link
Member

@MeredithAnya, seems that that particular channel's ID starts with a C. So then, how can we solve that? It seems that it's a problem on Slack's side.

@ericjeker Indeed it does. We are reaching out to them about this, so we'll post an update when we hear back with more information.

@MeredithAnya
Copy link
Member

@MeredithAnya, seems that that particular channel's ID starts with a C. So then, how can we solve that? It seems that it's a problem on Slack's side.

@ericjeker Indeed it does. We are reaching out to them about this, so we'll post an update when we hear back with more information.

I actually misspoke here, when testing locally I wasn't testing with the setting slack.legacy: False (added in this PR).

We have to continue supporting workspace Slack apps while people are still migrating over to the new bot app and workspace apps are not compatible with the conversations.list api. This is why for Sentry SaaS, the setting must default to True.

All this is to say, it wasn't on Slack since we weren't actually using the conversations.list endpoint for the new bot apps. Instead we're still using the deprecated channels.list endpoint. We'll update y'all when the fix is live for non-workspace apps.

@MeredithAnya
Copy link
Member

Late to update this issue but should've been fixed in #20047, so going to close this out.

@hbish
Copy link

hbish commented Sep 21, 2020

Thanks for the update @MeredithAnya this is finally working!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants