ItemJoin

ItemJoin

157k Downloads

Error with DB operation

microwin7 opened this issue · 24 comments

commented

1.) 5.0.6
2.) PaperSpigot 1.12.2-1618
3.) Installed the plugin, tried to connect to MySQL
4.) https://pastebin.com/49cCbhjN
5.) https://pastebin.com/A2JPUaHR

commented

This bug has been officially fixed in the release of ItemJoin v5.0.7.
You can grab it here; Download: https://www.spigotmc.org/resources/itemjoin.12661/download?version=354306

Please read the changelog as the documentation has not been updated yet;
https://github.com/RockinChaos/ItemJoin/wiki/Recent-Changes

commented

https://pastebin.com/n1HwcnCb
Here's what I noticed when turning off the server

commented

I think this is similar to #272 but I never did hear back from them.
This should help me resolve the issue.

Also, can you provide me a pastebin of your config.yml please? You can replace the password/username and hostname with some fake information but I need the formatting to stay the same so I can check the file integrity.

commented

But the fact that in paragraph 4 does not work?

commented

Oh derp sorry, I thought I clicked that one when it showed me the error message, I guess I was clicking the second and third Pastebin you sent me.

It looks like the issue is with the table. Typically tables are defined as a simple name such as bungee_cord_players or in your case, it looks like it should be lobby_bungee_minigames as MySQL doesn't take an input of special characters. To me, it looks like they came from a URL.

So from what I can tell the table is suppose to be listed as lobby_bungee_minigames (if that is not the name of the table maybe a screenshot will be able to help). Try changing that and let me know if it resolved the issue.

commented

image

commented

Ahh yeah, so the name of the table is lobby_bungee_minigames. So change your table to that in the config.yml.

commented

I didn’t understand a bit, that is, do I need to create some kind of table myself? because lobby_bungee_minigames is the name of the base into which the plug-in should create its own table

commented

Ahh okay, so ItemJoin cannot create a table itself as it doesn't have the permissions to do so since it is not a real user. It can only create subtables which is why plugins always ask for the name of the table to put its subtables into requiring you to create a table manually.

If you want ItemJoin to have its own table you will need to create one. Then it will store all of the data under that table.

From what I can tell lobby_bungee_minigames should work if you want to house all plugin data under that table as it will simply create subtables alongside the other plugin data you have there.

EDIT: Let me know if that doesn't make sense.

commented

can you please write the path to the class to work with the database? I’ll try to understand what I’ve made a mistake or some non-standard method of interaction is

commented

Not quite sure what you mean, this is the SQL classes for ItemJoin;
https://github.com/RockinChaos/ItemJoin/tree/master/src/me/RockinChaos/itemjoin/utils/sqlite

1.) ItemJoin creates subtables, notice your lobby_bungee_minigames contains the subtables chat_color, chat_color_options, and so on. This is what ItemJoin creates. It will create about 8 subtables called mapids, first-join, first-world, ip-limits, etc.

If you want to continue to house all your data in a single table AKA lobby_bungee_minigames simply set this in your config.yml. If you want to have all data separated for ItemJoin simply create a new table (like lobby_bungee_minigames) and call it something different, then it will generate all the subtables under there to store the ItemJoin data.

If you want to use the lobby_bungee_minigames table your config.yml should look like this;

Database:
  MySQL: true
  host: 'localhost'
  port: 3306
  table: 'lobby_bungee_minigames'
  user: '**********'
  pass: '*************************************'
commented

image
image

commented

image

commented

I have MariaDB, if that

commented

1.) Did you assign the user to have read/write permissions for the itemjoin table?
2.) What text editor are you using? I notice the LF symbols do not look normal, these don't actually save to the config.yml right? When you copy/paste it into Pastebin it removed them?

commented

image
2) Notepad++
These characters are just a visualization of the end of a line and show where spaces are and where possibly erroneous tab characters are possible, instead of 4 spaces. In fact, this part of the file looks like this
image
UTF-8 file encoding

commented

Ahhh yes, that does look correct in the config.yml.
You have a password defined in the config.yml for the user but for the user listed in MariaDB, I do not see a password defined, it looks like it should be the line under localhost пароль? Apologies if I am incorrect, I am unable to read what I think is Russian.

Also, I noticed there are some special symbols in the password, if it still does not work can you try a password like 1234 just to test it to see if it is special characters causing the issue?

commented

the password in the admin panel is hidden. and what about access and correct password, it’s 100% because I’m already using many plugins with this connection

commented

maybe your plugin is not able to support unicode password?
I'll go check

commented

Yeeeees....
image
image

commented

Ahhhh, interesting... Looks like I have something to work on then :P

Quite odd as I had to enable Unicode support to allow multiple languages in the lang.yml so it should have carried over to the config.yml.

Thanks for your time and patience to help figure this out. I will work on a patch for Unicode characters and post back here when I push a snapshot fixing this. For now, if it's not an issue, you can use a standard password and when I push the snapshot you can change it to a Unicode password--the data will retain itself.

commented

good

commented

Okay, so I was able to replicate this issue.

This issue occurred because ItemJoin encodes the password when it is committed to memory to prevent any misusage of the password, so it is essentially only accessible via the config.yml. It then later decodes the password when connecting to the database. The encoder and decoder uses Base64 and was missing the UTF-8 option which after enabling it, now properly allows the use of Unicode characters.

This is the snapshot that it has been fixed in; http://ci.craftationgaming.com/job/ItemJoin/407/

commented

Wow, super, thanks)