gauthd: java.sql.SQLException: Incorrect string value
Hello guys!
gauth server crash while non latin characters (russian, or chars like newline, esc) are used in account name (i think so). Does anybody deal with it?
Code:
GQueryPasswd:account is ÑÑдÑ
Ñ220 , login ip is 178.127.153.27
acquireIdPasswd exception:account=ÑÑдÑ
Ñ220
java.sql.SQLException: Incorrect string value: '\xC2\x8C\xC3\xB1\xC2\x88...' for column 'name1' at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1362)
at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:908)
at application.procedure.handler.execute(handler.java:190)
at org.mono.StorageEx.acquireIdPasswd(StorageEx.java:319)
at protocol.MatrixPasswd.Server(MatrixPasswd.java:65)
at com.goldhuman.IO.Protocol.Rpc.Process(Unknown Source)
at com.goldhuman.IO.Protocol.Task.run(Unknown Source)
at com.goldhuman.Common.ThreadPool.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
gauthd: 19 Jan 2012 17:51:38,324 INFO GAuthServer:69 - GQueryPasswd:can not find user ÑÑдÑ
java.version=1.6.0_25
os.arch=i386
os.name=Linux
os.version=2.6.32-5-amd64
mysql-connector-java-5.1.18
Connect string:
jdbc:mysql://127.0.0.1:3306/pw?useUnicode=true&characterEncoding=utf-8&connectTimeout=1000&socketTimeout=1000&autoReconnect=true
Re: gauthd: java.sql.SQLException: Incorrect string value
register script regex, let only ascii chars be used for registration [a-zA-Z0-9]
Re: gauthd: java.sql.SQLException: Incorrect string value
Quote:
Originally Posted by
tbnanubis
register script regex, let only ascii chars be used for registration [a-zA-Z0-9]
The problem persist while you login on the server, using nonexisting username (ie "쉠쉠쉠쉠쉠").
Re: gauthd: java.sql.SQLException: Incorrect string value
What is the SQL if you export user's table's structure ?
Re: gauthd: java.sql.SQLException: Incorrect string value
in file table.xml change characterEncoding from utf8 to ascii
Quote:
<connection name="auth0" poolsize="3" url="jdbc:mysql://127.0.0.1/pw?useUnicode=true&characterEncoding=ascii" username="root" password="pass"/>
2 Attachment(s)
Re: gauthd: java.sql.SQLException: Incorrect string value
Quote:
Originally Posted by
Souris
What is the SQL if you export user's table's structure ?
here it is
Re: gauthd: java.sql.SQLException: Incorrect string value
Quote:
Originally Posted by
alexdnepro
in file table.xml change characterEncoding from utf8 to ascii
Many thanks! This solve my problem.
Re: gauthd: java.sql.SQLException: Incorrect string value
Alternatively you might want to set in your my.cnf (/etc/mysql/conf.d/my.cnf):
Code:
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
(and restart mysql)
Re: gauthd: java.sql.SQLException: Incorrect string value
Quote:
Originally Posted by
Souris
Alternatively you might want to set in your my.cnf (/etc/mysql/conf.d/my.cnf):
Code:
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
(and restart mysql)
this should be default anyways, unless you install some lamp or other packaged version instead of using apt
Re: gauthd: java.sql.SQLException: Incorrect string value
Quote:
Originally Posted by
Souris
Alternatively you might want to set in your my.cnf (/etc/mysql/conf.d/my.cnf):
Code:
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
(and restart mysql)
Do not write stupid things, if not good at this issue, mysql there is absolutely nothing to do with
Re: gauthd: java.sql.SQLException: Incorrect string value
Well, I have same structure and connect line as the OP. And I do not experience crash or problems with special characters (they actually work just fine). Since it's the only difference I could think of, it was worth mentioning :D
Re: gauthd: java.sql.SQLException: Incorrect string value
This problem occurs when the wrong encoding of the database pw, but in fact this is a glitch authorization server, and not the worst, so you believe me;)
Re: gauthd: java.sql.SQLException: Incorrect string value
in fact, you can just recompile authd with a regex check so only english letters are allowed for even trying to login..
Re: gauthd: java.sql.SQLException: Incorrect string value
After setting encoding to ascii java.sql.SQLException is gone, but gauthd server continue crashing..
I will try to explain how it crash (sorry for bad English).
1. We start PW server executing startup_max.sh
2. After some time (1-10 hours) at login stage users experiencing problems like this:
2.1 Delayed login – at login stage server “thinks” for 1-2 minutes before accept or deny authorization.
2.2 Online statistics (how much users are playing on server) on website (generated by gathering data from database) is freezing.
> in fact, you can just recompile authd with a regex check so only english letters are allowed for even trying to login..
Where I can get sources of gauthd? This well help me alot. Server installed by person I lost contact with.
Re: gauthd: java.sql.SQLException: Incorrect string value
DJ Java decompiler will help you
Re: gauthd: java.sql.SQLException: Incorrect string value
Quote:
Originally Posted by
icommitter
After setting encoding to ascii java.sql.SQLException is gone, but gauthd server continue crashing..
I will try to explain how it crash (sorry for bad English).
1. We start PW server executing startup_max.sh
2. After some time (1-10 hours) at login stage users experiencing problems like this:
2.1 Delayed login – at login stage server “thinks” for 1-2 minutes before accept or deny authorization.
2.2 Online statistics (how much users are playing on server) on website (generated by gathering data from database) is freezing.
> in fact, you can just recompile authd with a regex check so only english letters are allowed for even trying to login..
Where I can get sources of gauthd? This well help me alot. Server installed by person I lost contact with.
1st: you can decompile it. im pretty sure though some release here has authd source files included.
2nd: crashing after 10hours is pretty stable for authd. have it in an endless startup loop and let it be killed every hour and you are fine.
Re: gauthd: java.sql.SQLException: Incorrect string value
From what you're saying (point 2.2 specifically) it looks like the problem is with your database (too many connections?) or the database server (overload?).
Try looking mysql logs and doing "top" and "loadavg" on the server that runs mysql DB.
@tbnanubis my authd runs for 2 months without restart =/
Re: gauthd: java.sql.SQLException: Incorrect string value
There are many ways to kill the authorization server (for example to enter a long ban reason, or enter very long user login) they need fix inside authd.