How to configure Slack in your on-prem Sentry

Why is slack api - How to install bot in multiple teams without adding it to the directory? - Stack Overflow not applicable to you? Since you control the Slack app you integrate with, you should be able to mark it as distributed, right?

I am seeing the same issue on my on-prem instance.

summary (since I am replying to a post from Aug’19) : Slack integration works, and it unfurls links. The unfurled links work and allow assigning users to issues and sort.

The alerting does not work. I am hit with

The slack resource “myproject-errors” does not exist or has not been granted access in the My Company workspace.

Possibly due to the fact that the Sentry integration on slack only requests the slack’s read:links and write:links scope.

@ParthKolekar - I’ll investigate this soon. In the meantime, can you confirm that you are using a recent version of the on-premise repo as there was a critical fix around this integration recently: https://github.com/getsentry/onpremise/pull/309

Thanks for quick reply. We’re running 9.1, via the legacier “Install using Python” method that was described earlier and not using the docker compose.

Ah, sorry my bad skipping that info. Are you able to test this with the latest version as we are not intending to support the 9.1 line anymore? There are some rudimentary instructions and discussion around migrating from a Python-based install here: Migrating from python install · Issue #128 · getsentry/self-hosted · GitHub (make sure you backup your data before trying anything please)

I’m afraid that we’ll stick with the latest 9.x release for now. I see from the code that we need to have “workspace application” enabled for this to work. I see from comments here that we can no longer create these in slack.

We’re not on 9.1. That was a mistake in communication.

Definitely not the case. Right now you should be able to follow the updated guide on the first post in this thread and set up Slack integration: How to configure Slack in your on-prem Sentry - #11 by evanpurkhiser - I think that’d require at least Sentry 9.1.2 and at that point I’d recommend just going with 10. You can do a fresh installation just to try the Slack integration and if it works, then upgrade your existing installation.

We’re at Sentry 9.1.2 right now. I see that Sentry 10 was released rather recently. We’ll aim for that one and see if things work there.

Thanks @evanpurkhiser for the tutorial. Maybe @BYK FYI
Adapting it a little bit to the latest changes ( Enable Interactive Components → Interactivity & Shortcuts, Scopes → App Home), it works perfectly for the alerting.
However, when you want to go into the bot interactions, changing the message into a long text full of HTML

<!DOCTYPE html>
<html lang="en">
<head>
 <meta http-equiv="content-type" content="text/html; charset=utf-8">
 <meta name="robots" content="NONE,NOARCHIVE">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <link [...]

Is it possible that the bot is now requiring more permissions than just links:read ?

Hi @MRigal, is that for when you try to take an action like assigning an issue to a user or when unfurling a URL?

2 Likes

Hi, @manuzope I’m facing the same issue, notification works just fine but when I’m trying to do an action like assign or ignore it returns an escaped HTML

Hey @BYK and others :smile:

i was able to follow this guide and get slack integrated but when i try to make an alert rule for a project i get told “The slack resource “EXAMPLE_PUBLIC_CHANNEL” does not exist or has not been granted access in the XXXX Slack workspace”

( i am running the latest nightly build Sentry 20.7.0.dev07251c9c)

any idea what i may have missed o.0 i even tried inviting the bot to the channel, going super lax on scopes made no difference either

image (4)

1 Like

@phyzical Think the relevant PR for this is here. https://github.com/getsentry/sentry/pull/19446

3 Likes

@rohit cool thanks for pointing me at that :slight_smile: i will check back in around ~15th then :slight_smile:

Edit: wait i misread, i will try updating getsentry/sentry image

:smiley: thanks again @rohit you hit the nail on the head, i just had to think about it.

Due to this being added it defaults to true, and so i need to provide false and now it sees my channel and even user :smiley:

@evanpurkhiser you may want to add an edit to the guide,

slack.legacy-app: False

will be required in config.yml going forward to support the new integration setups

FYI to who ever it may concern, i have opened a pr for the docs to add this guide https://github.com/getsentry/develop/pull/73

:+1:

2 Likes

Saved my life! Thanks!

Is there any way to configure Slack integration without public url? Our company has restrictions on exposing public access, so Sentry url is only available from the company’s network.

For the newer global integration, https://develop.sentry.dev/integrations/slack/ is the relevant documentation.

1 Like

You can use slack’s IP allow-listing: Best practices for security | Slack

Can you please elaborate? I checked the link you provided and it seems that IP’s on this list are still required to be public to work properly. Which is not the case for us unfortunately. The only way that works for us I think is Slack incoming webhooks, but I am not sure that Sentry supports this way of integration.