Comments (3)
Hi,
I'm not sure how to replicate this, when I try (using the latest release) with a blank string or random text as my token, I see logging to terminal like:
[Mon Sep 28 2015 22:33:08 GMT-0700 (PDT)] INFO Connecting...
Error: invalid_auth
[Mon Sep 28 2015 22:33:08 GMT-0700 (PDT)] INFO Reconnecting in 1000ms
[Mon Sep 28 2015 22:33:09 GMT-0700 (PDT)] INFO Attempting reconnect
... and the client continuously attempts to reconnect with an increasing backoff.
Could you let me know what you did to get the error you're mentioning above to be thrown?
Thanks!
from node-slack-sdk.
I don't think this has anything to do with the token. It happens to a bot of mine randomly but apparently once per day to bi-daily. Can't reproduce it tho 😐 Full stacktrace here:
bot-0 (err): events.js:87
bot-0 (err): throw Error('Uncaught, unspecified "error" event.');
bot-0 (err): ^
bot-0 (err): Error: Uncaught, unspecified "error" event.
bot-0 (err): at Error (native)
bot-0 (err): at Client.emit (events.js:87:13)
bot-0 (err): at Client.onMessage (/home/node/playstore-bot/node_modules/slack-client/src/client.js:468:21)
bot-0 (err): at WebSocket.<anonymous> (/home/node/playstore-bot/node_modules/slack-client/src/client.js:140:24)
bot-0 (err): at WebSocket.emit (events.js:110:17)
bot-0 (err): at Receiver.self._receiver.ontext (/home/node/playstore-bot/node_modules/slack-client/node_modules/ws/lib/WebSocket.js:697:10)
bot-0 (err): at Receiver.opcodes.1.finish (/home/node/playstore-bot/node_modules/slack-client/node_modules/ws/lib/Receiver.js:397:14)
bot-0 (err): at Receiver.expectHandler (/home/node/playstore-bot/node_modules/slack-client/node_modules/ws/lib/Receiver.js:384:31)
bot-0 (err): at Receiver.add (/home/node/playstore-bot/node_modules/slack-client/node_modules/ws/lib/Receiver.js:93:24)
bot-0 (err): at TLSSocket.firstHandler (/home/node/playstore-bot/node_modules/slack-client/node_modules/ws/lib/WebSocket.js:678:22)
from node-slack-sdk.
So, I think what you were seeing with this was an error event from the API. The line of code that was throwing the error was the client's handler for messages with type error
.
This will be followed by any events that occurred between the call to rtm.start and the connection to the message server. If you're reconnecting after a network problem this initial set of events may include a response to the last message sent on a previous connection (with a reply_to) so a client can confirm that message was received.
Per the docs:
If there was a problem connecting an error will be returned, including a descriptive error message:
{
"type": "error",
"error": {
"code": 1,
"msg": "Socket URL has expired"
}
}
My guess is that you were running into some issues with the old reconnection logic. You were likely being disconnected and then having some kind of problems getting re-authed - which was what the unspecified error
was representing.
I just pushed the 2.0.0 release for this library, which is a ground up refactor with the aim of building a lib that both Slack and our external contributors can easily work with and improve.
It also includes substantially improved reconnection logic and handling, for both routine disconnects as well team_migration
events and similar. I'll also be making sure to expedite fixes for any issues with reconnection logic in particular, as I know that's been a pain for folks in the past.
So, the best way to resolve this issue is probably to upgrade to the latest version. If you have any problems in doing that, please create a new issue and I'll try and help you in there. If you see this problem after updating, let me know and I can see what I can do.
from node-slack-sdk.
Related Issues (20)
- Is it possible to get typing event or indicator when a user in slack starts typing in a message HOT 2
- Typescript type error for `web.files.uploadV2()` arguments when using `file_uploads` HOT 2
- Missing exported types (Channel, etc) HOT 7
- Bun runtime support for @slack/web-api HOT 1
- Way to disable message content being logged HOT 3
- files.upload method returns warning message "files.upload may cause some issues like timeouts for relatively large files." HOT 4
- Main thread crashes due to unhandled error from @slack/web-api SDK HOT 3
- Update files.upload Documentation on Slack API Website for files.uploadV2 HOT 4
- 'process is not defined' in react vite HOT 1
- The icon_url option on chat.postMessage does not seem to affect the preview avatar image shown in the thread reply summary HOT 3
- Please support `AbortSignal` HOT 2
- Document inconsistency: checkboxes block element's description can have both plain_text and mrkdwn HOT 2
- icon_url is not working in thread replies.
- socket-mode: Type event payloads HOT 1
- web-api: Consider removing need to provide empty object as argument to zero-argument methods HOT 2
- web-api: Consider removing empty interfaces HOT 5
- Unhandled event 'websocket open' in state 'connected'. HOT 9
- sharedPublicURL rejects with error "not_allowed" for no clear reason HOT 2
- web-api: oauth.v2.exchange is missing token parameter HOT 3
- socket-mode 1.x: explicit server disconnect during 'connecting' state not handled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-slack-sdk.