python-slack-sdk: “Failed RTM connect” error when trying to connect to Slack with RTM API

Description

I have a slack app that I built using the RTM API, that was working fine last time I used it (in December). Now, without any code changes since then, when I try to run it RTM fails to connect.

I stumbled across the Migrating to 2.x wiki, and I’m seeing the same error with rtm_connect when I try to run the example 1.x code as I do when I run mine. I found people having similar issues, but unlike them, I am not on a Windows machine, and I am fairly certain I am using the correct token.

I’ve outlined the issue in detail in a SO question here

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
  • I’ve read and agree to the Code of Conduct.
  • I’ve searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackclient version: slackclient==1.3.2

python version: Python 3.8.0

OS version(s): Mac OS 10.14.6

Steps to reproduce:

Please see details, like steps taken and environment info and other context, outlined in StackOverflow question

Expected result:

What you expected to happen: RTM connects successfully

Actual result:

What actually happened: RTM connection fails

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 15 (7 by maintainers)

Most upvoted comments

@bkievitkylar Here is the up-to-date way to create a new RTM app. I know it may be a bit confusing. I hope this comment will help you and other folks.

  • Go to https://api.slack.com/apps?new_classic_app=1 and create a classic app
  • Go to OAuth & Permissions in the left pane
  • Add bot scope in the Scopes section
    • You’ll see a warning saying “This scope is deprecated. Please update scopes to use granular permissions.” but don’t upgrade to the newer permission model
  • Go to App Home in the left pane
  • Click Add Legacy Bot User and set its name
  • Go to Install App in the left pane
  • Run the OAuth flow with your development workspace
  • Use Bot User OAuth Access Token for your RTM app
Screen Shot 2020-06-06 at 08 04 53

@BigOtis No plans to support RTM with granular scopes. If you are building an internal integration (not planning on distributing to App Directory), you can keep using classic slack apps and RTM without much worry. No plans to sunset classic slack apps in the near future.

Thank you,

That appears to have worked in creating a legacy bot.