Unable to setup Slack integration

We’re trying to finish our setup of a Sentry 21.2.0 release (fresh install) and are having issues with the slack integration. I followed the steps laid out in the documentation, but when I go through the Add Workspace flow I’m finally greeted with this message:

On the server side I see this logged:

sentry.integrations.slack: slack.team-info.response-error (error='invalid_auth')

I’ve checked the slack.client-id, slack.client-secret and slack.signing-secret options multiple times and they are correct.

1 Like

We are having the same issue.

All of our configuration appears to be correct. We get an email to say “A new slack app was installed” too.

Within Sentry I can see the error:

build-integration.failure

provider_key: slack

error_message: Could not retrieve Slack team information.

It appears as though that the request being made by Sentry is incorrect or outdated.

Slacks docs specify that the token in the request should be sent as an auth header (when using GET) or as a token field in a POST request, see: team.info method | Slack

We tested this by sending the request manually and we got the expected response.

I think that’s what the integration code is doing, but I’m not sure what build_integration gets called with so maybe its missing some content.

Edit: also, the app does install for us as well. It is just the final steps of the senty side setup that fail. I can use the bot token from the installed app just fine.

@jlogsdon Any chance you set up Restricted API Token Usage? Best practices for security | Slack

In your app settings its under OAuth & Permissions.

I know it’s not in the docs but just want to double check here since it does look like if that’s set up you could be getting an invalid_auth error if the IPs didn’t match.

No, I have not added any IPs to that whitelist.

edit: I went ahead and tried whitelisting the server IP address, no change in behavior. I reverted and the whitelist is empty again.

I circled back and looked at this again and I think you might be right. I’m going to try and test using a header instead locally and submit a patch if that works.

1 Like

Yup, that was it! I’ll push a PR up to fix this.

PR: Update slack integration to use Authorization header for GET requests by jlogsdon · Pull Request #24131 · getsentry/sentry · GitHub

Hey! Is there any news when this pull request will be merged? I clonned getsentry/onpremise just now, problem still actual.

The PR is merged, and the change will be available in the 21.3.0 onpremise release. If needed sooner, you can use a nightly build.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.