The MySQL errors are likely the fact that you didn't set the pool_recycle
time in your SQLAlchemy connection pool. MySQL connections timeout (by
default) after 8 hours I believe.

http://www.sqlalchemy.org/docs/dialects/mysql.html#connection-timeouts

The timeout is also available as an INI setting.

On Thu, Oct 27, 2011 at 2:41 PM, Benjamin Sims <benjamins...@gmail.com>wrote:

> The log is posted at the end of my previous mail - I do sometimes get
> 'MySQL has gone away errors' but they do not seem to be always at the same
> time as this one, which is:
>
> UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 467
>
>
>
> 2011/10/27 Cornelius Kölbel <cornelius.koel...@lsexperts.de>
>
>> So you get an internal server error?
>> Take a look into the apache error log.
>> I guess you will see a "mysql server has gone away"
>>
>> Kind regards
>> Cornelius
>>
>> --
>> Cornelius Kölbel
>> Http://www.lsexperts.de
>> LSE Leading Security Experts GmbH
>> Tel: +49 6151 9067-252, mobil: +49 160 96307089
>> Unternehmenssitz: Weiterstadt
>> Geschäftsführer: Oliver Michel, Sven Walther, Dr. Peter Schill
>>
>>
>> Am 27.10.2011 um 20:23 schrieb Benjamin Sims <benjamins...@gmail.com>:
>>
>> Hi all,
>>
>> I've recently moved from Paster + Sqlite to Apache + MySQL and, well, it
>> hasn't been smooth. I'm running into various problems which are likely due
>> to the server setup (occasional very slow connections, MySQL has gone away
>> errors) etc.
>>
>> However, I have one that is really bugging me and I would appreciate any
>> thoughts from those who might have seen it before or can guide me as to
>> where to focus debugging.
>>
>> Every so often, the server will throw a 500 error (log below). I
>> understand the need to encode/decode strings correctly; the problem here is
>> that I cannot reliably reproduce the error to find where the mistake is. If
>> I reload a page ten times, sometimes the error will occur; sometimes it
>> won't. I get the impression that it happens more often when the server isn't
>> 'warmed up' by requests, but I may be imagining this.
>>
>> Thanks for any tips; I apologise for the lack of detail.
>>
>> Ben
>>
>> [Fri Oct 28 02:03:27 2011] [error] No handlers could be found for logger
>> "exc_logger"
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185] mod_wsgi
>> (pid=7827): Exception occurred processing WSGI script
>> '/home/my_user/virtualenv/app_dir.wsgi'., referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185] Traceback (most
>> recent call last):, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/repoze.tm2-1.0b2-py2.6.egg/repoze/tm/__init__.py",
>> line 24, in __call__, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]     result =
>> self.application(environ, save_status_and_headers), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/router.py",
>> line 176, in __call__, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]     response =
>> self.handle_request(request), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>>  [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/tweens.py",
>> line 34, in excview_tween, referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]     response =
>> view_callable(exc, request), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>>  [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/config/views.py",
>> line 311, in rendered_view, referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]     context),
>> referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/renderers.py",
>> line 393, in render_view, referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     return
>> self.render_to_response(response, system, request=request), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/renderers.py",
>> line 422, in render_to_response, referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     result =
>> self.render(value, system_values, request=request), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/renderers.py",
>> line 418, in render, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     result =
>> renderer(value, system_values), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>>  [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/chameleon_zpt.py",
>> line 49, in __call__, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     result =
>> self.template(**system), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/Chameleon-2.5.1-py2.6.egg/chameleon/template.py",
>> line 132, in __call__, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     return
>> self.render(**kwargs), referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/Chameleon-2.5.1-py2.6.egg/chameleon/zpt/template.py",
>> line 213, in render, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     return
>> super(PageTemplate, self).render(**vars), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/Chameleon-2.5.1-py2.6.egg/chameleon/template.py",
>> line 176, in render, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]
>> self.cook_check(), referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/Chameleon-2.5.1-py2.6.egg/chameleon/template.py",
>> line 285, in cook_check, referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     body =
>> self.read(), referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/Chameleon-2.5.1-py2.6.egg/chameleon/template.py",
>> line 299, in read, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     data,
>> self.default_encoding, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/home/my_user/virtualenv/lib/python2.6/site-packages/Chameleon-2.5.1-py2.6.egg/chameleon/utils.py",
>> line 123, in read_bytes, referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     return
>> body.decode(encoding), encoding, content_type, referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]   File
>> "/usr/lib64/python2.6/encodings/utf_8.py", line 16, in decode, referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]     return
>> codecs.utf_8_decode(input, errors, True), referer:
>> <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.185]
>> UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 467:
>> unexpected code byte, referer: <http://example.org/app_dir/stream/all/1>
>> http://example.org/app_dir/stream/all/1
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "pylons-discuss" group.
>> To post to this group, send email to pylons-discuss@googlegroups.com.
>> To unsubscribe from this group, send email to
>> pylons-discuss+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/pylons-discuss?hl=en.
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "pylons-discuss" group.
>> To post to this group, send email to pylons-discuss@googlegroups.com.
>> To unsubscribe from this group, send email to
>> pylons-discuss+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/pylons-discuss?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>



-- 

Michael

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to