server restart everyday?

For any problems with Dawn of Light website or game server, please direct questions and problems here.

Moderator: Support Team

server restart everyday?

Postby Devaztation » Mon Dec 02, 2013 3:47 pm

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?
Devaztation
DOL Visitor
 
Posts: 10
Joined: Thu Nov 28, 2013 8:40 pm

Re: server restart everyday?

Postby Graveen » Mon Dec 02, 2013 8:14 pm

it could. Why don't you try non portable edition ?
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12661
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: server restart everyday?

Postby geshi » Tue Dec 03, 2013 12:37 am

Take a screenshot or copy and paste the mysql errors you get to here :)
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: server restart everyday?

Postby Devaztation » Tue Dec 03, 2013 3:50 pm

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)
Devaztation
DOL Visitor
 
Posts: 10
Joined: Thu Nov 28, 2013 8:40 pm

Re: server restart everyday?

Postby Tolakram » Tue Dec 03, 2013 5:38 pm

You lost connection to the database.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: server restart everyday?

Postby Leodagan » Tue Dec 03, 2013 5:42 pm

Database connection is getting timeout when there isn't anymore activity.

And DOL doesn't create a new one in this case.
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: server restart everyday?

Postby Devaztation » Tue Dec 03, 2013 5:58 pm

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!
Devaztation
DOL Visitor
 
Posts: 10
Joined: Thu Nov 28, 2013 8:40 pm

Re: server restart everyday?

Postby Devaztation » Thu Dec 05, 2013 2:30 pm

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?
Devaztation
DOL Visitor
 
Posts: 10
Joined: Thu Nov 28, 2013 8:40 pm

Re: server restart everyday?

Postby Tolakram » Thu Dec 05, 2013 3:37 pm

Is your DB server set to go into sleep mode after a certain period of non usage?
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: server restart everyday?

Postby Devaztation » Thu Dec 05, 2013 3:54 pm

that i dunno how would i check that out?
Devaztation
DOL Visitor
 
Posts: 10
Joined: Thu Nov 28, 2013 8:40 pm

Re: server restart everyday?

Postby Tolakram » Thu Dec 05, 2013 5:10 pm

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.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: server restart everyday?

Postby Leodagan » Thu Dec 05, 2013 5:58 pm

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 :
DataConnection.cs.patch
(8.23 KiB) Downloaded 123 times
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 !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: server restart everyday?

Postby Tolakram » Thu Dec 05, 2013 6:30 pm

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.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: server restart everyday?

Postby Devaztation » Thu Dec 05, 2013 6:46 pm

My machine has windows 7 64bit and 4gb of ram and its only me logging into it.....
Devaztation
DOL Visitor
 
Posts: 10
Joined: Thu Nov 28, 2013 8:40 pm

Re: server restart everyday?

Postby Leodagan » Thu Dec 05, 2013 6:56 pm

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...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon


Return to “%s” Support

Who is online

Users browsing this forum: No registered users and 0 guests