TheHolyWaffle / TeamSpeak-3-Java-API

A Java wrapper of TeamSpeak's 3 server query API.
MIT License
306 stars 107 forks source link

ReconnectionStrategy failed? - Connection timed out Error twice #276

Open Tobias3107 opened 6 years ago

Tobias3107 commented 6 years ago

Hello Guys, I have a VServer where i let it run. But sometimes there comes a error. Where i thing there musst start the reconnectionhandler. Some times comes this error. This error comes everytime twice. i use the "ReconnectStrategy.exponentialBackoff()"

[[TeamSpeak-3-Java-API] SocketReader] ERROR com.github.theholywaffle.teamspeak3.SocketReader - Connection timed out. java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at java.net.SocketInputStream.read(SocketInputStream.java:171) at java.net.SocketInputStream.read(SocketInputStream.java:141) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:161) at java.io.BufferedReader.readLine(BufferedReader.java:324) at java.io.BufferedReader.readLine(BufferedReader.java:389) at com.github.theholywaffle.teamspeak3.SocketReader.run(SocketReader.java:82)

rogermb commented 6 years ago

Hi!

It would make sense for this error to appear once, as the query logs the exception that caused the connection loss - but it probably shouldn't appear twice. However, this one stack trace really isn't much to work with.

Could you please turn on communications logging before starting the query (call setEnableCommunicationsLogging(true) on your TS3Config object), wait for such an error, and finally upload the relevant part of the communications log here?

Thanks :smiley:

Tobias3107 commented 6 years ago

So now i new why this comes. This comes every time when the Bot lose his connection. But i dont know why he lose his connection. This error comes because i had enable the Comminication but only for warns. So and then comes this error. I connect via SSH on the Vserver ( linux) then i write "screen -L ./startARS.sh

startARS.sh is a start script. The Screen is only for running it in background. if you now another way that should be work that were be nice. Then i disconnect from the ssh. Bot should be running in the background. It does. and then few hours later he lose his connection. And when i doenst connect to the ssh and the screen then he doesnt reconnect. He try it only twice. The Following log comes when i see the bot is disconnecting and then i connect to ssh and to the Screen from the bot. Also a question is how i can do every time the log in a file. example 2 log files. One with only the Console log that only says what musst be says. and a Debug log file. Then i can react better when i see a error or a problem.

[[TeamSpeak-3-Java-API] SocketWriter] DEBUG com.github.theholywaffle.teamspeak3.SocketWriter - [clientinfo] > clientinfo clid=141 [[TeamSpeak-3-Java-API] SocketReader] DEBUG com.github.theholywaffle.teamspeak3.SocketReader - [event] < notifycliententerview cfid=0 ctid=24997 reasonid=0 clid=141 client_unique_identifier=NFp6FH7o+fNF5rLRZTEP6AbluME= client_nickname=Test client_input_muted=0 client_output_muted=0 client_outputonly_muted=0 client_input_hardware=1 client_output_hardware=1 client_meta_data client_is_recording=0 client_database_id=61194 client_channel_group_id=2875 client_servergroups=9572,9599 client_away=0 client_away_message client_type=0 client_flag_avatar client_talk_power=0 client_talk_request=0 client_talk_request_msg client_description client_is_talker=0 client_is_priority_speaker=0 client_unread_messages=0 client_nickname_phonetic client_needed_serverquery_view_power=0 client_icon_id=0 client_is_channel_commander=0 client_country=DE client_channel_group_inherited_channel_id=24997 client_badges=Overwolf=0 [[TeamSpeak-3-Java-API] SocketReader] ERROR com.github.theholywaffle.teamspeak3.SocketReader - Connection timed out. java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at java.net.SocketInputStream.read(SocketInputStream.java:171) at java.net.SocketInputStream.read(SocketInputStream.java:141) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:161) at java.io.BufferedReader.readLine(BufferedReader.java:324) at java.io.BufferedReader.readLine(BufferedReader.java:389) at com.github.theholywaffle.teamspeak3.SocketReader.run(SocketReader.java:82) [pool-1-thread-4] INFO com.github.theholywaffle.teamspeak3.api.reconnect.ReconnectingConnectionHandler - [Connection] Disconnected from TS3 server - reconnecting in 1000ms TS3 Query Disconnected [pool-1-thread-4] DEBUG com.github.theholywaffle.teamspeak3.SocketReader - < TS3 [pool-1-thread-4] DEBUG com.github.theholywaffle.teamspeak3.SocketReader - < [pool-1-thread-4] DEBUG com.github.theholywaffle.teamspeak3.SocketReader - < Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help " for information on a specific command. [pool-1-thread-4] DEBUG com.github.theholywaffle.teamspeak3.SocketReader - <

Tobias3107 commented 6 years ago

Hey, I want a that every time he tries to reconnect. Because I want that this bot work everytime