Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98177

CherryPy cpstats and ws4py

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Israel Brewster <israel@ravnalaska.net>
Newsgroups comp.lang.python
Subject CherryPy cpstats and ws4py
Date Tue, 3 Nov 2015 08:05:19 -0900
Lines 77
Message-ID <mailman.38.1446570324.8789.python-list@python.org> (permalink)
Mime-Version 1.0 (Mac OS X Mail 9.1 \(3096.5\))
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de 77XJnBgaj3iPf+H8KOW8uAxM6DRcg1iD++vQNrqB9R5g==
Return-Path <israel@ravnalaska.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'skip:[ 20': 0.03; 'failing': 0.05; 'skip:" 60': 0.05; 'socket': 0.07; 'cherrypy': 0.09; 'functioning': 0.09; 'skip:" 80': 0.09; 'sockets': 0.09; 'user-agent:': 0.09; 'python': 0.10; 'server,': 0.15; 'skip:f 30': 0.15; "'/'": 0.16; '63,': 0.16; 'headers:': 0.16; 'host:': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'app': 0.16; 'attribute': 0.18; 'conjunction': 0.18; 'intel': 0.18; 'working.': 0.18; 'solution.': 0.18; 'thanks.': 0.18; 'fix': 0.21; 'posted': 0.21; 'disable': 0.22; 'gather': 0.22; 'trying': 0.22; '(most': 0.24; 'skip:- 40': 0.25; "i've": 0.25; 'figure': 0.27; "skip:' 10": 0.28; 'raise': 0.29; 'skip:g 30': 0.30; 'to:name:python- list': 0.30; "i'd": 0.31; 'skip:s 30': 0.31; 'post': 0.31; 'maybe': 0.33; 'run': 0.33; 'http': 0.33; 'traceback': 0.33; 'file': 0.34; 'that,': 0.34; 'skip:" 50': 0.35; 'knowledge': 0.35; 'but': 0.36; 'list,': 0.36; 'there': 0.36; 'tool': 0.36; 'possible': 0.36; 'to:addr:python-list': 0.36; 'received:10': 0.37; 'two': 0.37; 'mac': 0.37; 'skip:s 50': 0.37; 'thought': 0.37; 'charset:us-ascii': 0.37; 'someone': 0.38; 'mailing': 0.38; 'end': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'skip:u 10': 0.61; 'header:Message-Id:1': 0.61; 'here.': 0.62; 'more': 0.63; 'soon': 0.65; 'received:10.9': 0.66; 'gotten': 0.76; 'received:12': 0.81; '__call__': 0.84; 'application?': 0.84; 'alaska': 0.91
X-Warning RFC compliance checks disabled due to whitelist
X-Warning Reverse-Path DNS check skipped due to whitelist
X-Warning Maximum message size check skipped due to whitelist
X-Warning Realtime Block Lists skipped due to whitelist
X-Warning System filters skipped due to whitelist
X-Warning Domain filters skipped due to whitelist
X-Warning User filters skipped due to whitelist
X-Warning Anti-Spam check skipped due to whitelist
X-Whitelist 2147483645
X-Envelope-From israel@ravnalaska.net
X-Envelope-To python-list@python.org
X-Mailer Apple Mail (2.3096.5)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:98177

Show key headers only | View raw


I posted this to the CherryPy and ws4py mailing lists, but in the week since I did that I've only gotten two or three views on each list, and no responses, so as a last-ditch effort I thought I'd post here. Maybe someone with more general python knowledge than me can figure out the traceback and from there a solution.

Is it possible to use ws4py in conjunction with the cpstats CherryPy tool? I have a CherryPy (3.8.0) web app that uses web sockets via ws4py. Tested and working. I am now trying to get a little more visibility into the functioning of the server, so to that end I enabled the cpstats tool by adding the following line to my '/' configuration:

tools.cpstats.on=True

Unfortunately, as soon as I do that, attempts to connect a web socket start failing with the following traceback:

[28/Oct/2015:08:18:48]  
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/CherryPy-3.8.0-py2.7.egg/cherrypy/_cprequest.py", line 104, in run
    hook()
  File "/Library/Python/2.7/site-packages/CherryPy-3.8.0-py2.7.egg/cherrypy/_cprequest.py", line 63, in __call__
    return self.callback(**self.kwargs)
  File "build/bdist.macosx-10.10-intel/egg/ws4py/server/cherrypyserver.py", line 200, in upgrade
    ws_conn = get_connection(request.rfile.rfile)
  File "build/bdist.macosx-10.10-intel/egg/ws4py/compat.py", line 43, in get_connection
    return fileobj._sock
AttributeError: 'KnownLengthRFile' object has no attribute '_sock'
[28/Oct/2015:08:18:48] HTTP 
Request Headers:
  PRAGMA: no-cache
  COOKIE: autoTabEnabled=true; fleetStatusFilterCompany=7H; fleetStatusFilterLocation=ALL; fleetStatusRefreshInterval=5; inputNumLegs=5; session_id=5c8303896aff419c175c79dfadbfdc9d75e6c45a
  UPGRADE: websocket
  HOST: flbubble.ravnalaska.net:8088
  ORIGIN: http://flbubble.ravnalaska.net
  CONNECTION: Upgrade
  CACHE-CONTROL: no-cache
  SEC-WEBSOCKET-VERSION: 13
  SEC-WEBSOCKET-EXTENSIONS: x-webkit-deflate-frame
  USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7
  SEC-WEBSOCKET-KEY: Szh6Uoe+WzqKR1DgW8JcXA==
  Remote-Addr: 10.9.1.59
[28/Oct/2015:08:18:48] HTTP 
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/CherryPy-3.8.0-py2.7.egg/cherrypy/_cprequest.py", line 661, in respond
    self.hooks.run('before_request_body')
  File "/Library/Python/2.7/site-packages/CherryPy-3.8.0-py2.7.egg/cherrypy/_cprequest.py", line 114, in run
    raise exc
AttributeError: 'KnownLengthRFile' object has no attribute '_sock'

Disable tools.cpstats.on, and the sockets start working again. Is there some way I can fix this so I can use sockets as well as gather stats from my application? Thanks.

-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

CherryPy cpstats and ws4py Israel Brewster <israel@ravnalaska.net> - 2015-11-03 08:05 -0900

csiph-web