Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread Benjamin Sims
I do have: sqlalchemy.pool_recycle = 3600 but it doesn't seem to always solve it. However, I don't believe that the encoding error is related and that is far more worrying to me, as it occurs more frequently. Ben On 27 October 2011 20:50, Michael Merickel mmeri...@gmail.com wrote: The

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread cd34
On Oct 28, 6:27 am, Benjamin Sims benjamins...@gmail.com wrote: sqlalchemy.pool_recycle = 3600 Your pool_recycle needs to be less than /etc/mysql/my.cnf:interactive_timeout= That typically fixes that. I actually run with pool_recycle=60 and I've not seen that error since. As for your UTF

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread Benjamin Sims
The two were both set at 3600; I've now changed the pool_recycle to 60, so hopefully that will help. I seem to be seeing the error less often since I removed some cron jobs which had a tendency to hang, so it might be that that has resolved the situation - I'm waiting to see. Regarding your other

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread cd34
On Oct 28, 8:32 am, Benjamin Sims benjamins...@gmail.com wrote: - I'm not sending any binary data that I'm aware of; page content is text from the MySQL database. Sometimes this error even occurs on my login page, which does very little other than display a welcome and a form - There are no

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread Benjamin Sims
It does sometimes occur on the login page, but also on other pages. It will fail a few times, then start working for a bit and continue that way. - There is nothing custom in terms of cookies or headers; a session cookie and some auth_tkts produced by standard login. - il8n is set up, yes - I

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread cd34
On Oct 28, 10:00 am, Benjamin Sims benjamins...@gmail.com wrote: It does sometimes occur on the login page, but also on other pages. It will fail a few times, then start working for a bit and continue that way. I'm wondering if you ran the app under paster, ran a bunch of wget -S on a small

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread Benjamin Sims
Mystery solved (well this part anyway). I modified the library to write to disk as suggested - turns out there was a weird character in the custom 500 error template. So, whenever another error occurred, this was the only one in the log. Thanks do much for helping me get through this annoying

Intermittent encoding error after moving to Apache

2011-10-27 Thread Benjamin Sims
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

Re: Intermittent encoding error after moving to Apache

2011-10-27 Thread Cornelius Kölbel
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:

Re: Intermittent encoding error after moving to Apache

2011-10-27 Thread Benjamin Sims
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

Re: Intermittent encoding error after moving to Apache

2011-10-27 Thread Michael Merickel
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