gevent


werkzeug server failed to handle request


I'm trying to run this gevent server
from gevent import pywsgi
from Index import application
import paste.urlparser
import os
# http server: serves up static files
print "static files",os.path.dirname(__file__)
print "serving on localhost:8000"
http_server = pywsgi.WSGIServer(
('', 8000),
paste.urlparser.StaticURLParser(os.path.dirname(__file__)))
print 'Serving on https://127.0.0.1:4000'
server = pywsgi.WSGIServer(('0.0.0.0', 4000), application,spawn=None)
# Start the server greenlets
http_server.start()
# to start the server asynchronously, call server.start()
# we use blocking serve_forever() here because we have no other jobs
server.serve_forever()
I'm getting this exception where it gives me failed to handle request from werkzeug server.
I've used only werkzeug utility and have never used werkzeug server..
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gevent/server.py", line 131, in _do_accept
self._handle(client_socket, address)
File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 571, in handle
handler.handle()
File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 180, in handle
result = self.handle_one_request()
File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 287, in handle_one_request
raw_requestline = self.read_requestline()
File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 280, in read_requestline
return self.rfile.readline(MAX_REQUEST_LINE)
File "/usr/lib/python2.7/socket.py", line 476, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/local/lib/python2.7/dist-packages/gevent/socket.py", line 432, in recv
wait_read(sock.fileno(), timeout=self.timeout, event=self._read_event)
File "/usr/local/lib/python2.7/dist-packages/gevent/socket.py", line 169, in wait_read
switch_result = get_hub().switch()
File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 154, in switch
assert cur is not self, 'Cannot switch to MAINLOOP from MAINLOOP'
AssertionError: Cannot switch to MAINLOOP from MAINLOOP
<WSGIServer fileno=4 address=0.0.0.0:4000>: Failed to handle request from ('127.0.0.1', 36088)

Related Links

building gevent in raspberry pi qemu
Some confusion about gevent (cffi) setup
Do rdflib and gevent work nicely together?
Replace gevent.spawn_link_exception
thread exception occurred in gevent
Is join required on gevent gthreads?
ZeroRPC heartbeats and timeouts
NewRelic doesn't graph any data in a Python + Gevent based system
Is there any way to run gevent-socketio 0.3.5-rc2 with gunicorn 18.0 without downgrading
How can I test to see whether gevent monkey patching is active?
How does gevent interact with threading.local data?
werkzeug server failed to handle request
Running time puzzle about gevent
Why does this http streaming not work as expected?

Categories

HOME
actionscript-3
swift3
macros
salesforce
ebay-api
hex
app-store
ebay
sdk
uml-designer
browserstack
osx-yosemite
vsixmanifest
cracking
google-my-business-api
select2
elastalert
point-of-sale
captcha
fine-uploader
saucelabs
yui
opendaylight
box2d
background-image
nsoperation
greensock
ibatis
wallet
google-street-view
civicrm
beacon
aws-devicefarm
restructuredtext
hololens
wai-aria
advertising
ecmascript-2017
aws-certificate-manager
sasl
multiple-inheritance
deferred
log4net-configuration
pymunk
ponylang
leaderboard
mongoid5
area
rbac
socketcluster
file-descriptor
electron-packager
python-venv
spring-cloud-bus
runtime-permissions
dna-sequence
photoshop-script
node-java
ajv
universe
access-violation
x12
hdr
cherry-pick
avaudiorecorder
shtml
angular-promise
event-tracking
sdkman
jts
biginsights
identifying
musicbrainz
vanilla-forums
cyberduck
esri-arc-engine
caption
aiff
report-builder2.0
apache-pivot
os.walk
powerpoint-2010
selenium-grid2
ios-enterprise
isl
.net-reflector
mysql-error-1146
ardor3d
infinity.js
string-length
brew
qt5.1
screensharing
winrt-async
code-organization
session-hijacking
openwrap
uccapi
mysql-pconnect
coderush-xpress
memory-consumption

Resources

Encrypt Message