Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make database connection more robust #6747

Closed
aureq opened this issue Nov 29, 2014 · 1 comment
Closed

Make database connection more robust #6747

aureq opened this issue Nov 29, 2014 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it. Bug For errors / faults / flaws / inconsistencies etc. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@aureq
Copy link

aureq commented Nov 29, 2014

Related to the upgrade, I came to realize the database connection isn't very robust.

I operate my db servers through a cluster and with haproxy in front.
For sanity, I reduce the connection life if either the server or the client are inactive for too long.

Piwik upgrade takes some time (ok), but fails to recover is the connection was closed due to the inactivity.

A database upgrade is required. Execute update? (y/N) Y

Starting the database upgrade process now. This may take a while, so please be patient.
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

  [Zend_Db_Statement_Exception]                                    
  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away  

  [PDOException]                                                   
  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away  

At least one or X retry should occur, but it could be possible to specify a master database server onto which the upgrade should be performed safely (no timeout).

@aureq aureq added Bug For errors / faults / flaws / inconsistencies etc. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. labels Nov 29, 2014
@mattab
Copy link
Member

mattab commented Dec 1, 2014

Thanks for the suggestion. I dont see how we can workaround this issue unfortunately as it is a mysql configuration that can solve it, see http://piwik.org/faq/troubleshooting/faq_183/

if you restart the Upgrade it should re-try then? if not it's a bug that it doesn't retry the query that failed , please create another issue if so. Cheers

@mattab mattab closed this as completed Dec 1, 2014
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Dec 1, 2014
@mattab mattab modified the milestone: Short term Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Bug For errors / faults / flaws / inconsistencies etc. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

2 participants