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 bug. 

Ben 





On 28 Oct 2011, at 15:48, cd34  wrote:

> On Oct 28, 10:00 am, Benjamin Sims  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 page, typescript so that you capture the output, then, ran
> the same under apache/mod_wsgi.
> 
> Another thing to do, modify the code in chameleon right before the
> return to print the body and encoding. Possibly it is getting a value
> that it isn't expecting? Write to a file so that you know the last
> file contains precisely what is failing, or, wrap it with a try/except
> to write the body when it does fail.
> 
> Since it happens on the login page, unless you're touching the
> database here, I suspect it is either an odd translation (which would
> not really happen intermittently) or some odd session variable that
> isn't being encoded. Position 467 seems far enough that it might not
> be in the header, but, that would depend on any cookies that are being
> set. Perhaps a user defined meta tag or some other replacement
> occurring in your template?
> 
> -- 
> 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.



Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread cd34
On Oct 28, 10:00 am, Benjamin Sims  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 page, typescript so that you capture the output, then, ran
the same under apache/mod_wsgi.

Another thing to do, modify the code in chameleon right before the
return to print the body and encoding. Possibly it is getting a value
that it isn't expecting? Write to a file so that you know the last
file contains precisely what is failing, or, wrap it with a try/except
to write the body when it does fail.

Since it happens on the login page, unless you're touching the
database here, I suspect it is either an odd translation (which would
not really happen intermittently) or some odd session variable that
isn't being encoded. Position 467 seems far enough that it might not
be in the header, but, that would depend on any cookies that are being
set. Perhaps a user defined meta tag or some other replacement
occurring in your template?

-- 
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.



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 will check namespace and encoding for Chameleon, have had trouble with
this in the past

However, what I really can't grok is why this occurs sometimes and not
others. Any thoughts on how I might come at the debugging another way, maybe
a way to detect and source this error in paster?

Thanks for you time with this!

On 28 October 2011 14:03, cd34  wrote:

> On Oct 28, 8:32 am, Benjamin Sims  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 events of subscribers
> >
> > As I mentioned, this did not occur with paster and is intermittent (which
> > made me wonder if it is related to the MySQL thing). I'm at the point
> where
> > I'm considering giving Nginx a go just to see if it is more stable, or
> > perhaps going through the rather tricky process to get interactive
> debugging
> > going on Apache (
> http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Python_Inte...
> > )
>
> Paster sometimes handles things that violate standards silently, while
> Apache will complain.
>
> If it happens on a login page, I am wondering if it is a header that
> is being set. Any custom headers or cookies being set? Do you have
> i18n set up?
>
> I don't use Chameleon, but, is your template properly formed, i.e. has
> the right encoding, proper namespace declaration, etc? Chameleon tries
> to detect the encoding based on the body and is very strict about the
> page being properly formed.
>
> --
> 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.



Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread cd34
On Oct 28, 8:32 am, Benjamin Sims  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 events of subscribers
>
> As I mentioned, this did not occur with paster and is intermittent (which
> made me wonder if it is related to the MySQL thing). I'm at the point where
> I'm considering giving Nginx a go just to see if it is more stable, or
> perhaps going through the rather tricky process to get interactive debugging
> going on Apache 
> (http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Python_Inte...
> )

Paster sometimes handles things that violate standards silently, while
Apache will complain.

If it happens on a login page, I am wondering if it is a header that
is being set. Any custom headers or cookies being set? Do you have
i18n set up?

I don't use Chameleon, but, is your template properly formed, i.e. has
the right encoding, proper namespace declaration, etc? Chameleon tries
to detect the encoding based on the body and is very strict about the
page being properly formed.

-- 
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.



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 questions:

- 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 events of subscribers

As I mentioned, this did not occur with paster and is intermittent (which
made me wonder if it is related to the MySQL thing). I'm at the point where
I'm considering giving Nginx a go just to see if it is more stable, or
perhaps going through the rather tricky process to get interactive debugging
going on Apache (
http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Python_Interactive_Debugger
)

Ben

On 28 October 2011 13:05, cd34  wrote:

> On Oct 28, 6:27 am, Benjamin Sims  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 error:
>
> [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
>
> $ python   (should occur across 2.[456] as well)
> Python 2.7.2+ (default, Aug 16 2011, 07:03:08)
> [GCC 4.6.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> '\x92'.decode('utf-8')
> Traceback (most recent call last):
>   File "", line 1, in 
>  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
>return codecs.utf_8_decode(input, errors, True)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 0:
> invalid start byte
> >>>
>
> Are you sending binary data that shouldn't be processed? Do you have
> an event or subscriber processing output? is it trying to use a
> template?
>
> You might need return Response rather than running that through your
> template engine if that is the case.
>
> --
> 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.



Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread cd34
On Oct 28, 6:27 am, Benjamin Sims  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 error:

[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

$ python   (should occur across 2.[456] as well)
Python 2.7.2+ (default, Aug 16 2011, 07:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '\x92'.decode('utf-8')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 0:
invalid start byte
>>>

Are you sending binary data that shouldn't be processed? Do you have
an event or subscriber processing output? is it trying to use a
template?

You might need return Response rather than running that through your
template engine if that is the case.

-- 
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.



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  wrote:

> 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 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 
>>
>>> 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 :
>>>
>>> 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
>>> [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
>>> [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
>>> [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
>>> [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
>>> [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
>>>  [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
>>> [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
>>>  [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
>>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185] context),
>>> referer: 
>>> http:/

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 setting.

On Thu, Oct 27, 2011 at 2:41 PM, Benjamin Sims 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 
>
>> 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 :
>>
>> 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
>> [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
>> [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
>> [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
>> [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
>> [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
>>  [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
>> [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
>>  [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
>> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185] context),
>> referer: 
>> 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
>> [Fri Oct 28 02:03:28 2011] [error] [client 217.46.198.

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 

> 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 :
>
> 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
> [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
> [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
> [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
> [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
> [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
>  [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
> [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
>  [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
> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185] context),
> referer: 
> 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
> [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
> [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/

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: Weiterstadt
Geschäftsführer: Oliver Michel, Sven Walther, Dr. Peter Schill


Am 27.10.2011 um 20:23 schrieb 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 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
> [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
> [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
> [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
> [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
> [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
> [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
> [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
> [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
> [Fri Oct 28 02:03:27 2011] [error] [client 217.46.198.185] context), 
> referer: 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
> [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
> [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
> [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
> [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
> [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
> [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
>