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

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

Closed
neotsn opened this Issue Aug 26, 2014 · 4 comments

Comments

Projects
None yet
1 participant
@neotsn
Owner

neotsn commented Aug 26, 2014

PDO Error on cron job:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /home/neo/public_html/pizzy/labs/spotter/includes/classes/db_pdo.php:42
Stack trace:
0 /home/neo/public_html/pizzy/labs/spotter/includes/classes/db_pdo.php(42): PDO->prepare('SELECT * FROM o...')
1 /home/neo/public_html/pizzy/labs/spotter/includes/classes/outlook.php(82): db_pdo->query('SELECT * FROM o...', Array)
2 /home/neo/public_html/pizzy/labs/spotter/cron_report_check.php(31): outlook->does_outlook_hash_exist()
3 {main}
thrown in /home/neo/public_html/pizzy/labs/spotter/includes/classes/db_pdo.php on line 42

@neotsn neotsn self-assigned this Aug 26, 2014

@neotsn

This comment has been minimized.

Owner

neotsn commented Aug 26, 2014

Seems to be an issue with timing out the persistent connection on processing multiple HWO docs...which is odd since a PDO should be persistent, and not subject to such short timeout conditions - but such is the limitation of a web host that is out of your control.

@neotsn neotsn added the bug label Aug 26, 2014

@neotsn

This comment has been minimized.

Owner

neotsn commented Aug 26, 2014

Fixed, so far, with v1.2.1 adding an try-catch around all database read/write requests, and an attempt to re-establish a db connection once if a query fails.

@neotsn neotsn closed this Aug 26, 2014

@neotsn

This comment has been minimized.

Owner

neotsn commented Sep 5, 2014

Issue persisted after latest commit.

@neotsn neotsn reopened this Sep 5, 2014

@neotsn

This comment has been minimized.

Owner

neotsn commented Sep 5, 2014

Restructured the CRON job page to perform the necessary queries outside of the loop. It was determined, as best it could be deduced, that the loop to fetch more than 1 Outlook was causing the page to reach its mysql connection timeout (for some reason) and all the queries related to any possible office ids and the associated users needed to be done before any wgets were performed.

@neotsn neotsn closed this Sep 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment