Git Product home page Git Product logo

Comments (10)

filmaj avatar filmaj commented on June 7, 2024

Thanks for the report, I believe this may occur during the brief window when the app is attempting to reconnect, it will have two simultaneous websocket connections open, which may confuse the state machine, as the state machine assumes a single connection exists.

I will mark this as a bug and will try to reproduce the scenario using the integration tests.

from node-slack-sdk.

gaurav512 avatar gaurav512 commented on June 7, 2024

Any clue why this error: An unhandled error occurred while Bolt processed (type: undefined, error: TypeError: Cannot read properties of undefined (reading 'event')) is happening so frequently?

It doesn't seem to directly affect anything (and I guess it only happens when there are no incoming requests), but still curious.

from node-slack-sdk.

filmaj avatar filmaj commented on June 7, 2024

What version of the @slack/socket-mode package are you using?

Also, if it is possible to turn on debug logging for your app (it looks like you are using bolt? If so: instructions on how to do so here) and post debug logs, that would be helpful too.

I am not sure on the exact cause of the logs, it may also depend on any additional code you may have integrated in your bolt app. Can you post your App initialization (and if you are using a custom receiver, the initialization of the receiver as well).

from node-slack-sdk.

jwoo0122 avatar jwoo0122 commented on June 7, 2024

I'm also seeing this trace recently. There're so many reconnection trial, and after that it always said Unhandled event 'server disconnect old socket' in state 'connecting'., and process crashed. I use @slack/[email protected] without any custom receiver.

const app = new App({
    signingSecret: process.env.SECRET,
    token: process.env.TOKEN,
    socketMode: true,
    appToken: process.env.APP_TOKEN,
    port: Number(process.env.PORT || 3000),
    logLevel: LogLevel.INFO,
  });

app.start();

from node-slack-sdk.

gaurav512 avatar gaurav512 commented on June 7, 2024

What version of the @slack/socket-mode package are you using?

I use @slack/[email protected] and it installs @slack/[email protected].

This is my app initialization:

const app = new App({
  port: parseInt(process.env.PORT || '', 10) || 6543,
  socketMode: true,
  token: slackSecrets?.slackBotToken,
  appToken: slackSecrets?.slackAppToken,
  signingSecret: slackSecrets?.slackSigningSecret,
  logLevel: appLogLevel,
  logger,
  customRoutes: [
    ...getActuatorEndpoints(),
  ],
  extendedErrorHandler: true,
});

customRoutes has some health check related endpoints.
Noting that I do de-reference the slack secrets once the app is initialized. Let me know if this might be a problem.

from node-slack-sdk.

filmaj avatar filmaj commented on June 7, 2024

Noting that I do de-reference the slack secrets once the app is initialized. Let me know if this might be a problem.

That should be fine. If there are easily detectable problems with the secrets (like missing or empty values), it would be raised upon initialization.

We've had more reports from folks about problems with reconnecting and this package recently. In my investigations, it is partly due to the very old implementation in the node socket-mode package (based on a several-years-old version of the old @slack/rtm-api module).

We are considering migrating the python-slack-sdk implementation/design to node and releasing it as the next major version.

from node-slack-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.