discord-tickets / bot

The most popular open-source and self-hosted ticket management bot for Discord - a free alternative to the premium and white-label plans of other popular ticketing bots.
https://discordtickets.app
GNU General Public License v3.0
941 stars 477 forks source link

[BUG] Reconnect to database fail #558

Open Luzifix opened 1 month ago

Luzifix commented 1 month ago

Is there an existing issue for this?

Current Behavior

After lose connection to the database the reconnect not work and only a restart of the docker container helps

Expected Behavior

The bot can reconnect to the database after losing connection

Steps To Reproduce

  1. Start the database and the bot
  2. Kill the database process
  3. Do a command like /force-close or any other which result into database actions
  4. Start the Database
  5. Do the same command
  6. You still get the error:
    
    [08/09/24 10:17:04] [INFO] (PRISMA) @../../app/src/client.js:96:46 quaint::pooled Starting a mysql pool with 29 connections.
    [08/09/24 10:17:07] [ERROR] (PRISMA) @../../app/src/client.js:95:48 guild.findUnique 
    Invalid `prisma.guild.findUnique()` invocation:

Can't reach database server at 127.0.0.1:3306


### Environment

```markdown
- OS: Linux
- Node: docker
- NPM: docker
- Bot: 4.0.19

Anything else?

Im using a MariaDB 10.6.19 as MySQL Server

eartharoid commented 1 month ago

The JSON Protocol in Prisma Client v5 might fix this.