Skip to main content

Problems With Plugins Accessing Databases

If you get an error like the below with your plugins connecting to databases:

Remember, all plugins display errors in different ways, such as LuckPerms below, but will fill the console with a few lines of errors to tell you it failed to link to the SQL database if you configured the plugin to use one.

Unfortunately, this is mostly always due to you entering the wrong endpoint IP address into the configuration file of said plugin. It can also be username and password being incorrect but it is normally the port not being open to the database host, either configured internally or not open on another system.

For your databases to work correctly, ensure that the plugins host/IP address is pointing to “172.18.0.1” in its config.yml file.  The configuration file might be named differently for your plugin, but the action is the same. Make sure it is not “localhost” or “127.0.0.1” as it shows in the database creation panel, shown below.

All your servers sit in individual houses called docker containers, separated from each other. They cannot see outside themselves to the main internal system, root level. Docker, the system which makes these houses creates a private network adapter with the IP address “172.18.0.1” to all containers internally, so they all link together and know how to interact with one another. This makes them speak on this number to access the databases living on “127.0.0.1”. Think of it as a bridge linking two cities together.

Make sure not to make this mistake when creating databases in the panel and getting errors such as “Connection timed out”, "Communications link failure" and "timeout after 10000ms" in the console.

image-1629134683719.png

image-1629134321122.png

Another most common reason for plugins not accessing databases on the panel is because your systems are running UFW, which is unified firewall. At Jasmeow.Systems, we configure this appropriately with additional rules for security purposes but if 3306 is not allowed internally on your own system, the following rules can be added:

# Allows Votifier Ports
ufw allow in on pterodactyl0 to 172.18.0.1 port 40001:40010 proto tcp
# Allows MC Ports
ufw allow in on pterodactyl0 to 172.18.0.1 port 25566:25580 proto tcp
# Allows Redis
ufw allow in on pterodactyl0 to 172.18.0.1 port 6379 proto tcp
# Allows MongoDB
ufw allow in on pterodactyl0 to 172.18.0.1 port 27017 proto tcp
# Allows MySQL
ufw allow in on pterodactyl0 to 172.18.0.1 port 3306 proto tcp

Any questions, reach out to management.