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:
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
Post a Comment