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

State machine: Unhandled event 'websocket open' in state 'connecting'. #1521

Closed
1 of 7 tasks
ddrown opened this issue Aug 15, 2022 · 1 comment · Fixed by #1522
Closed
1 of 7 tasks

State machine: Unhandled event 'websocket open' in state 'connecting'. #1521

ddrown opened this issue Aug 15, 2022 · 1 comment · Fixed by #1522
Assignees
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented

Comments

@ddrown
Copy link

ddrown commented Aug 15, 2022

There was some connectivity issues between us-east-1 and slack the other day, and my bot crashed. Looks like the state machine wasn't expecting a 'websocket open' in state 'connecting'

Packages:

Select all that apply:

  • @slack/web-api
  • @slack/rtm-api
  • @slack/webhooks
  • @slack/oauth
  • @slack/socket-mode
  • @slack/types
  • I don't know

Reproducible in:

The Slack SDK version

slack/bolt: 3.11.3

Node.js runtime version

v16.16.0

OS info

#31~20.04.1-Ubuntu SMP Fri Jan 14 14:37:50 UTC 2022

Steps to reproduce:

bolt is configured as:

  const app = new bolt.App({
    token: config.slack.oauth_token,
    signingSecret: config.slack.signing_secret,
    socketMode: true,
    appToken: config.slack.app_token,
    port: 3000
  });

  await app.start();

Expected result:

Reconnect continues to try until it works

Actual result:

[INFO]  socket-mode:SocketModeClient:0 A pong wasn't received from the server before the timeout of 5000ms!
[INFO]  socket-mode:SocketModeClient:0 Reconnecting to Slack ...
[INFO]  socket-mode:SocketModeClient:0 Going to establish a new connection to Slack ...
[INFO]  socket-mode:SocketModeClient:0 Reconnecting to Slack ...
[INFO]  socket-mode:SocketModeClient:0 Going to establish a new connection to Slack ...
[INFO]  socket-mode:SocketModeClient:0 Now connected to Slack
[INFO]  socket-mode:SocketModeClient:0 A pong wasn't received from the server before the timeout of 5000ms!
[INFO]  socket-mode:SocketModeClient:0 Reconnecting to Slack ...
[INFO]  socket-mode:SocketModeClient:0 Going to establish a new connection to Slack ...
[INFO]  socket-mode:SocketModeClient:0 Reconnecting to Slack ...
[INFO]  socket-mode:SocketModeClient:0 Going to establish a new connection to Slack ...

/home/slackbot/api/node_modules/finity/lib/core/StateMachine.js:76
      throw new Error('Unhandled event \'' + event + '\' in state \'' + this.currentState + '\'.');
      ^

Error: Unhandled event 'websocket open' in state 'connecting'.
    at StateMachine.handleUnhandledEvent (/home/slackbot/api/node_modules/finity/lib/core/StateMachine.js:76:13)
    at /home/slackbot/api/node_modules/finity/lib/core/HierarchicalStateMachine.js:79:33
    at TaskScheduler.execute (/home/slackbot/api/node_modules/finity/lib/core/TaskScheduler.js:29:7)
    at TaskScheduler.enqueue (/home/slackbot/api/node_modules/finity/lib/core/TaskScheduler.js:19:12)
    at HierarchicalStateMachine.handle (/home/slackbot/api/node_modules/finity/lib/core/HierarchicalStateMachine.js:72:24)
    at WebSocket.<anonymous> (/home/slackbot/api/node_modules/@slack/socket-mode/dist/SocketModeClient.js:415:31)
    at WebSocket.onOpen (/home/slackbot/api/node_modules/ws/lib/event-target.js:144:16)
    at WebSocket.emit (node:events:527:28)
    at WebSocket.setSocket (/home/slackbot/api/node_modules/ws/lib/websocket.js:225:10)
    at ClientRequest.<anonymous> (/home/slackbot/api/node_modules/ws/lib/websocket.js:873:15)

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

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

@WilliamBergamin
Copy link
Contributor

Hi @ddrown thanks for writing in!

This does seem to be a bug on our end, I will try to reproduce this locally and gain more info on what is going on

@WilliamBergamin WilliamBergamin added needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info and removed untriaged labels Aug 15, 2022
@WilliamBergamin WilliamBergamin self-assigned this Aug 15, 2022
@WilliamBergamin WilliamBergamin added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented and removed needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info labels Aug 15, 2022
@seratch seratch added this to the socket-mode@1.3.2 milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants