Closed favna closed 5 years ago
Quick question, have you installed zlib-sync
? If so, you need to either pick to use zucc
orzlib-sync
, as they don't function well together. I also had the same issue, and removing zucc (and keeping zlib-sync) did the trick.
I guess the docs should be updated to reflect that change
The code doesn't load zlib-sync if it finds it is capable of loading zucc (by means of a try-catch block) so that should not matter.
That said, yes I did have zlib-sync removed in one attempt as well as present in another.
zstd doesn't consider being given a zero-length buffer an error, so something else is at play here. can you try to grep for "Zero length buffer"
in your node_modules?
@devsnek Tried running it but despite having it running in the background it never gave any output (for like 1+ hour). I don't necessarily mind having it run for hours upon hours but....
Ran it like so, just to verify I did not misunderstand you.
(please disregard that it shows that I'm using a fork of the lib, it is up2date to the commit hash I mentioned in the original post)
@Favna you need to pass files to grep or else it waits indefinitely for input on stdin. grep -rni "Zero length buffer" node_modules
should work
That produces results, in Discordapp's Erlpack.. which in its turn is another peer dependency so that's great ._."
$ grep -rni "Zero length buffer" node_modules
Binary file node_modules/erlpack/build/Release/erlpack.node matches
Binary file node_modules/erlpack/build/Release/obj.target/erlpack/js/erlpack.o matches
Binary file node_modules/erlpack/build/Release/obj.target/erlpack.node matches
node_modules/erlpack/js/erlpack.cc:32: Nan::ThrowError("Zero length buffer.");
@Favna can you see if the issue still occurs in https://github.com/discordjs/discord.js/commit/065908956bae6c937de367cddf6ba3a5a092facb?
I had the same issue, and now the bot is able to log in again.
Most things work again, sadly a new problem has shown up and now I'm getting an error when calling voiceChannel.join()
:
Error: Zero length buffer.
at Object.exports.unpack.data [as unpack] ([..]\node_modules\discord.js\src\WebSocket.js:37:18)
at VoiceWebSocket.onMessage ([..]\node_modules\discord.js\src\client\voice\networking\VoiceWebSocket.js:139:38)
at WebSocketClient.internalOnMessage ([..]\node_modules\@discordjs\uws\uws.js:103:5)
at native.client.group.onMessage ([..]\node_modules\@discordjs\uws\uws.js:57:12)
(without erlpack everything works just fine.)
I dug a little deeper and noticed that in WebSocket.js line 36 sometimes when data is a string like for example: {"op":8,"d":{"v":4,"heartbeat_interval":13750.0}}
new Uint8Array(data)
returns an empty Uint8Array: Uint8Array []
.
complete debug log:
[VOICE (443496630042492969:2)]: Sending voice state update (queue length is 0): {"guild_id":"443496630042492969","channel_id":"443496630042492973","self_mute":false,"self_deaf":false}
[VOICE] received voice state update: {"channel_id":"443496630042492973","deaf":false,"guild_id":"443496630042492969","mute":false,"self_deaf":false,"self_mute":false,"self_video":false,"session_id":"e237f158a9eb77477e75b00419177eb6","suppress":false,"user_id":"582886421371682827","member":{"deaf":false,"joined_at":"2019-05-28T11:05:26.013798+00:00","mute":false,"nick":null,"premium_since":null,"roles":["582887149494468619"],"user":{"avatar":null,"bot":true,"discriminator":"1492","id":"582886421371682827","username":"UberBot-dev"}}}
[VOICE] connection? true, 443496630042492969 e237f158a9eb77477e75b00419177eb6 443496630042492973
[VOICE (443496630042492969:2)]: Setting sessionID e237f158a9eb77477e75b00419177eb6 (stored as "undefined")
[VOICE (443496630042492969:2)]: Authenticated with sessionID e237f158a9eb77477e75b00419177eb6
[VOICE] received voice server: {"d":{"endpoint":"eu-west410.discord.gg:80","guild_id":"443496630042492969","token":"17148a83df24fcae"},"op":0,"s":13,"t":"VOICE_SERVER_UPDATE"}
[VOICE] voiceServer guild: 443496630042492969 token: 17148a83df24fcae endpoint: eu-west410.discord.gg:80
[VOICE (443496630042492969:2)]: Token "17148a83df24fcae" and endpoint "eu-west410.discord.gg:80"
[VOICE (443496630042492969:2)]: Endpoint resolved as eu-west410.discord.gg
[VOICE (443496630042492969:2)]: Authenticated with sessionID e237f158a9eb77477e75b00419177eb6
[VOICE (443496630042492969:1)]: Connect triggered
[VOICE (443496630042492969:1)]: [WS] connect requested
[VOICE (443496630042492969:1)]: [WS] connecting, 1 attempts, undefined
[VOICE (443496630042492969:1)]: [WS] opened at gateway eu-west410.discord.gg
[VOICE (443496630042492969:1)]: [WS] >> {"op":0,"d":{"server_id":"443496630042492969","user_id":"582886421371682827","token":"17148a83df24fcae","session_id":"e237f158a9eb77477e75b00419177eb6"}}
[VOICE (443496630042492969:1)]: [WS] Error: Error: Zero length buffer.
Error: Zero length buffer.
at Object.exports.unpack.data [as unpack] ([...]\node_modules\discord.js\src\WebSocket.js:41:18)
at VoiceWebSocket.onMessage ([...]\node_modules\discord.js\src\client\voice\networking\VoiceWebSocket.js:139:38)
at WebSocketClient.internalOnMessage ([...]\node_modules\@discordjs\uws\uws.js:103:5)
at native.client.group.onMessage ([...]\node_modules\@discordjs\uws\uws.js:57:12)
[VOICE (443496630042492969:1)]: [WS] Error: Error: Zero length buffer.
@Crow08 this should be fixed in https://github.com/discordjs/discord.js/commit/8652e47c14eccd1c8cab27f0d1acb8d7335349e8, can you verify?
@amishshah works! Great, thanks!
@amishshah on Windows the code works just fine however on my Linux machine (Ubuntu Server LTS, cat /proc/version
is Linux version 4.15.0-45-generic (buildd@lgw01-amd64-031) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019
) I get the following error:
>>>>>>
Shard encountered a connection error!
**Shard Number:** 0
**Time:** May 29th 2019 at 21:01:19 UTC+00:00
**Error Message:** Bad version number.
<<<<<<
This is based on commit ID 8652e47c14eccd1c8cab27f0d1acb8d7335349e8
And from what I can only presume it really factors in even the type of Linux machine since despite that I say "Windows", I actually use WSL on my windows machine so it's actually "pseudo-linux" even in a way.
Please describe the problem you are having in as much detail as possible:
I pulled in latest master and noticed the new peer dependency "zucc". Checked what it was meant to be and thus tried switching from zlib-sync to zucc. However when I tried running my bot subsequently it fails to connect entirely. This is my startup log:
These error logs are from
client.shardError
andclient.shardReconnecting
Further details: