Docker ports on GCP & AWS

I recently dockerized my bot and have it running fine off my local machine, however when deploying it the bot hangs on when the client tries to login. I found a post mentioning that certain ports on GCP and AWS needed to be exposed but they didnt mention which. Anyone run into a similar issue with docker and those hosts? Turns out it actually is logging in, it just isn't recieving the slash commands. I have tried exposing ports 80 and 443 but no luck with those.
6 Replies
d.js toolkit
d.js toolkit14mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Tribe
TribeOP14mo ago
Logs in but I haven’t checked if ready is firing. Deployed it to digital ocean last night and seemed to work fine. So appears to be isolated to GCP VMs So upon looking into this, I am getting the token returned from the login method, but no the ready event is not firing
d.js docs
d.js docs14mo ago
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
client
.on("debug", console.log)
.on("warn", console.log)
client
.on("debug", console.log)
.on("warn", console.log)
- Note: if you initialize your Client as bot or other identifiers you need to use these instead of client - If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebin
Tribe
TribeOP14mo ago
Will have to keep an eye on it with these logs running, I recently moved the container to digital ocean which seemed to have fixed the issue. However it does seem to happen intermittently
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 987
[WS => Shard 0] Connecting to wss://gateway.discord.gg?v=10&encoding=json
[WS => Shard 0] Waiting for event hello for 60000ms
[WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.3040686103552612; waiting 12542ms
[WS => Shard 0] Waiting for identify throttle
[WS => Shard 0] Identifying
shard id: 0
shard count: 1
intents: 33283
compression: none
[WS => Shard 0] Waiting for event ready for 15000ms
Logged in: true
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.
Successfully registered 2 command(s) with 1 guild(s).
[WS => Shard 0] First heartbeat sent, starting to beat every 41250ms
[WS => Shard 0] Heartbeat acknowledged, latency of 25ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 21ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 21ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 27ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 23ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 21ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 22ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 29ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 21ms.
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 987
[WS => Shard 0] Connecting to wss://gateway.discord.gg?v=10&encoding=json
[WS => Shard 0] Waiting for event hello for 60000ms
[WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.3040686103552612; waiting 12542ms
[WS => Shard 0] Waiting for identify throttle
[WS => Shard 0] Identifying
shard id: 0
shard count: 1
intents: 33283
compression: none
[WS => Shard 0] Waiting for event ready for 15000ms
Logged in: true
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.
Successfully registered 2 command(s) with 1 guild(s).
[WS => Shard 0] First heartbeat sent, starting to beat every 41250ms
[WS => Shard 0] Heartbeat acknowledged, latency of 25ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 21ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 21ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 27ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 23ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 21ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 22ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 29ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 21ms.
Here is the log when it stops responding to events, the ready event also does not fire as well but everything else logs wise looks healthy (to me). Does anything stand out that could be an issue?
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
Tribe
TribeOP14mo ago
The ready isnt actually firing even once, I put a console log in the event handler that does go off the few times everything has fired up and worked, but the ready event log isnt actually included in this log. This is just the debug and warn evens being logged along with a few other logs from my script. I believe I have narrowed down the cause. It seem to work when I build the image locally, push it to dockerhub and then pull it to my remote VM and run it. The point of failure is when I build it in a gitub action and then push to dockerhub. But its the same command so I am really unsure what the difference is that could be causing events to fail just from building the same exact image on gibhub vs local. the job that pulls depends on the job that builds and pushes Does anyone know if the gateway events require any ports besides 80 or 443?
Want results from more Discord servers?
Add your server