whiskeylover / idreamoftoast

idreamoftoast
Apache License 2.0
1 stars 0 forks source link

JSON feeds error out at random times. #9

Open whiskeylover opened 11 years ago

whiskeylover commented 11 years ago

The JSON feed requests (dreams/top and dreams/recent) error out at random. This results in the dream.html page not loading completely... or index.html page not being able to create a new dream.

danriti commented 11 years ago

So looks like I was able to just get the server to 500 by hitting the /dreams/add endpoint:

Traceback (most recent call last)
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/flask/app.py", line 1701, in __call__
return self.wsgi_app(environ, start_response)
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/flask/app.py", line 1689, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/flask/app.py", line 1687, in wsgi_app
response = self.full_dispatch_request()
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/flask/app.py", line 1360, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/flask/app.py", line 1358, in full_dispatch_request
rv = self.dispatch_request()
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/flask/app.py", line 1344, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/notfunk/idreamoftoast.com/idreamoftoast/toast/app.py", line 133, in add_dream
d = Dream.get_or_create(name=unquote(dream.lower()))
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/peewee.py", line 2077, in get_or_create
return sq.get()
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/peewee.py", line 1408, in get
return clone.execute().next()
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/peewee.py", line 1437, in execute
self._qr = QueryResultWrapper(self.model_class, self._execute(), query_meta)
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/peewee.py", line 1232, in _execute
return self.database.execute_sql(sql, params, self.require_commit)
File "/home/notfunk/idreamoftoast.com/lib/python2.6/site-packages/peewee.py", line 1602, in execute_sql
res = cursor.execute(sql, params or ())
File "/usr/share/pyshared/MySQLdb/cursors.py", line 166, in execute
self.errorhandler(self, exc, value)
File "/usr/share/pyshared/MySQLdb/connections.py", line 35, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (2006, 'MySQL server has gone away')