2

I am running Ghost as a web service on Microsoft azure. I am using MySql Database for storage instead of the default Sqlite. Every time i open the blog i get a Econnreset error with status as 500, and Sql query is being shown.

I have MySql Running in a virtual machine. But everything works out fine on refresh. I am also using connection pooling.

How to rectify this, or what can be the probable reason for Ghost to drop connection with database.

Vipul
  • 566
  • 5
  • 29

2 Answers2

2

Solved the problem. Issue is with the underlying Knex MySql Driver. When the connection remains Idle Azure closes the connection, when the request is made again knex does not check if the connection is still there or not leading to Econnreset Error.

You can fix this by setting min number of connections to be zero in knex.

For more details follow this issue:

https://github.com/tgriesser/knex/issues/975

Vipul
  • 566
  • 5
  • 29
0

Is the mysql database hosted on another azure instance ?

If so you will need to make it available to the outside (Open the required ports).

DanteDiaze
  • 128
  • 1
  • 6
  • Yes the ports, are open Ghost is able to fetch data from Mysql Instance. It is just that on the very first time when you open it gives Econnreset, if you reload the page again it starts working perfectly fine. – Vipul Apr 08 '16 at 17:02