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

Need a place to add connection parameters in config.yml #18

Closed
Tarlak333 opened this issue Mar 13, 2021 · 5 comments
Closed

Need a place to add connection parameters in config.yml #18

Tarlak333 opened this issue Mar 13, 2021 · 5 comments

Comments

@Tarlak333
Copy link

Tarlak333 commented Mar 13, 2021

Most plugins support MySQL storage have a line to add extra connection parameters, as shown below. Please add a line in the config to add a parameter string as shown below. The two most critical ones that I use are the "useSSL=" and "autoReconnect=" values.

Example parameter string:
flags: "?useUnicode=true&characterEncoding=utf-8&useSSL=false&autoReconnect=true"

See this site for a listing of parameters:
https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-connection-parameters.html

Because I cannot set these values in the config the connection will eventually timeout and is lost, and you get stuff like this in the console. https://pastebin.com/dnvHdCn8

I have extended the MySQL server connection timeout, to compensate for this....but having the ability to set the client side "autoReconnect=true" parameter is a much better solution.

Thanks,

-Tarlak333

@Tarlak333
Copy link
Author

Issue has not been resolved in 4 weeks now and extending the server connection timout is not a proper solution as the issue persists when the server is idle w/o users for several days:

[09:06:41 INFO]: XXXXXXXXXX[/127.0.0.1:44962] logged in with entity id 16648 at ([normal_world]-163.83902391173444, 75.47098541311021, 405.4080493605847)
[09:06:41 WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
[09:06:41 WARN]: at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[09:06:41 WARN]: at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[09:06:41 WARN]: at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[09:06:41 WARN]: at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[09:06:41 WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
[09:06:41 WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:386)
[09:06:41 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
[09:06:41 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
[09:06:41 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
[09:06:41 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
[09:06:41 WARN]: at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1182)
[09:06:41 WARN]: at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1177)
[09:06:41 WARN]: at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4037)
[09:06:41 WARN]: at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4006)
[09:06:41 WARN]: at dev.lone.EpicBackpacks.e.d.run(Unknown Source)
[09:06:41 WARN]: at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100)
[09:06:41 WARN]: at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54)
[09:06:41 WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[09:06:41 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[09:06:41 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[09:06:41 WARN]: at java.base/java.lang.Thread.run(Thread.java:834)
[09:06:41 WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 72,705,831 milliseconds ago. The last packet sent successfully to the server was 72,705,831 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
[09:06:41 WARN]: at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[09:06:41 WARN]: at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[09:06:41 WARN]: at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[09:06:41 WARN]: at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[09:06:41 WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
[09:06:41 WARN]: at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
[09:06:41 WARN]: at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3706)
[09:06:41 WARN]: at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2506)
[09:06:41 WARN]: at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675)
[09:06:41 WARN]: at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
[09:06:41 WARN]: at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1915)
[09:06:41 WARN]: at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2023)
[09:06:41 WARN]: ... 7 more
[09:06:41 WARN]: Caused by: java.net.SocketException: Broken pipe (Write failed)
[09:06:41 WARN]: at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
[09:06:41 WARN]: at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
[09:06:41 WARN]: at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
[09:06:41 WARN]: at java.base/sun.security.ssl.SSLSocketOutputRecord.deliver(SSLSocketOutputRecord.java:319)
[09:06:41 WARN]: at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1202)
[09:06:41 WARN]: at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
[09:06:41 WARN]: at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
[09:06:41 WARN]: at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3688)
[09:06:41 WARN]: ... 12 more
[09:06:41 INFO]: [EpicBackpacks] [OK] Loaded XXXXXXXXXX personal backpack from MySQL db

@Tarlak333 Tarlak333 changed the title Need a place to add client side ODBC connection parameters in config.yml Need a place to add connection parameters in config.yml Apr 10, 2021
@LoneDev6
Copy link
Collaborator

Thanks, I will look into this as soon as possible, sorry it's hard to handle more than 40 support tickets a day and I hope you understand

@LoneDev6
Copy link
Collaborator

will be added in the upcoming update

@Tarlak333
Copy link
Author

Tarlak333 commented Apr 12, 2021 via email

@LoneDev6
Copy link
Collaborator

no problem, I hope it's not too late and sorry for the wait

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

No branches or pull requests

2 participants