Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MariaDB not working #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

james090500
Copy link

@james090500 james090500 commented Apr 4, 2024

Fixes the below error when using MariaDB:

Removes "useSsl" as it's deprecated and "sslMode" is disabled by default.
https://mariadb.com/kb/en/about-mariadb-connector-j/#tls-parameters

[20:06:34] [Server thread/ERROR]: Error occurred while enabling TimingSystem v2.2-SNAPSHOT (Is it up to date?)
java.lang.RuntimeException: java.beans.IntrospectionException: Method not found: setUseSSL
	at com.zaxxer.hikari.util.PropertyElf.setProperty(PropertyElf.java:141) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	at com.zaxxer.hikari.util.PropertyElf.setTargetFromProperties(PropertyElf.java:64) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	at com.zaxxer.hikari.pool.PoolElf.initializeDataSource(PoolElf.java:154) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:113) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:73) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	at me.makkuusen.timing.system.idb.HikariPooledDatabase.<init>(HikariPooledDatabase.java:56) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	at me.makkuusen.timing.system.database.MariaDBDatabase.initialize(MariaDBDatabase.java:25) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	at me.makkuusen.timing.system.TimingSystem.onEnable(TimingSystem.java:133) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:287) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:188) ~[paper-1.20.4.jar:git-Paper-464]
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.4.jar:git-Paper-464]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.4.jar:git-Paper-464]
	at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.4.jar:git-Paper-464]
	at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:671) ~[paper-1.20.4.jar:git-Paper-464]
	at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.20.4.jar:git-Paper-464]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:309) ~[paper-1.20.4.jar:git-Paper-464]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1131) ~[paper-1.20.4.jar:git-Paper-464]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-464]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.beans.IntrospectionException: Method not found: setUseSSL
	at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:114) ~[?:?]
	at com.zaxxer.hikari.util.PropertyElf.setProperty(PropertyElf.java:132) ~[TimingSystem-2.2-SNAPSHOT+33b65e3.jar:?]
	... 19 more

@JustBru00
Copy link
Member

I appreciate your pull request and I will be implementing this fix.
However I need to make sure we have backwards compatibility by making this change a configuration option or a automatically detected change based on the server version.

@james090500
Copy link
Author

james090500 commented Apr 9, 2024

If the useSsl option isn't specified it will default to false for older versions. The same as sslMode defaulting to disable in newer versions

If you want to make it really backwards/forwards compatible you could support a config option and built it into the map.

sqlOptions:
   sslMode: 'trust'
   example: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants