Arakne/Araknemu

ERROR - RateLimit : close session

Closed this issue · 6 comments

Hi, first of all thanks for your work.
I'm python dev, and I'm interested to work a bit on the project.

I'm trying to connect to the server with a client, but I have this error during the authentication step:

2022-04-29 12:19:52,257 ERROR [ip=127.0.0.1; account=1] RateLimit : close session

I also try to change the configuration, but there is no impact:
packetRateLimit = 1000

What I did (I work on Linux):

  • Build project
  • Init database: create all tables (Mysql)
  • Insert a stupid account: INSERT INTO `araknemu`.`ACCOUNT` ( `USERNAME`, `PASSWORD`, `PSEUDO`, `PERMISSIONS`, `QUESTION`, `ANSWER`) VALUES ( 'martin', 'matin', 'martinmatin', 1, "blabla", "blablabla")
  • Update conf
  • Run server

I use client v1.29.

Thanks.

Hello,
can you enable TRACE logs by changing root level on log4j2.xml :

        <Root level="INFO">
            <AppenderRef ref="STDOUT" level="TRACE"/>
            <AppenderRef ref="errors" level="ERROR" />
        </Root>

to :

        <Root level="TRACE">
            <AppenderRef ref="STDOUT" level="TRACE"/>
            <AppenderRef ref="errors" level="WARN" />
        </Root>

and see exchanged packets ?

Here this is the log after enabled TRACE when I try to connect to the account:

2022-05-01 15:56:22,889 DEBUG -Dio.netty.buffer.checkAccessible: true
2022-05-01 15:56:22,890 DEBUG -Dio.netty.buffer.checkBounds: true
2022-05-01 15:56:22,891 DEBUG Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@66627eb4
2022-05-01 15:56:22,926 DEBUG [ip=127.0.0.1] Session created
2022-05-01 15:56:22,927 DEBUG [ip=127.0.0.1] Send >> HCkbrrozdneucghwjlsacstjjrjbiigidk
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.maxCapacityPerThread: 4096
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.maxSharedCapacityFactor: 2
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.linkCapacity: 16
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.ratio: 8
2022-05-01 15:56:22,933 DEBUG -Dio.netty.recycler.delayedQueue.ratio: 8
2022-05-01 15:56:22,957 DEBUG [ip=127.0.0.1] Recv << 1.29.1
2022-05-01 15:56:22,958 DEBUG [ip=127.0.0.1] Recv << martin
#1X4OJ524719
2022-05-01 15:56:22,959 DEBUG Prepare query SELECT * FROM ACCOUNT WHERE USERNAME = ?
2022-05-01 15:56:22,969 DEBUG Prepare query SELECT COUNT(*) FROM BANISHMENT WHERE ACCOUNT_ID = ? AND START_DATE <= ? AND END_DATE >= ?
2022-05-01 15:56:23,150 DEBUG Prepare query REPLACE INTO CONNECTION_LOG (`ACCOUNT_ID`, `START_DATE`, `IP_ADDRESS`) VALUES (?, ?, ?)
2022-05-01 15:56:23,161 DEBUG [ip=127.0.0.1; account=1] Send >> Admartinmatin
2022-05-01 15:56:23,162 DEBUG [ip=127.0.0.1; account=1] Send >> Ac0
2022-05-01 15:56:23,163 DEBUG [ip=127.0.0.1; account=1] Send >> AlK0
2022-05-01 15:56:23,165 DEBUG [ip=127.0.0.1; account=1] Send >> AQblabla
2022-05-01 15:56:23,165 DEBUG [ip=127.0.0.1; account=1] Send >> AH1;1;110;1
2022-05-01 15:56:23,166 DEBUG [ip=127.0.0.1; account=1] Recv << Af
2022-05-01 15:56:23,166 DEBUG [ip=127.0.0.1; account=1] Send >> Aq1
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Recv << Af
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Send >> Aq1
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Recv << Af
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Send >> Aq1
...
...
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Recv << Af
2022-05-01 15:56:23,167 DEBUG [ip=127.0.0.1; account=1] Send >> Aq1
2022-05-01 15:56:23,239 ERROR [ip=127.0.0.1; account=1] RateLimit : close session
2022-05-01 15:56:23,261 DEBUG [ip=127.0.0.1; account=1] Session closed

Also there are 2 errors when I start the server:

