Skip to content

Socket mode disconnections with AsyncApp #1065

@matthieucan

Description

@matthieucan

Hello,
From time to time I experience what I believe are disconnections of the web socket to Slack.
I use slack_bolt.app.async_app.AsyncApp and slack_bolt.adapter.socket_mode.aiohttp.AsyncSocketModeHandler. Every few weeks, the application becomes unresponsive, and slash commands trigger /foo failed with the error "dispatch failed".

Looking at logs, I believe those are relevant:

2021-07-21 05:05:40:slack_bolt.AsyncApp:__init__:INFO:The session seems to be already closed. Going to reconnect...
2021-07-21 05:05:40:slack_bolt.AsyncApp:__init__:INFO:A new session has been established
2021-07-21 05:05:40:slack_bolt.AsyncApp:__init__:INFO:The old session has been abandoned

While the 2nd and 3rd line happen every now and then, the first line ("The session seems to be already closed. Going to reconnect...") doesn't.
Do you have any idea why this happens?

Reproducible in:

The slack_bolt version

slack-bolt==1.5.0
slack-sdk==3.5.0
slackclient==1.3.2

Python runtime version

Python 3.8.10

OS info

This runs in a Docker container based on python:3.8.10-slim-buster

Steps to reproduce:

I sadly can't consistently reproduce it at the moment, this seems to happen transiently.

Expected result:

The web socket stays active.

Actual result:

Connection seems to be lost and the app is not reachable anymore.

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Version: 3xbugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedsocket-mode

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions