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 Specified key was too long #42

Open
isaaclepes opened this issue Dec 4, 2020 · 2 comments
Open

SQL Error Specified key was too long #42

isaaclepes opened this issue Dec 4, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@isaaclepes
Copy link

Plugin produced error after configuring SQL to a mariadb server.

The problem

Error while performing an SQL query! Specified key was too long; max key length is 767 bytes

Steps to Reproduce

  1. Setup a MariaDB server and create a database for server tutorials
  2. Configure access permissions
  3. edit config.yml
  4. restart server
  5. watch log for error [Server Tutorial Plus] Error while performing an SQL query! Specified key was too long; max key length is 767 bytes

Work-around:
The error is produced when Server Tutorials Plus attempts to create the Tutorial_Players table.
I looked at the source code and hand-crafted this query and input it manually to mariadb.

CREATE TABLE Tutorial_Players ( uui VARCHAR(64) NOT NULL, tutorial VARCHAR(255), KEY PRIMARY KEY (uui,tutorial) USING BTREE );

After creating the table manually, server tutorials plus is seemingly able to use it.

@MartenM MartenM added the bug Something isn't working label Dec 6, 2020
@MartenM
Copy link
Owner

MartenM commented Dec 6, 2020

That's very odd. This only occurs when creating the table on startup?
Will try to debug this when I find some time.

Edit: Full stacktrace would be appiciated :)

@isaaclepes
Copy link
Author

isaaclepes commented Dec 6, 2020

Log with stack trace
https://pastebin.com/r90tzJ90

Notes:

Connecting as 'root' user to MariaDB
MariaDB is on a different system
All other SQL supporting plugins on the Minecraft server are using the same MariaDB and credentials with their own databases. None of the others had issues creating tables
git-Paper-279 (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT)

Plugins (23): AsyncWorldEdit, Autorank, BanFromClaim, DynamicShop, dynmap*, Dynmap-GriefPrevention*, Essentials, EssentialsChat, EssentialsGeoIP, GPAccruals*, GPTeleport, GriefPrevention, GriefPreventionFlags, GriefPreventionUtilities, HolographicDisplays, LuckPerms, mcMMO, RealEstate, ServerTutorialPlus*, ShopChest, Statz, Vault, WorldEdit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants