TownyAdvanced / Towny

Towny Advanced Minecraft plugin for Bukkit/Spigot.
https://townyadvanced.github.io
Other
526 stars 352 forks source link

MySQL duplicate error- Residents edition #2184

Closed LlmDl closed 9 years ago

LlmDl commented 9 years ago

Originally reported on Google Code with ID 2162

What steps will reproduce the problem?
1. Install towny. Configure for mySQL.
2. Start server.
3. Have new player join (and leave quickly)?

What is the expected output? : Server running smoothly.

What do you see instead? : Tons of console spam, server cannot be /stopped, when server
is restarted it's fine. Console spam is as follows:

[23:54:55] [pool-3-thread-15/WARN]: [Towny] Error: SQL: Duplicate entry '<username>'
for key 'PRIMARY' --> com.mysql.jdbc.JDBC4PreparedStatement@3522d66d: INSERT INTO REGALIS_RESIDENTS
(<various table data here>) VALUES (<values here>)

values are the defaults. I copied this by hand and didn't feel like copying all of
those; I couldn't open the log files to copy/paste.

What is your Towny version number? : 0.88.0.1

What is your TownyChat version number? : not installed

What is your Bukkit version number? : Spigot 1.7.10 with 1.8 compatibility patch

What operating system? : Windows 8.1 64x 

Please use pastebin.com to link the following files:
- Your full server startup from server.log:
all attempts to get this failed. the log files are enormous and compressed in .gz format
by spigot. 7-zip fails to decompress them and the file fails to download from the server
when we try. We've tried everything to get it. Any suggestions are welcome.

- Your towny config.yml (if using MySQL please remove pasword,)
http://pastebin.com/afrV8VFg

- Your townyperms.yml,
http://pastebin.com/QACwCqY5

- Your permissions file.
Our permissions are stored in mySQL and thus difficult to put into a paste. Because
this is an issue with new players who have never joined the server before and SQL,
I do not believe it to be an SQL issue. I could be wrong.

THINGS TO NOTE:
- the issue seems to be a special case problem; our server gets lots of new players
constantly and it only happens about once every 24 hours. It happens with a different
username every time.

- We are a BungeeCord server. However, all of our towny instances on our various servers
are kept separate and have no direction interaction with each other. That being said,
Bungee may be the cause of the problem. We are also an offline mode server because
we run Bungee.

- Also, towny feels compelled to take a backup every time this happens and the server
crashes, which is a pain because it takes forever to start up. It would be nice if
there was a config option to disable automatic backups.

I'll be checking this post often to see what you guys can dig up. I really wish I could
access the log data for right when the spam started, because I bet the stacktrace there
would have the answer. If it happens again I'll try to pounce on it and dig it out.

Thanks very much! I hope you guys can solve it.

Reported by starquestminecraft on 2014-10-01 02:09:44

LlmDl commented 9 years ago
" Because this is an issue with new players who have never joined the server before
and SQL,"

If a player hasn't joined the server yet, Towny wouldn't have created any entries for
them yet.

Can you clarify this?

Reported by LlmDlio on 2014-10-01 13:16:44

LlmDl commented 9 years ago
Apologies. It was quite late when I wrote this and I was not, perhaps, at my most coherent.

The issue stems from a new player joining the server. The username involved in the
spam is always a player who has just joined for the first time. It is my belief that
something in the initial registration of a new player by Towny causes the issue.

What I was trying to say there was that because the issue stems from this registration
of a new player, which occurs no matter what permissions the player has, I shouldn't
need to go through the ordeal of exporting my permissions from SQL and putting them
into a paste. 

Reported by starquestminecraft on 2014-10-01 20:42:56

LlmDl commented 9 years ago
This and the other ticket are both new issues as of 0.88.0.1, you could attempt to use
the 0.88.0.0 version but neither are very reliable on mysql, the newer version is to
fix other DB errors. The version 0.88.0.1 has produced less errors in mysql databases
so far and is an issue we haven't been able to track down. 

It is not affecting mysql servers en masse so it looks as though its a mysql issue
localized on the server the issue exists on.

I'm going to leave this ticket open for now, as more people coming forward with the
issue might see some sort of fix, if that's possible. I should also tell you we are
not actively developing for Bukkit any more and a total recode of Towny including a
new database schema/saving and loading code is underway in preparation of our launch
on Sponge.

Reported by LlmDlio on 2014-10-02 00:59:43

LlmDl commented 9 years ago
Great... Spigot's still around you know! With spigot still here there's no reason to
abandon the bukkit API! :P

Anyway, thanks for your help. I will keep the current version around for awhile because
I hope to be able to provide more information on the problem.

Reported by starquestminecraft on 2014-10-02 01:22:38

LlmDl commented 9 years ago
Please download latest dev, 0.88.0.2

Reported by LlmDlio on 2014-10-19 21:03:58

LlmDl commented 9 years ago

Reported by LlmDlio on 2014-10-22 16:06:08