2022-05-01 16:02:11,387 DEBUG direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
        at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31) ~[araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:253) ~[araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:247) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:294) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:88) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.ConstantPool.<init>(ConstantPool.java:34) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.AttributeKey$1.<init>(AttributeKey.java:27) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.AttributeKey.<clinit>(AttributeKey.java:27) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.core.network.netty.SessionHandlerAdapter.<init>(SessionHandlerAdapter.java:41) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.core.network.netty.NettyServer.start(NettyServer.java:72) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.realm.RealmService.boot(RealmService.java:67) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.Araknemu.boot(Araknemu.java:88) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.Araknemu.main(Araknemu.java:186) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
2022-05-01 16:02:11,402 DEBUG jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.IllegalAccessException: class io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @d737b89
        at jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361) ~[?:?]
        at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:558) ~[?:?]
        at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:375) ~[araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:366) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:294) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:88) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.ConstantPool.<init>(ConstantPool.java:34) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.AttributeKey$1.<init>(AttributeKey.java:27) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at io.netty.util.AttributeKey.<clinit>(AttributeKey.java:27) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.core.network.netty.SessionHandlerAdapter.<init>(SessionHandlerAdapter.java:41) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.core.network.netty.NettyServer.start(NettyServer.java:72) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.realm.RealmService.boot(RealmService.java:67) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.Araknemu.boot(Araknemu.java:88) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]
        at fr.quatrevieux.araknemu.Araknemu.main(Araknemu.java:186) [araknemu-0.9.1-alpha-jar-with-dependencies.jar:0.9.1-alpha]

For your issue, this is caused by the spamming of Af packet. This is probably due to invalid SWF redirection : the configuration item C.DELAY_WAIT_QUEUE_REFRESH cannot be loaded from lang_xxx_xx.swf, so il will ask for que position (i.e. Af packet) with an interval of 0 ms.

For the two other messages it's not an issue : it's simply means that netty cannot access to some optimisation because of JVM version or configuration.

Thanks for your answer.
Actually, I'm not really sure of how to configure lang in the client.

After some research, this is what I did:

  • I download lang folder in local with this code
  • I start a web server to serve the lang folder, I update config.xml file from the client like this:
<conf name="localhost">
  <connserver name="localhost" ip="127.0.0.1" port="4444"/>
  <dataserver url="http://127.0.0.1:9000/dofus/" priority="1" />
  <dataserver url="data/" type="local" priority="0" />
</conf>
  • My client load the lang and start, the lang is well loaded. But after few seconds it crash, I think when it's load the news or something like this. So I can't login.
    And if I check my web server logs, files are well loaded without error:
127.0.0.1 - - [01/May/2022 19:03:20] "GET /dofus/lang/versions.swf HTTP/1.1" 200 -
127.0.0.1 - - [01/May/2022 19:03:20] "GET /dofus/lang/versions_en.txt?wtf=0.179472817108035 HTTP/1.1" 200 -
127.0.0.1 - - [01/May/2022 19:03:20] "GET /dofus/lang/swf/lang_en_1077.swf HTTP/1.1" 200 -
127.0.0.1 - - [01/May/2022 19:03:39] "GET /dofus/lang/versions.swf HTTP/1.1" 200 -
127.0.0.1 - - [01/May/2022 19:03:39] "GET /dofus/lang/versions_en.txt?wtf=0.632525463588536 HTTP/1.1" 200 -

I know that is client configuration and, it's maybe out of scope. I will try to find a solution by myself. But if you have any idea, it can be really useful to me.

EDIT:

I found an archive with all lang, I served this files, now it's work! The authentication works well 👍. Following this, I have 2 questions:

  • Does that mean we have to launch a web server in parallel, to serve some .swf files (lang files)? If yes, this server is not include in the project?
  • Do we have a dataset to insert in database? Even if it's "stupid" data. If it's not the case, I will try to build one.

Thanks.

For your first question, yes it's required to have a server which provide lang files. But you can use official ankama URL if you don't want to run your own web server. But it's totally out of the scope of the game server : it's for client.
For the basic data set I can send you a dump by email if you want.

Ok, I was thinking that is mandatory to run a server in local to serve those files, so in this case that make sense to add some documentation in the project. But i misunderstood. Thanks to take time to solve my issue.

PS: I just send you an email for the dataset, on your gmail address (it's a protonmail address)