question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

http entrypoint does not work with eventlet master

See original GitHub issue

I don’t know whether this bug is in nameko or in eventlet, if necessary I will close this and report upstream

using a very basic nameko HTTP service:

from nameko.web.handlers import http


class SimpleRestServer:

    name = "simple_rest_server"

    @http('GET', '/')
    def get_hello_world(self, request):
        return "Hello, World"

On calling nameko run hello_world.py the service starts normally. With the latest eventlet release (0.21.0), I can then go to ‘http://localhost:8000’ and see “Hello, World”. With eventlet master, when I try to browse to ‘http://localhost:8000’, the nameko service crashes:

$ nameko run hello_world                         
/home/cjk/repos/github/eventlet/eventlet/patcher.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
starting services: simple_rest_server
<ServiceContainer [simple_rest_server] at 0x7f91a0974e80> thread exited with error
Traceback (most recent call last):
  File "/home/cjk/repos/github/nameko/nameko/containers.py", line 466, in _handle_thread_exited
    gt.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 179, in wait
    return self._exit_event.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 125, in wait
    current.throw(*self._exc)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/web/server.py", line 86, in process_request
    self._serv.process_request((sock, address))
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 776, in process_request
    proto.__init__(conn_state, self)
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 333, in __init__
    self.setup()
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 347, in setup
    conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, True)
AttributeError: 'tuple' object has no attribute 'setsockopt'
killing <ServiceContainer [simple_rest_server] at 0x7f91a0974e80> due to 'tuple' object has no attribute 'setsockopt'
killing 1 managed thread(s)
killing managed thread `run`
Traceback (most recent call last):
  File "/home/cjk/repos/github/eventlet/eventlet/hubs/hub.py", line 458, in fire_timers
    timer()
  File "/home/cjk/repos/github/eventlet/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/web/server.py", line 86, in process_request
    self._serv.process_request((sock, address))
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 776, in process_request
    proto.__init__(conn_state, self)
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 333, in __init__
    self.setup()
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 347, in setup
    conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, True)
AttributeError: 'tuple' object has no attribute 'setsockopt'
Traceback (most recent call last):
  File "/home/cjk/repos/github/eventlet/eventlet/hubs/hub.py", line 458, in fire_timers
    timer()
  File "/home/cjk/repos/github/eventlet/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 170, in _do_send
    waiter.throw(*exc)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 181, in call
    return getattr(item, name)(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/containers.py", line 312, in wait
    return self._died.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 121, in wait
    return hubs.get_hub().switch()
  File "/home/cjk/repos/github/eventlet/eventlet/hubs/hub.py", line 295, in switch
    return self.greenlet.switch()
  File "/home/cjk/repos/github/nameko/nameko/containers.py", line 466, in _handle_thread_exited
    gt.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 179, in wait
    return self._exit_event.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 125, in wait
    current.throw(*self._exc)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/web/server.py", line 86, in process_request
    self._serv.process_request((sock, address))
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 776, in process_request
    proto.__init__(conn_state, self)
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 333, in __init__
    self.setup()
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 347, in setup
    conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, True)
AttributeError: 'tuple' object has no attribute 'setsockopt'
stopping services: simple_rest_server
Traceback (most recent call last):
  File "/home/cjk/repos/github/eventlet/eventlet/queue.py", line 118, in switch
    self.greenlet.switch(value)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/runners.py", line 96, in wait
    SpawningProxy(self.containers, abort_on_error=True).wait()
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 184, in spawning_method
    return list(fail_fast_imap(pool, call, self._items))
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 153, in fail_fast_imap
    eventlet.getcurrent().throw(*exc_info)
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 132, in handle_result
    thread_result = finished_thread.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 179, in wait
    return self._exit_event.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 125, in wait
    current.throw(*self._exc)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 181, in call
    return getattr(item, name)(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/containers.py", line 312, in wait
    return self._died.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 121, in wait
    return hubs.get_hub().switch()
  File "/home/cjk/repos/github/eventlet/eventlet/hubs/hub.py", line 295, in switch
    return self.greenlet.switch()
  File "/home/cjk/repos/github/nameko/nameko/containers.py", line 466, in _handle_thread_exited
    gt.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 179, in wait
    return self._exit_event.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 125, in wait
    current.throw(*self._exc)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/web/server.py", line 86, in process_request
    self._serv.process_request((sock, address))
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 776, in process_request
    proto.__init__(conn_state, self)
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 333, in __init__
    self.setup()
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 347, in setup
    conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, True)
