Triton icon indicating copy to clipboard operation
Triton copied to clipboard

MySQL not working on Velocity

Open NetheriteTree opened this issue 2 years ago • 5 comments

Describe the bug When using Triton with Velocity, Triton can not connect to MySQL server And on paper it connected normally

To Reproduce 1.Using Triton with Velocity 2.Config Triton to use MySQL 3.java.sql.SQLException: No suitable driver

Expected behavior connect to MySQL server successfully

Server information (please complete the following information):

  • Server Minecraft Version: 1.18.2
  • Client Minecraft Version (if using ViaVersion or something similar): 1.18.2
  • BungeeCord (specify if it's a fork) Velocity 3.1.2
  • Triton Version: 3.8.0

Additional context 29.06 03:25:41 [Server] INFO [triton]: [DEBUG] Reading config.yml file... 29.06 03:25:41 [Server] INFO [com.rexcantor64.shaded.hikari.HikariDataSource]: HikariPool-1 - Starting... 29.06 03:25:41 [Server] ERROR [triton]: Failed to connect to database, falling back to local storage! 29.06 03:25:41 [Server] INFO java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:mysql://********:3306/triton?useSSL=false&useUnicode=yes&characterEncoding=UTF-8 29.06 03:25:41 [Server] INFO at com.rexcantor64.shaded.hikari.util.DriverDataSource.(DriverDataSource.java:114) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.shaded.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:331) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.shaded.hikari.pool.PoolBase.(PoolBase.java:114) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.shaded.hikari.pool.HikariPool.(HikariPool.java:108) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.shaded.hikari.HikariDataSource.(HikariDataSource.java:81) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.triton.storage.MysqlStorage.load(MysqlStorage.java:67) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.triton.Triton.setupStorage(Triton.java:147) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.triton.Triton.reload(Triton.java:106) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.triton.VelocityMLP.reload(VelocityMLP.java:60) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.triton.Triton.onEnable(Triton.java:95) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.triton.VelocityMLP.onEnable(VelocityMLP.java:39) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.triton.plugin.VelocityPlugin.onEnable(VelocityPlugin.java:38) ~[?:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.triton.plugin.Lmbda$3.execute(Unknown Source) ~[?:?] 29.06 03:25:41 [Server] INFO at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[velocity.jar:3.1.2-SNAPSHOT (git-e8bf6ab5-b161)] 29.06 03:25:41 [Server] INFO at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[velocity.jar:3.1.2-SNAPSHOT (git-e8bf6ab5-b161)] 29.06 03:25:41 [Server] INFO at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[velocity.jar:3.1.2-SNAPSHOT (git-e8bf6ab5-b161)] 29.06 03:25:41 [Server] INFO at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] 29.06 03:25:41 [Server] INFO at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] 29.06 03:25:41 [Server] INFO at java.lang.Thread.run(Thread.java:833) [?:?] 29.06 03:25:41 [Server] INFO Caused by: java.sql.SQLException: No suitable driver 29.06 03:25:41 [Server] INFO at java.sql.DriverManager.getDriver(DriverManager.java:299) ~[java.sql:?] 29.06 03:25:41 [Server] INFO at com.rexcantor64.shaded.hikari.util.DriverDataSource.(DriverDataSource.java:106) ~[?:?] 29.06 03:25:41 [Server] INFO ... 18 more 29.06 03:25:41 [Server] INFO [triton]: Created a sample translations/default.json file since there were no translations 29.06 03:25:41 [Server] INFO [triton]: Loaded local storage manager 29.06 03:25:41 [Server] INFO [triton]: Successfully setup the language manager! 2 languages and 0 language items loaded!

NetheriteTree avatar Jun 29 '22 03:06 NetheriteTree

Unfortunately Triton does not include a MySQL driver yet. Since velocity doesn't provide one by default, you can use a plugin that imports it, as a workaround: https://github.com/ksqeib445/Velocity-MysqlDriverFix/releases/tag/%E8%8A%B1%E5%BF%83%E7%89%88

diogotcorreia avatar Jun 29 '22 07:06 diogotcorreia

I'll leave this open since it's still a bug I'd like to fix in the future

diogotcorreia avatar Jun 29 '22 14:06 diogotcorreia

Hi I still has this issue, I tried to use https://github.com/ksqeib445/Velocity-MysqlDriverFix/releases/tag/%E8%8A%B1%E5%BF%83%E7%89%88 but this plugin doesn't work either.

Log:

[11:04:20 ERROR] [triton]: Failed to connect to database, falling back to local storage!
java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:mysql://MYIPADDRESS:3306/proxy?useSSL=false&useUnicode=yes&characterEncoding=UTF-8
        at com.rexcantor64.shaded.hikari.util.DriverDataSource.<init>(DriverDataSource.java:114) ~[?:?]
        at com.rexcantor64.shaded.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:331) ~[?:?]
        at com.rexcantor64.shaded.hikari.pool.PoolBase.<init>(PoolBase.java:114) ~[?:?]
        at com.rexcantor64.shaded.hikari.pool.HikariPool.<init>(HikariPool.java:108) ~[?:?]
        at com.rexcantor64.shaded.hikari.HikariDataSource.<init>(HikariDataSource.java:81) ~[?:?]
        at com.rexcantor64.triton.storage.MysqlStorage.load(MysqlStorage.java:67) ~[?:?]
        at com.rexcantor64.triton.Triton.setupStorage(Triton.java:149) ~[?:?]
        at com.rexcantor64.triton.Triton.reload(Triton.java:107) ~[?:?]
        at com.rexcantor64.triton.VelocityMLP.reload(VelocityMLP.java:60) ~[?:?]
        at com.rexcantor64.triton.Triton.onEnable(Triton.java:96) ~[?:?]
        at com.rexcantor64.triton.VelocityMLP.onEnable(VelocityMLP.java:39) ~[?:?]
        at com.rexcantor64.triton.plugin.VelocityPlugin.onEnable(VelocityPlugin.java:38) ~[?:?]
        at com.rexcantor64.triton.plugin.Lmbda$17.execute(Unknown Source) ~[?:?]
        at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[velocity.jar:3.2.0-SNAPSHOT (git-19abb909-b265)]
        at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:597) ~[velocity.jar:3.2.0-SNAPSHOT (git-19abb909-b265)]
        at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:478) ~[velocity.jar:3.2.0-SNAPSHOT (git-19abb909-b265)]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:299) ~[java.sql:?]
        at com.rexcantor64.shaded.hikari.util.DriverDataSource.<init>(DriverDataSource.java:106) ~[?:?]
        ... 18 more

dodoflix avatar Nov 12 '23 10:11 dodoflix

@dodoflix I'd recommend trying the Triton v4 beta version for Velocity, since that issue is fixed there. If you're building from source, that's the v4 branch, otherwise there's a thread called Triton v4 on the #discussion channel on the Discord server where you can find the built JAR.

diogotcorreia avatar Nov 12 '23 10:11 diogotcorreia

@dodoflix I'd recommend trying the Triton v4 beta version for Velocity, since that issue is fixed there. If you're building from source, that's the v4 branch, otherwise there's a thread called Triton v4 on the #discussion channel on the Discord server where you can find the built JAR.

I didn't know there are an beta channel tysm. Btw you're on rocket speed

dodoflix avatar Nov 12 '23 10:11 dodoflix