Diez B. Roggisch schrieb:
> On Tuesday 20 March 2007 16:05, Christopher Arndt wrote:
>> I haven't debugged the problem properly yet, but I was just about to look
>> into it, when I saw this thread. Since I only own a Mac mini since last
>> week, I can know try to dig into this myself.
>
> Interesting. Maybe using something like
>
> http://docs.pushtotest.com/axisdocs/user-guide.html#tcpmon
>
> helps by providing the HTTP-communication. After all, it must be related to
> that, as a JS error would prevent the submission at all.
I have installed an error reporting handler along the lines of [1] in my app,
and below is the info I have gathered so far, which, unfortunately, didn't give
my any clue yet. This is how I gather the request info (the functions receive
cherrypy.request as an argument):
def format_request_info(req):
data = [u'\nRequest information:\n']
for key in ['remote_host', 'remote_addr', 'remote_port', 'requestLine',
'protocol', 'method', 'query_string', 'browser_url', 'body']:
value = getattr(req, key, None)
if value:
data.append(u'%s: %r\n' % (key, value))
data.append(u'\nRequest headers:\n')
for key, value in req.header_list:
data.append(u'%s: %r\n' % (key, value))
return u''.join(data)
def format_user_info(user):
data = [u'\nUser information:\n']
if user:
for key in ['user_id', 'user_name', 'full_name', 'email_address']:
value = getattr(user, key, None)
if value:
data.append(u'%s: %r\n' % (key, value))
else:
data.append(u'Anonymous user\n')
return u''.join(data)
See the debug info below (I removed some confidential infos, e.g. IPs, user
names, etc.).
Chris
[1] http://docs.turbogears.org/1.0/ErrorReporting
----------URL----------
GET /directory/site_info/2
----------DATA:----------
Traceback (most recent call last):
File
"/usr/local/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py",
line 105, in _run
self.main()
File
"/usr/local/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py",
line 254, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in site_info
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/controllers.py",
line 173, in validate
return errorhandling.run_with_errors(errors, func, *args, **kw)
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/errorhandling.py",
line 113, in run_with_errors
return func(self, *args, **kw)
File "<string>", line 3, in site_info
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/controllers.py",
line 344, in <lambda>
expose = lambda func, *args, **kw: func(*args, **kw)
File "<string>", line 3, in site_info
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/controllers.py",
line 334, in expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/database.py",
line 310, in sa_rwt
retval = dispatch_exception(e,args,kw)
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/database.py",
line 299, in sa_rwt
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/controllers.py",
line 351, in <lambda>
mapping, fragment, args, kw)))
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/controllers.py",
line 391, in _execute_func
return _process_output(output, template, format, content_type, mapping,
fragment)
File
"/usr/local/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/controllers.py",
line 100, in _process_output
output = unicodechars.sub(
TypeError: expected string or buffer
User information:
user_id: 1
user_name: 'foo'
full_name: u'Foo user'
email_address: u'[EMAIL PROTECTED]'
Request information:
remote_host: '127.0.0.1'
remote_addr: '127.0.0.1'
remote_port: 39667
requestLine: 'GET /directory/site_info/2?tg_format=json HTTP/1.0'
protocol: 'HTTP/1.0'
method: 'GET'
query_string: 'tg_format=json'
browser_url: 'http://mysite.com/directory/site_info/2?tg_format=json'
Request headers:
COOKIE: 'tg-visit=XXXXXX; session_id=XXXXXX'
X-REAL-IP: '1.2.3.4'
Content-Length: ''
USER-AGENT: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de-de)
AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3'
CONNECTION: 'close'
REFERER: 'http://mysite.com/directory/'
HOST: 'mysite.com'
ACCEPT: 'application/json'
Remote-Addr: '127.0.0.1'
ACCEPT-LANGUAGE: 'de-de'
X-FORWARDED-FOR: '1.2.3.4'
Content-Type: ''
Remote-Host: '127.0.0.1'
ACCEPT-ENCODING: 'gzip, deflate'
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---