python - Flask SQL-Alchemy OperationalError -


i'm getting error message causing 500 error sporadically on site:

operationalerror: (_mysql_exceptions.operationalerror) (2006, 'mysql server has gone away')

i using flask sql-alchemy. after doing googling came across this:

https://rapd.wordpress.com/2008/03/02/sqlalchemy-sqlerror-operationalerror-2006-mysql-server-has-gone-away/

i added these fixes:

app.config['sqlalchemy_database_uri'] = 'myserverstuff' app.config['sqlalchemy_pool_size'] = 100 app.config['sqlalchemy_pool_recycle'] = 3600 db = sqlalchemy(app) 

sadly haven't had success this. suggestions?

edit:

newest_vendors = accounts.query.filter(accounts.acc_type=='vendor').order_by(accounts.created_at.desc()).limit(4).all() 

this happens through out functions sporadically there isn't specific spot :/

edit edit:

this apache saying:

root@server [~]# tail -f /usr/local/apache/logs/error_log app 4986 stderr:   file "/home/admin/venv/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context app 4986 stderr:     context) app 4986 stderr:   file "/home/admin/venv/lib/python2.6/site-packages/sqlalchemy/engine/default.py", line 442, in do_execute app 4986 stderr:     cursor.execute(statement, parameters) app 4986 stderr:   file "/home/admin/venv/lib/python2.6/site-packages/mysqldb/cursors.py", line 205, in execute app 4986 stderr:     self.errorhandler(self, exc, value) app 4986 stderr:   file "/home/admin/venv/lib/python2.6/site-packages/mysqldb/connections.py", line 36, in defaulterrorhandler app 4986 stderr:     raise errorclass, errorvalue app 4986 stderr: operationalerror: (_mysql_exceptions.operationalerror) (2006, 'mysql server has gone away') [sql: u'select taxonomies.taxonomy_id taxonomies_taxonomy_id, taxonomies.taxonomy taxonomies_taxonomy, taxonomies.slug taxonomies_slug, taxonomies.parent taxonomies_parent, taxonomies.description taxonomies_description, taxonomies.taxonomy_picture taxonomies_taxonomy_picture \nfrom taxonomies'] app 24080 stdout: 


Comments

Popular posts from this blog

Java 3D LWJGL collision -

methods - python can't use function in submodule -

c# - ErrorThe type or namespace name 'AxWMPLib' could not be found (are you missing a using directive or an assembly reference?) -