Bot occasionally crashes with invalid channel ID: undefined
Hi!! I'm encountering some crashes whilst running the bot - any help in fixing this (past validating that the getOrFetchChannel parameter isn't undefined) would be lovely!
Here are some stacktraces if that helps things
Error: Error: Invalid channel ID: undefined
at Client.getChannel (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/Client.js:2447:13)
at new Message (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/structures/Message.js:65:33)
at /home/ubuntu/discord/modmailbot/node_modules/eris/lib/structures/Message.js:94:21
at Array.map (<anonymous>)
at new Message (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/structures/Message.js:85:54)
at Collection.add (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/util/Collection.js:61:13)
at Shard.wsEvent (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/gateway/Shard.js:946:55)
at Shard.onPacket (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/gateway/Shard.js:398:16)
at Shard._onWSMessage (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/gateway/Shard.js:2583:21)
at WebSocket.emit (node:events:518:28)
at Receiver.receiverOnMessage (/home/ubuntu/discord/modmailbot/node_modules/ws/lib/websocket.js:1220:20)
at Receiver.emit (node:events:518:28)
at Receiver.dataMessage (/home/ubuntu/discord/modmailbot/node_modules/ws/lib/receiver.js:596:14)
at Receiver.getData (/home/ubuntu/discord/modmailbot/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/home/ubuntu/discord/modmailbot/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/home/ubuntu/discord/modmailbot/node_modules/ws/lib/receiver.js:94:10)
Error: Error: Invalid channel ID: undefined
at Client.getChannel (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/Client.js:2447:13)
at new Message (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/structures/Message.js:65:33)
at Collection.add (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/util/Collection.js:61:13)
at Collection.update (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/util/Collection.js:35:19)
at /home/ubuntu/discord/modmailbot/node_modules/eris/lib/structures/Message.js:92:38
at Array.map (<anonymous>)
at new Message (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/structures/Message.js:85:54)
at Collection.add (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/util/Collection.js:61:13)
at Collection.update (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/util/Collection.js:35:19)
at new Message (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/structures/Message.js:119:51)
at Collection.add (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/util/Collection.js:61:13)
at Shard.wsEvent (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/gateway/Shard.js:946:55)
at Shard.onPacket (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/gateway/Shard.js:398:16)
at Shard._onWSMessage (/home/ubuntu/discord/modmailbot/node_modules/eris/lib/gateway/Shard.js:2583:21)
at WebSocket.emit (node:events:518:28)
at Receiver.receiverOnMessage (/home/ubuntu/discord/modmailbot/node_modules/ws/lib/websocket.js:1220:20)
Hi, also getting this issue frequently! Just bumping so it gets more attention. :)
same here! this is all the error logs I could retrieve
Error: Error: Invalid channel ID: undefined at Client.getChannel (/home/ubuntu/modmail/modmailbot-3.8.0/node_modules/eris/lib/Client.js:2447:13) at new Message (/home/ubuntu/modmail/modmailbot-3.8.0/node_modules/eris/lib/structures/Message.js:65:33) at /home/ubuntu/modmail/modmailbot-3.8.0/node_modules/eris/lib/structures/Message.js:94:21 at Array.map (<anonymous>) at new Message (/home/ubuntu/modmail/modmailbot-3.8.0/node_modules/eris/lib/structures/Message.js:85:54) at Collection.add (/home/ubuntu/modmail/modmailbot-3.8.0/node_modules/eris/lib/util/Collection.js:61:13) at Shard.wsEvent (/home/ubuntu/modmail/modmailbot-3.8.0/node_modules/eris/lib/gateway/Shard.js:946:55) ...stack trace truncated to 8 lines
Same problem, it happens that the bot crashes several times in an hour.
From my (very limited) testing, the bot crashes since it tries to fetch the channel of a forwarded message from a server the bot isn't in.
Can someone confirm my theory? It also appears that forwarded messages (regardless if the bot is in the server or not) just don't show up in the inbox thread/logs 🤔
Seems that eris already has an open PR to fix this: https://github.com/abalabahaha/eris/pull/1582
From my (very limited) testing, the bot crashes since it tries to fetch the channel of a forwarded message from a server the bot isn't in.
Can someone confirm my theory? It also appears that forwarded messages (regardless if the bot is in the server or not) just don't show up in the inbox thread/logs 🤔
I can replicate this. Seems like this is the case?
In my testing, this happens regardless of whether or not the bot can access the server or channel. It just implodes immediately upon seeing any forwarded message.
Bump? Someone have the fix?