2

So I am using the micro-servicing python package nameko which runs a service using eventlet and calls eventlet.monkey_patch() on import.

I have deciphered that it is this piece of code that is blocking any debug attempts via ipdb. The ipdb console shows in the terminal but I cannot type anything and have to close the entire terminal session in order to quit the process.

The stuck console looks like: enter image description here

How can I use ipdb with this function?

EDIT: This issue only seems to happen when within a docker container.

steve
  • 537
  • 1
  • 7
  • 17
  • Are you supplying the options to ``docker run`` to have it attach your console and ``stdin`` to the container so you can type into it? If it was plain ``docker run``, you would supply the ``-it`` option. – Graham Dumpleton Nov 28 '16 at 11:32
  • It looks like by default a pseudo tty is defined by docker-compose. The interactive part I think is also defaulted (or implied by `--service-ports`), especially as without `eventlet.monkey_patch()` I can use `ipdb` interactively fine from the docker container. – steve Nov 28 '16 at 11:59
  • Eventlet also breaks ipython so I suspect it has something to do with interactivity instead of running on docker or using ipdb. – Marco Lavagnino Jun 24 '17 at 00:44

1 Answers1

2

Sorry, no convenient solution, for now your best option is to skip docker when using ipdb (you can extract filesystem image from docker and run it in another virtualisation, such as qemu, Virtualbox, systemd-nspawn). See https://github.com/larsks/undocker for help.

Other things to try (may not work, please share results):

  • update eventlet to github master pip install https://github.com/eventlet/eventlet/archive/master.zip

This issue is cross posted here https://github.com/eventlet/eventlet/issues/361

temoto
  • 5,394
  • 3
  • 34
  • 50
  • Thanks for the answer. It seems for some reason 'ipdb' isn't compatible with 'eventlet' in a docker container. My solution ended up being to use pdbpp which works fine with nameko and eventlet. Setting os=False didn't fix things unfortunately, but I never tried to update eventlet, even though I was using the latest nameko so I would assume as a dependency eventlet would be up to date. – steve Dec 03 '16 at 17:10
  • `pip freeze` will tell versions of installed packages. – temoto Dec 04 '16 at 19:57