SideProjectGuys / invite-manager-bot

A discord bot that tracks invites and much more
https://docs.invitemanager.co/
GNU General Public License v3.0
166 stars 135 forks source link

uWs client connection error #177

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello. I am trying to self host InviteManager in a VM running Debian 10 Buster with 1024 megabytes of RAM. Everything went well until the 4th step. I set up node v10.22.0 and mysql 5.7.31. I run npm install which completes successfully. I run the .sql scripts with MySQL on databases im_0 and im_1 which completed successfully the first time (now it outputs stuff in the lines of "already exists") so i doubt the database is the problem. I run "cp config.example.json config.json" and enter my token to the "devtoken" section of the config.json file and save it. Finally i run npm start. It goes well for a while but then keeps throwing:

DISCORD ERROR: { message: 'uWs client connection error',
  stack: 'uWs client connection error' }

This goes on for a infinite loop. How can i fix this? My token is valid, i can self host other bots with it. What actually happened in the shell is below:

user@FermiVM:~/Masaüstü/share/invite-manager-bot-master$ npm start

> discord-invite-manager@9.8.0 start /home/user/Masaüstü/share/invite-manager-bot-master
> cross-env NODE_ENV=dev node scripts/dev-run.js

> discord-invite-manager@9.8.0 build /home/user/Masaüstü/share/invite-manager-bot-master
> tsc

Debugger listening on ws://127.0.0.1:19229/f91af632-a3a1-463d-8c72-e1759192c7e8
For help, see: https://nodejs.org/en/docs/inspector
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/cs.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/cs.json for locale: cs
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/de.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/de.json for locale: de
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/en.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/en.json for locale: en
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/es.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/es.json for locale: es
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/fr.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/fr.json for locale: fr
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/it.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/it.json for locale: it
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/ja.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/ja.json for locale: ja
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/nl.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/nl.json for locale: nl
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/pl.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/pl.json for locale: pl
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/pt.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/pt.json for locale: pt
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/pt_BR.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/pt_BR.json for locale: pt_BR
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/ro.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/ro.json for locale: ro
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/ru.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/ru.json for locale: ru
debug will use /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/tr.json
debug read /home/user/Masaüstü/share/invite-manager-bot-master/i18n/bot/tr.json for locale: tr
-------------------------------------
This is shard 1/1 of regular instance regular
-------------------------------------
We're connected to 1 db shards on 2 different servers
-------------------------------------
Starting bot...
-------------------------------------
Loading commands...
Loaded graph from bin/invites/commands/graph.js
Loaded punishmentConfig from bin/moderation/commands/automod/punishment-config.js
Loaded strikeConfig from bin/moderation/commands/automod/strike-config.js
Loaded placeholder from bin/management/commands/messages/placeholder.js
Loaded disconnect from bin/music/commands/music/disconnect.js
Loaded lyrics from bin/music/commands/music/lyrics.js
Loaded mashup from bin/music/commands/music/mashup.js
Loaded nowPlaying from bin/music/commands/music/now-playing.js
Loaded pause from bin/music/commands/music/pause.js
Loaded play from bin/music/commands/music/play.js
Loaded queue from bin/music/commands/music/queue.js
Loaded repeat from bin/music/commands/music/repeat.js
Loaded resume from bin/music/commands/music/resume.js
Loaded rewind from bin/music/commands/music/rewind.js
Loaded search from bin/music/commands/music/search.js
Loaded seek from bin/music/commands/music/seek.js
Loaded skip from bin/music/commands/music/skip.js
Loaded volume from bin/music/commands/music/volume.js
Loaded botConfig from bin/framework/commands/config/botConfig.js
Loaded config from bin/framework/commands/config/config.js
Loaded interactiveConfig from bin/framework/commands/config/interactiveConfig.js
Loaded inviteCodeConfig from bin/framework/commands/config/inviteCodeConfig.js
Loaded memberConfig from bin/framework/commands/config/memberConfig.js
Loaded permissions from bin/framework/commands/config/permissions.js
Loaded setup from bin/framework/commands/config/setup.js
Loaded addInvites from bin/invites/commands/invites/addInvites.js
Loaded clearInvites from bin/invites/commands/invites/clearInvites.js
Loaded createInvite from bin/invites/commands/invites/createInvite.js
Loaded info from bin/invites/commands/invites/info.js
Loaded inviteCodes from bin/invites/commands/invites/inviteCodes.js
Loaded inviteDetails from bin/invites/commands/invites/inviteDetails.js
Loaded invites from bin/invites/commands/invites/invites.js
Loaded leaderboard from bin/invites/commands/invites/leaderboard.js
Loaded removeInvites from bin/invites/commands/invites/removeInvites.js
Loaded restoreInvites from bin/invites/commands/invites/restoreInvites.js
Loaded subtractFakes from bin/invites/commands/invites/subtractFakes.js
Loaded subtractLeaves from bin/invites/commands/invites/subtractLeaves.js
Loaded caseDelete from bin/moderation/commands/info/caseDelete.js
Loaded caseView from bin/moderation/commands/info/caseView.js
Loaded check from bin/moderation/commands/info/check.js
Loaded makeMentionable from bin/management/commands/roles/makeMentionable.js
Loaded mentionRole from bin/management/commands/roles/mentionRole.js
Loaded reactionRole from bin/management/commands/roles/reactionRoles.js
Loaded botInfo from bin/framework/commands/info/botInfo.js
Loaded credits from bin/framework/commands/info/credits.js
Loaded getBot from bin/framework/commands/info/getBot.js
Loaded help from bin/framework/commands/info/help.js
Loaded members from bin/framework/commands/info/members.js
Loaded ping from bin/framework/commands/info/ping.js
Loaded prefix from bin/framework/commands/info/prefix.js
Loaded support from bin/framework/commands/info/support.js
Loaded addRank from bin/invites/commands/ranks/addRank.js
Loaded fixRanks from bin/invites/commands/ranks/fixRanks.js
Loaded ranks from bin/invites/commands/ranks/ranks.js
Loaded removeRank from bin/invites/commands/ranks/removeRank.js
Loaded ban from bin/moderation/commands/mod/ban.js
Loaded kick from bin/moderation/commands/mod/kick.js
Loaded lockdown from bin/moderation/commands/mod/lockdown.js
Loaded mute from bin/moderation/commands/mod/mute.js
Loaded softBan from bin/moderation/commands/mod/softban.js
Loaded strike from bin/moderation/commands/mod/strike.js
Loaded unban from bin/moderation/commands/mod/unban.js
Loaded unhoist from bin/moderation/commands/mod/unhoist.js
Loaded unmute from bin/moderation/commands/mod/unmute.js
Loaded warn from bin/moderation/commands/mod/warn.js
Loaded export from bin/framework/commands/premium/export.js
Loaded premium from bin/framework/commands/premium/premium.js
Loaded tryPremium from bin/framework/commands/premium/tryPremium.js
Loaded cleanShort from bin/moderation/commands/purge/clean-short.js
Loaded cleanText from bin/moderation/commands/purge/clean-text.js
Loaded clean from bin/moderation/commands/purge/clean.js
Loaded purgeUntil from bin/moderation/commands/purge/purge-until.js
Loaded purge from bin/moderation/commands/purge/purge.js
Loaded 73 commands!
-------------------------------------
Waiting for start ticket...
-------------------------------------
No connection available, this is ok for single installations or in dev mode.
Skipping start ticket...
-------------------------------------
Connecting to discord...
-------------------------------------
DISCORD ERROR: { message: 'uWs client connection error',
  stack: 'uWs client connection error' }
DISCORD ERROR: Error: Connection timeout
    at Timeout.connectTimeout.setTimeout (/home/user/Masaüstü/share/invite-manager-bot-master/node_modules/eris/lib/gateway/Shard.js:1877:20)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
DISCORD DISCONNECT
Send message to RabbitMQ {
  "id": "status",
  "cmd": "STATUS",
  "state": "init",
  "gateway": false,
  "guilds": 0,
  "error": null,
  "tracking": {
    "pendingGuilds": 0,
    "initialPendingGuilds": 0
  },
  "music": {
    "connections": []
  },
  "cache": {
    "guilds": 0,
    "users": 0,
    "channels": 0,
    "roles": 0,
    "ranks": 0,
    "settings": 0,
    "premium": 0,
    "permissions": 0,
    "strikes": 0,
    "punishments": 0,
    "inviteCodes": 0,
    "members": 0,
    "messages": 0
  },
  "metrics": {
    "wsEvents": 0,
    "wsWarnings": 0,
    "wsErrors": 2,
    "cmdProcessed": 0,
    "cmdErrors": 0,
    "httpRequests": [
      {
        "url": "GET:/gateway",
        "stats": {
          "total": 1,
          "succeeded": 1,
          "errors": 0
        }
      }
    ],
    "httpRequestsQueued": []
  }
}
DISCORD ERROR: { message: 'uWs client connection error',
  stack: 'uWs client connection error' }
^C
ghost commented 4 years ago

Fixed by moving the underlying OS to Ubuntu Focal