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

SQL error in console #3657

Closed
JorisvD01 opened this issue May 31, 2024 · 6 comments
Closed

SQL error in console #3657

JorisvD01 opened this issue May 31, 2024 · 6 comments
Labels
Bug Issues that contain unintended behavior

Comments

@JorisvD01
Copy link

Describe the issue

All the servers are giving this MySQL error. We have multiple paper servers connected to our plan database to log the statistics.

Exceptions & Other Logs

[13:03:14 ERROR]: [Plan] Ran into CompletionException - logged to plugins/Plan/logs/CompletionException-b54cc983cf.txt
[13:03:14 ERROR]: [Plan] (INCLUDE CONTENTS OF THE FILE IN ANY REPORTS)
[13:03:14 ERROR]: [Plan] Error msg: "com.djrapitops.plan.exceptions.database.DBOpException: SQL Failure: Lock wait timeout exceeded; try restarting transaction"
1fe19e45e0 - Last occurred: 2024-05-31 Occurrences: 2
---- Context 2 ----
Plan v5.6 build 2614
Paper git-Paper-399 (MC: 1.20.4)
Server v1.20.4-R0.1-SNAPSHOT

Transaction: class com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction
DB State: OPEN - fatal: false
Error code: 1205
UPDATE plan_extension_providers SET text=?,description=?,priority=?,condition_name=?,icon_id=?,tab_id=(SELECT id FROM plan_extension_tabs WHERE name=? AND plugin_id=(SELECT id FROM plan_extension_plugins WHERE name=? AND server_uuid=? LIMIT 1) LIMIT 1),show_in_players_table=?,hidden=?,provided_condition=?,format_type=?,player_name=? WHERE plugin_id=(SELECT id FROM plan_extension_plugins WHERE name=? AND server_uuid=? LIMIT 1) AND name=?
Unknown SQL Error code

---- Context 1 ----
Plan v5.6 build 2614
Paper git-Paper-399 (MC: 1.20.4)
Server v1.20.4-R0.1-SNAPSHOT

Transaction: class com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction
DB State: OPEN - fatal: false
Error code: 1205
UPDATE plan_extension_providers SET text=?,description=?,priority=?,condition_name=?,icon_id=?,tab_id=(SELECT id FROM plan_extension_tabs WHERE name=? AND plugin_id=(SELECT id FROM plan_extension_plugins WHERE name=? AND server_uuid=? LIMIT 1) LIMIT 1),show_in_players_table=?,hidden=?,provided_condition=?,format_type=?,player_name=? WHERE plugin_id=(SELECT id FROM plan_extension_plugins WHERE name=? AND server_uuid=? LIMIT 1) AND name=?
Unknown SQL Error code

---- Stacktrace ----
java.util.concurrent.CompletionException: com.djrapitops.plan.exceptions.database.DBOpException: SQL Failure: Lock wait timeout exceeded; try restarting transaction
   java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
   java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
   java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
   java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
   java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
   java.base/java.lang.Thread.run(Thread.java:1583)
Caused by:
com.djrapitops.plan.exceptions.database.DBOpException: SQL Failure: Lock wait timeout exceeded; try restarting transaction
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.exceptions.database.DBOpException.forCause(DBOpException.java:152)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.transactions.ExecStatement.execute(ExecStatement.java:57)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction.lambda$storeProvider$0(StoreProviderTransaction.java:69)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.transactions.Transaction.execute(Transaction.java:223)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction.performOperations(StoreProviderTransaction.java:64)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.transactions.Transaction.executeTransaction(Transaction.java:89)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.SQLDB.lambda$executeTransaction$4(SQLDB.java:353)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.DBAccessLock.performDatabaseOperation(DBAccessLock.java:78)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.DBAccessLock.performDatabaseOperation(DBAccessLock.java:56)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.SQLDB.lambda$executeTransaction$5(SQLDB.java:352)
   java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
   java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
   java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
   java.base/java.lang.Thread.run(Thread.java:1583)
Caused by:
com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
   com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:124)
   com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
   com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:912)
   com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1054)
   com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1003)
   com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1312)
   com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:988)
   Plan-5.6-build-2614 (1).jar//plan.com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
   Plan-5.6-build-2614 (1).jar//plan.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.transactions.ExecStatement.callExecute(ExecStatement.java:70)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.transactions.ExecStatement.execute(ExecStatement.java:64)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.transactions.ExecStatement.execute(ExecStatement.java:55)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction.lambda$storeProvider$0(StoreProviderTransaction.java:69)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.transactions.Transaction.execute(Transaction.java:223)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.storage.transactions.providers.StoreProviderTransaction.performOperations(StoreProviderTransaction.java:64)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.transactions.Transaction.executeTransaction(Transaction.java:89)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.SQLDB.lambda$executeTransaction$4(SQLDB.java:353)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.DBAccessLock.performDatabaseOperation(DBAccessLock.java:78)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.DBAccessLock.performDatabaseOperation(DBAccessLock.java:56)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.SQLDB.lambda$executeTransaction$5(SQLDB.java:352)
   java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
   java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
   java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
   java.base/java.lang.Thread.run(Thread.java:1583)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.storage.database.SQLDB.executeTransaction(SQLDB.java:342)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.providers.gathering.DataValueGatherer.storePlayerNumber(DataValueGatherer.java:562)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.providers.gathering.DataValueGatherer.lambda$gatherPlayer$11(DataValueGatherer.java:374)
   java.base/java.util.Optional.ifPresent(Optional.java:178)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.providers.gathering.DataValueGatherer.gatherPlayer(DataValueGatherer.java:374)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.providers.gathering.DataValueGatherer.tryToUpdateValues(DataValueGatherer.java:344)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.implementation.providers.gathering.DataValueGatherer.updateValues(DataValueGatherer.java:331)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.ExtensionSvc.updatePlayerValues(ExtensionSvc.java:181)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.extension.ExtensionSvc.updatePlayerValues(ExtensionSvc.java:165)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.gathering.events.PlayerLeaveEventConsumer.lambda$updatePlayerDataExtensionValues$3(PlayerLeaveEventConsumer.java:109)
   Plan-5.6-build-2614 (1).jar//com.djrapitops.plan.processing.Processing.lambda$submitNonCritical$1(Processing.java:85)
   java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
   java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
   java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
   java.base/java.lang.Thread.run(Thread.java:1583)

Plugin versions

5.6 build 2614

Additional information

Normal running of the server. Only 2 players online at the time of the error

@JorisvD01 JorisvD01 added the Bug Issues that contain unintended behavior label May 31, 2024
@AuroraLS3
Copy link
Collaborator

You're running a version ~250 commits behind newest release, please see if a newer version resolves the issue

@JorisvD01
Copy link
Author

You're running a version ~250 commits behind newest release, please see if a newer version resolves the issue

Ah. I just updated to 5.6 build 2883, but the same error occured :/

@AuroraLS3
Copy link
Collaborator

One way I've seen this happen is if all servers in a network restart at the exact same time, trying to do all the startup stuff at the same time in the database

@JorisvD01
Copy link
Author

One way I've seen this happen is if all servers in a network restart at the exact same time, trying to do all the startup stuff at the same time in the database

That is what is happening on our network. What time would you suggest to keep between servers restarting?

@AuroraLS3
Copy link
Collaborator

AuroraLS3 commented Jun 2, 2024

I think a ladder approach is a good idea, probably 2-3 minutes between server reboots is enough for the mysql activity to calm down before next server starts - it depends a lot on how long it usually takes for the server to start

@JorisvD01
Copy link
Author

Will try that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that contain unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants