Page 1 of 1
server restart everyday?
PostPosted: Mon Dec 02, 2013 3:47 pm
by Devaztation
Im just asking but do you have to restart server everyday cause i leave my server overnight and when i get up and the morning and try to login i cannot and i look at console and server has mysql errors...so i have to restart server.....now i have portable mysql from one click install...would that make a difference?
Re: server restart everyday?
PostPosted: Mon Dec 02, 2013 8:14 pm
by Graveen
it could. Why don't you try non portable edition ?
Re: server restart everyday?
PostPosted: Tue Dec 03, 2013 12:37 am
by geshi
Take a screenshot or copy and paste the mysql errors you get to here

Re: server restart everyday?
PostPosted: Tue Dec 03, 2013 3:50 pm
by Devaztation
08:41:52,471 - [48] - INFO - DOL.Network.BaseServer - Incoming connection from 127.0.0.1:65528
08:41:53,011 - [50] - ERROR - DOL.Database.Connection.DataConnection - ExecuteSelect: "SELECT `Ban_ID`, `Author`, `Type`, `Ip`, `Account`, `DateBan`, `Reason` FROM `Ban` WHERE ((Type='A' OR Type='B') AND Account ='bsnow16')"
MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered attempting to read the resultset. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed. ---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at MyNetworkStream.HandleOrRethrowException(Exception e)
at MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
at DOL.Database.Connection.DataConnection.ExecuteSelect(String sqlcommand, QueryCallback callback, IsolationLevel isolation)
08:41:53,101 - [50] - ERROR - DOL.GS.PacketHandler.Client.v168.LoginRequestHandler - Error shutting down Client after IsAllowedToConnect failed!
MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered attempting to read the resultset. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed. ---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at MyNetworkStream.HandleOrRethrowException(Exception e)
at MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
at DOL.Database.Connection.DataConnection.ExecuteSelect(String sqlcommand, QueryCallback callback, IsolationLevel isolation)
at DOL.Database.Handlers.MySQLObjectDatabase.SelectObjectsImpl[TObject](String whereClause, IsolationLevel isolation)
at DOL.Database.ObjectDatabase.SelectObjects[TObject](String whereExpression, IsolationLevel isolation)
at DOL.Database.ObjectDatabase.SelectObjects[TObject](String whereExpression)
at DOL.GS.ServerRules.AbstractServerRules.IsAllowedToConnect(GameClient client, String username)
at DOL.GS.PacketHandler.Client.v168.LoginRequestHandler.HandlePacket(GameClient client, GSPacketIn packet)
08:41:53,121 - [50] - INFO - DOL.GS.PacketHandler.Client.v168.LoginRequestHandler - (127.0.0.1)User bsnow16 logging on! (Version1109 type:LabyrinthOfTheMinotaur add:bit4, bit5, Foundations, NewFrontiers)
08:41:53,121 - [50] - ERROR - DOL.Database.Connection.DataConnection - ExecuteSelect: "SELECT `Account_ID`, `Name`, `Password`, `CreationDate`, `LastLogin`, `Realm`, `PrivLevel`, `Status`, `Mail`, `LastLoginIP`, `LastClientVersion`, `Language`, `IsMuted` FROM `Account` WHERE `Name` = 'bsnow16'"
MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered attempting to read the resultset. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed. ---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at MyNetworkStream.HandleOrRethrowException(Exception e)
at MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
at DOL.Database.Connection.DataConnection.ExecuteSelect(String sqlcommand, QueryCallback callback, IsolationLevel isolation)
Re: server restart everyday?
PostPosted: Tue Dec 03, 2013 5:38 pm
by Tolakram
You lost connection to the database.
Re: server restart everyday?
PostPosted: Tue Dec 03, 2013 5:42 pm
by Leodagan
Database connection is getting timeout when there isn't anymore activity.
And DOL doesn't create a new one in this case.
Re: server restart everyday?
PostPosted: Tue Dec 03, 2013 5:58 pm
by Devaztation
How do i fix this? This happens every morning.
Also wondering if someone could tell me what this is?
15:29:42,643 - [MAIN] - WARN - DOL.WeakMulticastDelegate - InvokeSafe took 2418ms! method: DOL.GS.GameEvents.StatPrint.OnScriptCompiled target: null
15:29:42,685 - [MAIN] - DEBUG - DOL.Network.BaseServer - [UPNP] Current UPnP mappings:
15:29:44,388 - [MAIN] - WARN - DOL.Network.BaseServer - The underlying connection was closed: The connection was closed unexpectedly.
System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly.
at System.Net.HttpWebRequest.GetResponse()
at UPnPNat._GetSOAPRequest(String url, String soap, String function)
at UPnPNat.ForwardPort(Int32 internalPort, Int32 externalPort, ProtocolType protocol, String description, IPAddress internalIp)
at DOL.Network.BaseServer.Start()
15:29:44,393 - [MAIN] - DEBUG - DOL.Network.BaseServer - Server is now listening to incoming connections!
15:29:44,394 - [MAIN] - DEBUG - DOL.GS.GameServer - Start Memory base.Start(): 84
15:29:44,394 - [MAIN] - INFO - DOL.GS.GameServer - base.Start(): True
15:29:44,394 - [MAIN] - DEBUG - DOL.GS.GameServer - Finish Memory base.Start(): 84
15:29:44,543 - [MAIN] - INFO - DOL.GS.GameServer - GameServer is now open for connections!
Re: server restart everyday?
PostPosted: Thu Dec 05, 2013 2:30 pm
by Devaztation
Tried a wamp server with diff mysql but i still loose connection when im not on for an extended period of time anyone else having this problem?
Re: server restart everyday?
PostPosted: Thu Dec 05, 2013 3:37 pm
by Tolakram
Is your DB server set to go into sleep mode after a certain period of non usage?
Re: server restart everyday?
PostPosted: Thu Dec 05, 2013 3:54 pm
by Devaztation
that i dunno how would i check that out?
Re: server restart everyday?
PostPosted: Thu Dec 05, 2013 5:10 pm
by Tolakram
windows sleep mode
Put those into a google search, check out results. You might also be running into low memory ans swapping issues if you are running server and client on the same box.
Re: server restart everyday?
PostPosted: Thu Dec 05, 2013 5:58 pm
by Leodagan
Default Mysql configuration has a timeout for SQL connexion... (which can be raised somehow, I tried the param : wait_timeout=604800 in my.cnf but I don't know if it's the desired effect)
This has nothing to do with windows (I can reproduce this bug on Linux)
The DOL MySQL Connection Code is using an Object Queue to Pool Connection, so it will return every connection to the pool and try to use them later, after some inactivity MySQL will close the connection, and next time someone logs in game it will try to retrieve a connection from the pool and it won't be able to use it if it's expired !
Honestly I got rid of the DOL Connection Queue... MySQL ADO.NET Driver already does pooling !
When you use "new MySQLConnection(string ConnectString);" the driver will start pooling using the ConnectString as index, any other call with the same string will return an object from the pool or create a new connection if needed.
You can try using this patch :
But it completely removes the DOL connection queueing logic...
You need to update your MySQL Connection String (from serverconfig.xml) to control the MySQL driver connection pool
- Code: Select all
server=localhost;port=3306;database=dol;User Id=root;password=;Treat Tiny As Boolean=False;minimumPoolSize=10;maximumpoolsize=20;
Lower the Pool size if your MySQL server doesn't allow this much connections !
Re: server restart everyday?
PostPosted: Thu Dec 05, 2013 6:30 pm
by Tolakram
I've never run into this issue on either Storm server running MySQL on Windows. DOL will be hitting the DB on a regular basis anyway, so my sleep idea is probably bunk as well. I would say it's a machine issue, probably not enough memory and the machine experiencing so much swapping that it times the connection out.
Re: server restart everyday?
PostPosted: Thu Dec 05, 2013 6:46 pm
by Devaztation
My machine has windows 7 64bit and 4gb of ram and its only me logging into it.....
Re: server restart everyday?
PostPosted: Thu Dec 05, 2013 6:56 pm
by Leodagan
I've never run into this issue on either Storm server running MySQL on Windows. DOL will be hitting the DB on a regular basis anyway, so my sleep idea is probably bunk as well. I would say it's a machine issue, probably not enough memory and the machine experiencing so much swapping that it times the connection out.
Maybe you have some custom Gameserver Script that make regular queries to your Database ?
I'm pretty sure the SVN DOL Core doesn't have any SQL activity when nobody's is online...
You could have enable some "audit" options that insert the "-stats-" displaying in DB ?
this would be enough to "keep alive" the connection...