AttributeError: 'tuple' object has no attribute 'setsockopt'
Traceback (most recent call last):
  File "/home/cjk/.conda/envs/eventsad/bin/nameko", line 11, in <module>
    load_entry_point('nameko', 'console_scripts', 'nameko')()
  File "/home/cjk/repos/github/nameko/nameko/cli/main.py", line 72, in main
    args.main(args)
  File "/home/cjk/repos/github/nameko/nameko/cli/commands.py", line 85, in main
    main(args)
  File "/home/cjk/repos/github/nameko/nameko/cli/run.py", line 182, in main
    run(services, config, backdoor_port=args.backdoor_port)
  File "/home/cjk/repos/github/nameko/nameko/cli/run.py", line 140, in run
    runnlet.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 179, in wait
    return self._exit_event.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 121, in wait
    return hubs.get_hub().switch()
  File "/home/cjk/repos/github/eventlet/eventlet/hubs/hub.py", line 295, in switch
    return self.greenlet.switch()
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/runners.py", line 96, in wait
    SpawningProxy(self.containers, abort_on_error=True).wait()
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 184, in spawning_method
    return list(fail_fast_imap(pool, call, self._items))
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 153, in fail_fast_imap
    eventlet.getcurrent().throw(*exc_info)
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 132, in handle_result
    thread_result = finished_thread.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 179, in wait
    return self._exit_event.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 125, in wait
    current.throw(*self._exc)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/utils/__init__.py", line 181, in call
    return getattr(item, name)(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/containers.py", line 312, in wait
    return self._died.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 121, in wait
    return hubs.get_hub().switch()
  File "/home/cjk/repos/github/eventlet/eventlet/hubs/hub.py", line 295, in switch
    return self.greenlet.switch()
  File "/home/cjk/repos/github/nameko/nameko/containers.py", line 466, in _handle_thread_exited
    gt.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 179, in wait
    return self._exit_event.wait()
  File "/home/cjk/repos/github/eventlet/eventlet/event.py", line 125, in wait
    current.throw(*self._exc)
  File "/home/cjk/repos/github/eventlet/eventlet/greenthread.py", line 218, in main
    result = function(*args, **kwargs)
  File "/home/cjk/repos/github/nameko/nameko/web/server.py", line 86, in process_request
    self._serv.process_request((sock, address))
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 776, in process_request
    proto.__init__(conn_state, self)
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 333, in __init__
    self.setup()
  File "/home/cjk/repos/github/eventlet/eventlet/wsgi.py", line 347, in setup
    conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, True)
AttributeError: 'tuple' object has no attribute 'setsockopt'

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jan 19, 2018

Thanks @mattbennett for releasing nameko 2.8.3 as a hotfix. Much appreciated.

1reaction
mattbennettcommented, Jan 12, 2018

Thanks @notpeter. I will release a hotfix

Read more comments on GitHub >

github_iconTop Results From Across the Web

eventlet.wsgi.Server.process_request invocation changed #420
7f53465 changes the invocation of https://github.com/eventlet/ ... http entrypoint does not work with eventlet master nameko/nameko#485.
Read more >
Nameko eventlet Back Door - googlegroup
Hi devs We''re experiencing hanging services in production. Previously I've used the eventlet backdoor to telnet in and inspect what workers ...
Read more >
App Engine Flexible can't use datastore with websockets ...
I have tried with the Flask-SocketIO framework using the eventlet worker and the datastore queries work fine. entrypoint: gunicorn -b :$PORT -- ...
Read more >
Change history — Kombu 5.2.4 documentation - Celery
Specifying names for broadcast queues now work as expected. Previously, named broadcast queues did not create multiple queues per worker. They incorrectly ...
Read more >
How to use Flask with gevent (uWSGI and Gunicorn editions)
Create asynchronous Flask application and run it with uWSGI or ... doesn't change the way every single HTTP request is being served, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found