Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Random Error Unknown Encoding #64

Open
jcacqua opened this issue Nov 22, 2022 · 1 comment
Open

Random Error Unknown Encoding #64

jcacqua opened this issue Nov 22, 2022 · 1 comment

Comments

@jcacqua
Copy link

jcacqua commented Nov 22, 2022

Hi
I've installed Botkit Starter web (git clone https://github.com/howdyai/botkit-starter-web.git + npm install + npm start)
Randomly, I get errors, shorty after starting, like this one :

node:internal/streams/writable:295
throw new ERR_UNKNOWN_ENCODING(encoding);
^

TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: true
at new NodeError (node:internal/errors:387:5)
at _write (node:internal/streams/writable:295:13)
at Socket.Writable.write (node:internal/streams/writable:336:10)
at Sender.sendFrame (/opt/botkit2/botkit-starter-web/node_modules/ws/lib/sender.js:404:20)
at Sender.doPing (/opt/botkit2/botkit-starter-web/node_modules/ws/lib/sender.js:192:10)
at Sender.ping (/opt/botkit2/botkit-starter-web/node_modules/ws/lib/sender.js:178:12)
at WebSocket.ping (/opt/botkit2/botkit-starter-web/node_modules/ws/lib/websocket.js:268:18)
at each (/opt/botkit2/botkit-starter-web/node_modules/botkit/lib/Web.js:67:20)
at Set.forEach ()
at Timeout.ping [as _onTimeout] (/opt/botkit2/botkit-starter-web/node_modules/botkit/lib/Web.js:61:25) {
code: 'ERR_UNKNOWN_ENCODING'
}

do you have any clue ?

I tried to reinstall botkit, It's all the same

I'm on CentOS Linux release 7.9.2009 (Core)
thanks in advance

@jcacqua
Copy link
Author

jcacqua commented Nov 25, 2022

I finally found a solution
in the file botkit-starter-web/node_modules/botkit/lib/Web.js :
I commented lines from 60 to 69 and it's working now
60 //setInterval(function ping() {
61 // wss.clients.forEach(function each(ws) {
62 // if (ws.isAlive === false) {
63 // return ws.terminate();
64 // }
65 // if (ws.isAlive === false) return ws.terminate()
66 // ws.isAlive = false;
67 // ws.ping('', false, true);
68 // });
69 // }, 30000);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant