Cardinal Review

Database errors MySQL, Redis and MongoDB.

When a plugin, bot or app can't reach its database or runs out of connections. 9 errors, each with an example of the console line, the cause and the fix.

All 9 errors on this page
  1. Database refused the login for 'user'
  2. Could not reach the database server
  3. Database 'database' does not exist
  4. Database connection limit reached
  5. Database connection pool failure
  6. SQLite database is locked
  7. Could not connect to Redis
  8. Could not connect to MongoDB
  9. MySQL refused the login method ('Public Key Retrieval is not allowed')

Database refused the login for 'user'

error mysql

In the console

Access denied for user 'user'@'host'

MySQL/MariaDB rejected the username or password, or this user may not connect from this address.

How to fix it

  1. Copy the database username and password again from the server's Databases page (rotate the password there if unsure).
  2. Check the plugin or app config for the right host, port, database name, user and password.
  3. If the database is external, make sure the user is allowed to connect from the node's IP.

Could not reach the database server

error mysql

In the console

Can't connect to MySQL server on host
Communications link failure
CommunicationsException
Unknown MySQL server host 'host'

The connection to the database (host) failed before logging in. The host or port is wrong, the database server is down, or a firewall blocks it.

How to fix it

  1. Use the host and port shown on the server's Databases page, not 'localhost' (localhost means the game container itself).
  2. Check that the database server is running.
  3. If it worked before, check for DNS or network findings at the same time.

Database 'database' does not exist

error mysql

In the console

Unknown database 'database'

The login worked but the database name in the config does not exist on that server.

How to fix it

  1. Copy the exact database name from the Databases page (Pterodactyl prefixes it, for example s12_mydb).
  2. Create the database there if it does not exist yet.

Database connection limit reached

error mysql

In the console

Too many connections
max_user_connections
has more than 'max_user_connections' active connections

The database user has reached its connection limit. A plugin may be opening connections without closing them, or the pool size is set higher than the limit.

How to fix it

  1. Lower the connection pool size in the plugin's config (for example maximumPoolSize in HikariCP settings).
  2. Restart the server to drop leaked connections.
  3. Ask your admin to raise the connection limit for the database if several plugins share it.

Database connection pool failure

error mysql java

In the console

HikariPool- … - Connection is not available
HikariPool- … - Thread starvation or clock leap detected

The plugin's connection pool could not hand out a working connection. Either the database is unreachable, queries are too slow, or the server was frozen long enough for connections to expire.

How to fix it

  1. Check for database connection findings above.
  2. 'Thread starvation or clock leap' means the whole server was frozen; look at CPU usage and lag findings in the same period.
  3. Lower maxLifetime below the database's wait_timeout if connections are dropped while idle.

SQLite database is locked

warning sqlite

In the console

database is locked
SQLITE_BUSY

Two writers tried to use the same SQLite file at once, or a previous process still holds it.

How to fix it

  1. Make sure only one server or process uses that .db file.
  2. For busy plugins, switch to MySQL/MariaDB storage if the plugin supports it.

Could not connect to Redis

error redis

In the console

Unable to connect to Redis
Redis … Connection refused
RedisConnectionException

The app could not reach or authenticate with the Redis server.

How to fix it

  1. Check the Redis host, port and password in the config.
  2. Remember 'localhost' is the container itself; use the Redis server's real address.

Could not connect to MongoDB

error mongodb node

In the console

MongoServerSelectionError
MongoNetworkError
MongooseServerSelectionError
MongoParseError

The app could not connect to MongoDB. The connection string is wrong, the cluster is down, or MongoDB Atlas does not allow the node's IP.

How to fix it

  1. Check the connection string (mongodb:// or mongodb+srv://) and credentials.
  2. In MongoDB Atlas, add the node's IP to Network Access.
  3. Make sure the Docker image's DNS can resolve SRV records (see DNS findings).

MySQL refused the login method ('Public Key Retrieval is not allowed')

error database

In the console

Public Key Retrieval is not allowed

The MySQL 8 server uses caching_sha2_password logins, and the connector refused to fetch the server's key over an unencrypted connection. Many plugins hit this with a fresh MySQL 8 database.

How to fix it

  1. Add allowPublicKeyRetrieval=true (and useSSL=false if you are not using SSL) to the plugin's JDBC connection properties or URL.
  2. Or turn on SSL for the connection, which removes the need to fetch the key.
  3. Restart the server after changing the plugin's database settings.

Not sure which one you have?

Paste your log into the live demo, or install Cardinal Review Lite and it will point at the line for you. Lite is free.