Git Product home page Git Product logo

Comments (6)

thapar avatar thapar commented on August 20, 2024

In a possibly related issue, when someone disconnects in Pyramid (using the simple_pyramid_chat example), this traceback is output in console:

Traceback (most recent call last):
  File "/home/raj/_env/lib/python2.7/site-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/home/raj/_env/lib/python2.7/site-packages/pyramid/router.py", line 187, in __call__
    response = self.handle_request(request)
  File "/home/raj/_env/lib/python2.7/site-packages/pyramid/tweens.py", line 20, in excview_tween
    response = handler(request)
  File "/home/raj/_env/lib/python2.7/site-packages/pyramid/router.py", line 164, in handle_request
    response = view_callable(context, request)
  File "/home/raj/_env/lib/python2.7/site-packages/pyramid/config/views.py", line 352, in rendered_view
    context)
  File "/home/raj/_env/lib/python2.7/site-packages/pyramid/renderers.py", line 396, in render_view
    return self.render_to_response(response, system, request=request)
  File "/home/raj/_env/lib/python2.7/site-packages/pyramid/renderers.py", line 426, in render_to_response
    result = self.render(value, system_values, request=request)
  File "/home/raj/_env/lib/python2.7/site-packages/pyramid/renderers.py", line 422, in render
    result = renderer(value, system_values)
  File "/home/raj/_env/lib/python2.7/site-packages/pyramid/mako_templating.py", line 176, in __call__
    raise ValueError('renderer was passed non-dictionary as value')
ValueError: renderer was passed non-dictionary as value
<Greenlet at 0x23ee050: <pyramid.router.Router object at 0x235dd10>({'bfg.routes.matchdict': {'remaining': (u'1', u'we, <function <lambda> at 0x2360938>)> failed with ValueError

from gevent-socketio.

dswarbrick avatar dswarbrick commented on August 20, 2024

Exceptions still present with socket.io client 0.9.9. Apparently they changed something in 0.9.7 that doesn't agree with gevent-socketio.

from gevent-socketio.

dswarbrick avatar dswarbrick commented on August 20, 2024

I'm closing this voluntarily, as I don't think the traceback is gevent-socketio's fault. Despite being able to resolve the bug by rolling back to an earlier version of the socket.io client (around v0.9.6), I suspect that what is really needed is better conditional checking in my Django view that handles the websocket request:

    retval = None
    if 'socketio' in request.environ:
        retval = socketio_manage(request.environ, ns_dict, request)
    return HttpResponse(retval)

from gevent-socketio.

mamcx avatar mamcx commented on August 20, 2024

This still happend. I have last versions of everything, and get in python:

127.0.0.1 - - [28/Dec/2012 15:14:46] "GET /socket.io/1/?t=1356725685834 HTTP/1.1
" 500 -
Traceback (most recent call last):
  File "c:\Programacion\Python\27\lib\site-packages\flask\app.py", line 1701, in
 __call__
    return self.wsgi_app(environ, start_response)
  File "c:\Programacion\Python\27\lib\site-packages\flask\app.py", line 1689, in
 wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "c:\Programacion\Python\27\lib\site-packages\flask\app.py", line 1687, in
 wsgi_app
    response = self.full_dispatch_request()
  File "c:\Programacion\Python\27\lib\site-packages\flask\app.py", line 1360, in
 full_dispatch_request
    rv = self.handle_user_exception(e)
  File "c:\Programacion\Python\27\lib\site-packages\flask\app.py", line 1358, in
 full_dispatch_request
    rv = self.dispatch_request()
  File "c:\Programacion\Python\27\lib\site-packages\flask\app.py", line 1344, in
 dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "c:\Proyectos\TeleportServer\teleport.py", line 85, in run_socketio
    socketio_manage(request.environ, {'/teleport': TeleportNamespace}, request)
  File "c:\Programacion\Python\27\lib\site-packages\socketio\__init__.py", line
67, in socketio_manage
    socket = environ['socketio']
KeyError: 'socketio'

And in javascript:

GET http://localhost:5000/socket.io/1/?t=1356725685834 500 (INTERNAL SERVER ERROR) socket.io.js:2
d.handshake socket.io.js:2
d.connect socket.io.js:2
d socket.io.js:2
c.connect socket.io.js:2
(anonymous function) main.js:45
k jquery-1.8.2.min.js:2
l.fireWith jquery-1.8.2.min.js:2
p.extend.ready jquery-1.8.2.min.js:2
D

This is trying to use flask + gevent. Running with app.run() this happend, however using:

    ws = SocketIOServer(('0.0.0.0', WEB_PORT),
        SharedDataMiddleware(app, {}),
        resource="socket.io",
        policy_server=False)

    ws.serve_forever()

Works, but break flask...

from gevent-socketio.

bvallant avatar bvallant commented on August 20, 2024

When disconnecting socketio.io calls an URL like /socket.io/1//209329135415/?disconnect=1 which gevent-socketio doesn't seem to handle correctly... Don't see right now where this functionality should be implemented?

from gevent-socketio.

danmur avatar danmur commented on August 20, 2024

This is still happening for me, even with the sample apps (at least the pyramid chat one). It's not on disconnect requests, it's on all requests. Downgrading the socket.io client to 0.9.something makes the problem go away.

from gevent-socketio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.