question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MySQL connection wait_timeout too small? (unsure of good title)

See original GitHub issue

Description

Describe the bug

When BentoBox is connected to a database, it causes some errors to show in console after long periods of no activity. The example I have shows that it last received a packet 60,522,509 ms ago.

[03:58:47 ERROR]: [BentoBox] Could not check if key exists in database! db8e5b84-c670-41f6-9a2b-1ad9a8c7e104 The last packet successfully received from the server was 60,522,509 milliseconds ago. The last packet sent successfully to the server was 60,522,510 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.

Steps to reproduce the behavior

  1. Connect BentoBox to a database.
  2. Start the server, make sure the connection is valid.
  3. Wait for a while.
  4. Join the server.
  5. Observe the error in console.

Expected behavior

There should be no error.

Environment

Output of /bbox version (Mandatory)
[06:05:56 INFO]: Running TUINITY 1.16.5.
[06:05:56 INFO]: BentoBox version: 1.16.2
[06:05:56 INFO]: Database: MARIADB
[06:05:56 INFO]: Loaded Game Worlds:
[06:05:56 INFO]: skyblock (Skyblock): Overworld, Nether, The End
[06:05:56 INFO]: Loaded Addons:
[06:05:56 INFO]: Bank 1.3.0 (ENABLED)
[06:05:56 INFO]: Border 3.1.0 (ENABLED)
[06:05:56 INFO]: BSkyBlock 1.14.4 (ENABLED)
[06:05:56 INFO]: Challenges 0.8.4 (ENABLED)
[06:05:56 INFO]: ControlPanel 1.13.0 (ENABLED)
[06:05:56 INFO]: DimensionalTrees 1.6.0 (ENABLED)
[06:05:56 INFO]: InvSwitcher 1.9.0 (DISABLED)
[06:05:56 INFO]: Level 2.7.0-SNAPSHOT-b460 (ENABLED)
[06:05:56 INFO]: Limits 1.15.5 (ENABLED)
[06:05:56 INFO]: MagicCobblestoneGenerator 2.3.0 (ENABLED)
[06:05:56 INFO]: TwerkingForTrees 1.4.1 (ENABLED)
[06:05:56 INFO]: Upgrades 0.2.0-SNAPSHOT-b83 (ENABLED)
[06:05:56 INFO]: Visit 1.3.0 (ENABLED)
[06:05:56 INFO]: Warps 1.10.2 (ENABLED)

Plugins (Optional)

Please ask for this if you need it, AFAIK it is irrelevant.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
untunedcommented, Jun 26, 2021

Take backups, of course, but here are the steps:

  1. Stop server
  2. Take a backup of the world folders, BentoBox folder, and database. 😃
  3. Edit the BentoBox config.yml file to use the database MARIADB2JSON. Keep your MariaDB instance running.
  4. Start the server.
  5. Once BentoBox fully boots up, run /bbox migrate.
  6. Once it’s all copied over, stop the server.
  7. Change the database to JSON.
  8. Restart.

That should do it.

That worked perfectly. Thank you for the support!

0reactions
tastybentocommented, Jun 25, 2021

Take backups, of course, but here are the steps:

  1. Stop server
  2. Take a backup of the world folders, BentoBox folder, and database. 😃
  3. Edit the BentoBox config.yml file to use the database MARIADB2JSON. Keep your MariaDB instance running.
  4. Start the server.
  5. Once BentoBox fully boots up, run /bbox migrate.
  6. Once it’s all copied over, stop the server.
  7. Change the database to JSON.
  8. Restart.

That should do it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to setup a connection timeout depending of the user ...
mysql > SET SESSION wait_timeout = 60; mysql> SHOW VARIABLES LIKE 'wait_timeout'; ...shows 60. Then you can quit the session, reconnect, and ...
Read more >
Connection timeout parameters in MySQL - Pythian Blog
Timeouts should be set very thoughtfully, based on the unique environment. If you're unsure, leave at defaults and adjust when needed. Finally, ...
Read more >
MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
This comes into play when the main MySQL thread gets very many connection requests in a very short time. It then takes some...
Read more >
Best practices for configuring parameters for Amazon RDS for ...
If a client is doing nothing for wait_timeout seconds, the MySQL server terminates the connection. The proper setting for this variable depends ...
Read more >
Why decrease the wait_timeout configuration parameter in ...
If I make the wait_timeout too small then MySQL kills connections that are still valid in the connection pool my web application is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found