Shimmermare / InviteRoles

A Discord bot to automatically give roles to users who joined through specific invite.
MIT License
18 stars 9 forks source link

No connection to database #11

Open FreezFree opened 4 years ago

FreezFree commented 4 years ago

Brief background: Everything has worked before, but since I moved the bot files to a new server, unfortunately nothing works anymore.

When I started the application for the first time on the new server (bot was not yet on any discord server) the logs looked good: [08:17:15.818][main][DEBUG]: com.shimmermare.inviteroles.InviteRoles: Reading application properties from resource [08:17:15.823][main][INFO]: com.shimmermare.inviteroles.InviteRoles: Starting InviteRoles Discord Bot version 1.0.1-SNAPSHOT. I'm alive! [08:17:16.532][OkHttp https://discordapp.com/...][DEBUG]: net.dv8tion.jda.internal.requests.Requester: Received response with following cf-rays: [5f487e6e3ace2681-TXL] [08:17:16.934][OkHttp https://discordapp.com/...][DEBUG]: net.dv8tion.jda.internal.requests.Requester: Received response with following cf-rays: [5f487e6f8def2681-TXL] [08:17:16.938][main][INFO]: net.dv8tion.jda.api.JDA: Login Successful! [08:17:17.225][JDA MainWS-ReadThread][INFO]: net.dv8tion.jda.internal.requests.WebSocketClient: Connected to WebSocket [08:17:17.225][JDA MainWS-ReadThread][DEBUG]: net.dv8tion.jda.internal.requests.WebSocketClient: Sending Identify-packet... [08:17:17.282][JDA MainWS-ReadThread][DEBUG]: net.dv8tion.jda.internal.requests.WebSocketClient: Got HELLO packet (OP 10). Initializing keep-alive. [08:17:17.479][JDA MainWS-ReadThread][DEBUG]: net.dv8tion.jda.internal.handle.GuildSetupController: Setting incomplete count to 0 [08:17:17.480][JDA MainWS-ReadThread][INFO]: net.dv8tion.jda.api.JDA: Finished Loading! [08:17:17.516][main][INFO]: com.shimmermare.inviteroles.InviteRoles: Successfully logged in as FF-Invite (745918671117090816). [08:17:17.601][main][INFO]: com.shimmermare.inviteroles.DatabaseService: Successfully connected to database './InviteRoles.db'. [08:17:17.603][main][INFO]: com.shimmermare.inviteroles.InviteRoles: Currently joined 0 servers with a total of 0 members. [08:18:03.284][JDA MainWS-ReadThread][DEBUG]: net.dv8tion.jda.internal.handle.GuildSetupController: Sending chunking requests for 1 guilds [08:18:03.492][JDA Gateway-Worker 1][DEBUG]: net.dv8tion.jda.internal.requests.WebSocketClient: Sending chunk/sync request {"op":8,"d":{"query":"","guild_id":711319243592826941,"limit":0}}

Then I invited the bot to my discord server. After a restart of the .jar file, there is no message anymore that a connection to the database is being established and the bot does not respond to any commands in Discord. Neither with "/ir", nor with "/inviteroles". (The bot did not accept any commands even at the first start with successful connection to the database).

Current logs (The last two lines are constantly repeated): [08:35:34.188][main][DEBUG]: com.shimmermare.inviteroles.InviteRoles: Reading application properties from resource [08:35:34.193][main][INFO]: com.shimmermare.inviteroles.InviteRoles: Starting InviteRoles Discord Bot version 1.0.1-SNAPSHOT. I'm alive! [08:35:34.957][OkHttp https://discordapp.com/...][DEBUG]: net.dv8tion.jda.internal.requests.Requester: Received response with following cf-rays: [5f48993f585c2671-TXL] [08:35:35.275][OkHttp https://discordapp.com/...][DEBUG]: net.dv8tion.jda.internal.requests.Requester: Received response with following cf-rays: [5f4899407b182671-TXL] [08:35:35.279][main][INFO]: net.dv8tion.jda.api.JDA: Login Successful! [08:35:35.588][JDA MainWS-ReadThread][INFO]: net.dv8tion.jda.internal.requests.WebSocketClient: Connected to WebSocket [08:35:35.588][JDA MainWS-ReadThread][DEBUG]: net.dv8tion.jda.internal.requests.WebSocketClient: Sending Identify-packet... [08:35:35.628][JDA MainWS-ReadThread][DEBUG]: net.dv8tion.jda.internal.requests.WebSocketClient: Got HELLO packet (OP 10). Initializing keep-alive. [08:35:35.823][JDA MainWS-ReadThread][DEBUG]: net.dv8tion.jda.internal.handle.GuildSetupController: Setting incomplete count to 1 [08:35:35.851][JDA MainWS-ReadThread][DEBUG]: net.dv8tion.jda.internal.handle.GuildSetupController: Sending chunking requests for 1 guilds [08:35:36.300][JDA Gateway-Worker 1][DEBUG]: net.dv8tion.jda.internal.requests.WebSocketClient: Sending chunk/sync request {"op":8,"d":{"query":"","guild_id":[711319243592826941],"limit":0}} [08:35:55.824][JDA Gateway-Worker 1][DEBUG]: net.dv8tion.jda.internal.handle.GuildSetupController: Sending chunking requests for 1 guilds [08:35:56.321][JDA Gateway-Worker 1][DEBUG]: net.dv8tion.jda.internal.requests.WebSocketClient: Sending chunk/sync request {"op":8,"d":{"query":"","guild_id":[711319243592826941],"limit":0}} [08:36:15.825][JDA Gateway-Worker 1][DEBUG]: net.dv8tion.jda.internal.handle.GuildSetupController: Sending chunking requests for 1 guilds

FreezFree commented 4 years ago

The bot has all required channel rights in Discord. However, the Linux server already hosts another bot. Could this lead to problems?

robhrt7 commented 3 years ago

I'm facing the same issue with 1.0.1 version, bot is online in the channel, but seems like the excepted session is not being started properly, thus the further code of the listener is not being executed and not DB being created nor chat commands processed.

robhrt7 commented 3 years ago

I think it's related to JDA and updated Discord API rules, rendering version 1.0.1 not functional anymore, see https://github.com/DV8FromTheWorld/JDA/issues/1424

robhrt7 commented 3 years ago

FIY, I've managed to patch v1.0.1 to make it work, see commit here in my fork https://github.com/GitNation/InviteRoles/commit/77c2e3ab1c751dcd760747874e11ac3660179210