Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot occasionally crashes with invalid channel ID: undefined #812

Open
CyberFlameGO opened this issue Nov 7, 2024 · 5 comments
Open

Bot occasionally crashes with invalid channel ID: undefined #812

CyberFlameGO opened this issue Nov 7, 2024 · 5 comments

Comments

@CyberFlameGO
Copy link

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)
@squidistaken
Copy link

Hi, also getting this issue frequently! Just bumping so it gets more attention. :)

@M4R70
Copy link

M4R70 commented Dec 21, 2024

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

@Nathack-dev
Copy link

Same problem, it happens that the bot crashes several times in an hour.

@rubyowo
Copy link
Contributor

rubyowo commented Dec 30, 2024

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 index thread/logs 🤔

@rubyowo
Copy link
Contributor

rubyowo commented Dec 30, 2024

Seems that eris already has an open PR to fix this: abalabahaha/eris#1582

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

No branches or pull requests

5 participants