# Cannot use docker + ipdb with nameko?

**URL:** <https://discourse.nameko.io/t/cannot-use-docker-ipdb-with-nameko/163>\
**Category:** googlegroup\
**Created:** [November 28, 2016, 12:37pm UTC](https://discourse.nameko.io/t/cannot-use-docker-ipdb-with-nameko/163 "2016-11-28T12:37:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stevebasher22](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Stevebasher22](https://discourse.nameko.io/u/Stevebasher22)\
**Post date:** [November 28, 2016, 12:37pm UTC](https://discourse.nameko.io/t/cannot-use-docker-ipdb-with-nameko/163/1 "2016-11-28T12:37:42Z")

</div>

I have just started to use Namkeo to build a new app I am working on. It is  
very impressive and works well as an RPC client for micro-servicing.

I'm seeming to have quite a specific issue. I have setup my app so each  
micro-service is in its own docker container (built via docker-compose). In  
the docker-compose run command I am using --service-ports so as to allow  
the use of ipdb within the container.

If I just invoke ipdb within python in the container it works and is  
interactive as expected. If I run the nameko service in the container that  
also works and connects to the other containers via a rabbit network I have  
setup.

The issue is that using ipdb WITH nameko (in a docker container) doesn't  
work, the ipdb console appears but doesn't let me type anything:

\<[https://lh3.googleusercontent.com/-T0b3orx1zis/WDwj3\_Mb8XI/AAAAAAAAACM/wVrXd32SoHYx20p0\_R3eRZbpTi8GrRehwCLcB/s1600/Screen%2BShot%2B2016-11-27%2Bat%2B21.23.59.png](https://lh3.googleusercontent.com/-T0b3orx1zis/WDwj3_Mb8XI/AAAAAAAAACM/wVrXd32SoHYx20p0_R3eRZbpTi8GrRehwCLcB/s1600/Screen%2BShot%2B2016-11-27%2Bat%2B21.23.59.png)\>

I have narrowed it down to be because of the eventlet.monkey\_patch()  
function run within the cli run function. If I don't use eventlet and just  
try service\_runner.start(), service\_runner.wait() my service runs but does  
not pick up messages from the rabbit queue.

Any ideas how to get around / fix this issue? Ideally I wouldn't use  
eventlets at all and instead have a simple function that runs my service  
(like below) but this doesn't seem to work (with or without runner.wait()  
at the end):

def run\_services(services, cfg=None):  
&nbsp;&nbsp;&nbsp;&nbsp;if not cfg:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfg = {'AMQP\_URI': 'amqp://guest:guest@rabbitmq:5672'}

&nbsp;&nbsp;&nbsp;&nbsp;runner = ServiceRunner(config=cfg)

&nbsp;&nbsp;&nbsp;&nbsp;for service in services:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;runner.add\_service(service)

&nbsp;&nbsp;&nbsp;&nbsp;runner.start()  
&nbsp;&nbsp;&nbsp;&nbsp;runner.wait()

I will very much appreciate help on this, it is blocking my entire  
application development! Thank you very much.

---

<div class="post-metadata">

**Author:** ![David\_Szotten](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/david_szotten/32/6_2.png) [@David\_Szotten](https://discourse.nameko.io/u/David_Szotten)\
**Post date:** [November 28, 2016, 1:19pm UTC](https://discourse.nameko.io/t/cannot-use-docker-ipdb-with-nameko/163/2 "2016-11-28T13:19:54Z")

</div>

Nameko depends on eventlet for all of its core functionality. You cannot  
just remove it and expect things to work.

It's entirely possible that eventlet isn't compatible with ipdb. It may be  
possible to workaround, but would require some research. A better  
workaround (than removing eventlet) is to use a different debugger, like  
pdb from the standard library (`import pdb; pdb.set_trace()`)

Personally I also use pdb++ ([https://pypi.python.org/pypi/pdbpp/\](https://pypi.python.org/pypi/pdbpp/%5C)) which  
works fine

Best,  
David

> **···**
>
> On Monday, 28 November 2016 12:37:42 UTC, steveb...@gmail.com wrote:
> 
> > I have just started to use Namkeo to build a new app I am working on. It  
> > is very impressive and works well as an RPC client for micro-servicing.
> > 
> > I'm seeming to have quite a specific issue. I have setup my app so each  
> > micro-service is in its own docker container (built via docker-compose). In  
> > the docker-compose run command I am using --service-ports so as to allow  
> > the use of ipdb within the container.
> > 
> > If I just invoke ipdb within python in the container it works and is  
> > interactive as expected. If I run the nameko service in the container that  
> > also works and connects to the other containers via a rabbit network I have  
> > setup.
> > 
> > The issue is that using ipdb WITH nameko (in a docker container) doesn't  
> > work, the ipdb console appears but doesn't let me type anything:
> > 
> > \<[https://lh3.googleusercontent.com/-T0b3orx1zis/WDwj3\_Mb8XI/AAAAAAAAACM/wVrXd32SoHYx20p0\_R3eRZbpTi8GrRehwCLcB/s1600/Screen%2BShot%2B2016-11-27%2Bat%2B21.23.59.png&gt](https://lh3.googleusercontent.com/-T0b3orx1zis/WDwj3_Mb8XI/AAAAAAAAACM/wVrXd32SoHYx20p0_R3eRZbpTi8GrRehwCLcB/s1600/Screen%2BShot%2B2016-11-27%2Bat%2B21.23.59.png&gt);
> > 
> > I have narrowed it down to be because of the eventlet.monkey\_patch()  
> > function run within the cli run function. If I don't use eventlet and just  
> > try service\_runner.start(), service\_runner.wait() my service runs but does  
> > not pick up messages from the rabbit queue.
> > 
> > Any ideas how to get around / fix this issue? Ideally I wouldn't use  
> > eventlets at all and instead have a simple function that runs my service  
> > (like below) but this doesn't seem to work (with or without runner.wait()  
> > at the end):
> > 
> > def run\_services(services, cfg=None):  
> > &nbsp;&nbsp;&nbsp;&nbsp;if not cfg:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfg = {'AMQP\_URI': 'amqp://guest:guest@rabbitmq:5672'}
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;runner = ServiceRunner(config=cfg)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;for service in services:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;runner.add\_service(service)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;runner.start()  
> > &nbsp;&nbsp;&nbsp;&nbsp;runner.wait()
> > 
> > I will very much appreciate help on this, it is blocking my entire  
> > application development! Thank you very much.

---

<div class="post-metadata">

**Author:** ![Stevebasher22](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Stevebasher22](https://discourse.nameko.io/u/Stevebasher22)\
**Post date:** [November 28, 2016, 1:43pm UTC](https://discourse.nameko.io/t/cannot-use-docker-ipdb-with-nameko/163/3 "2016-11-28T13:43:48Z")

</div>

Hi David,

Thank you very much for your prompt response. pdbpp seems to work fine,  
looks like I'll be converting to that! 🙂

Kind Regards,  
Steve

> **···**
>
> On Monday, November 28, 2016 at 1:19:54 PM UTC, David Szotten wrote:
> 
> > Nameko depends on eventlet for all of its core functionality. You cannot  
> > just remove it and expect things to work.
> > 
> > It's entirely possible that eventlet isn't compatible with ipdb. It may be  
> > possible to workaround, but would require some research. A better  
> > workaround (than removing eventlet) is to use a different debugger, like  
> > pdb from the standard library (`import pdb; pdb.set_trace()`)
> > 
> > Personally I also use pdb++ ([https://pypi.python.org/pypi/pdbpp/\](https://pypi.python.org/pypi/pdbpp/%5C)) which  
> > works fine
> > 
> > Best,  
> > David
> > 
> > On Monday, 28 November 2016 12:37:42 UTC, steveb...@gmail.com wrote:
> > 
> > > I have just started to use Namkeo to build a new app I am working on. It  
> > > is very impressive and works well as an RPC client for micro-servicing.
> > > 
> > > I'm seeming to have quite a specific issue. I have setup my app so each  
> > > micro-service is in its own docker container (built via docker-compose). In  
> > > the docker-compose run command I am using --service-ports so as to allow  
> > > the use of ipdb within the container.
> > > 
> > > If I just invoke ipdb within python in the container it works and is  
> > > interactive as expected. If I run the nameko service in the container that  
> > > also works and connects to the other containers via a rabbit network I have  
> > > setup.
> > > 
> > > The issue is that using ipdb WITH nameko (in a docker container) doesn't  
> > > work, the ipdb console appears but doesn't let me type anything:
> > > 
> > > \<[https://lh3.googleusercontent.com/-T0b3orx1zis/WDwj3\_Mb8XI/AAAAAAAAACM/wVrXd32SoHYx20p0\_R3eRZbpTi8GrRehwCLcB/s1600/Screen%2BShot%2B2016-11-27%2Bat%2B21.23.59.png&gt](https://lh3.googleusercontent.com/-T0b3orx1zis/WDwj3_Mb8XI/AAAAAAAAACM/wVrXd32SoHYx20p0_R3eRZbpTi8GrRehwCLcB/s1600/Screen%2BShot%2B2016-11-27%2Bat%2B21.23.59.png&gt);
> > > 
> > > I have narrowed it down to be because of the eventlet.monkey\_patch()  
> > > function run within the cli run function. If I don't use eventlet and just  
> > > try service\_runner.start(), service\_runner.wait() my service runs but does  
> > > not pick up messages from the rabbit queue.
> > > 
> > > Any ideas how to get around / fix this issue? Ideally I wouldn't use  
> > > eventlets at all and instead have a simple function that runs my service  
> > > (like below) but this doesn't seem to work (with or without runner.wait()  
> > > at the end):
> > > 
> > > def run\_services(services, cfg=None):  
> > > &nbsp;&nbsp;&nbsp;&nbsp;if not cfg:  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfg = {'AMQP\_URI': 'amqp://guest:guest@rabbitmq:5672'}
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;runner = ServiceRunner(config=cfg)
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;for service in services:  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;runner.add\_service(service)
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;runner.start()  
> > > &nbsp;&nbsp;&nbsp;&nbsp;runner.wait()
> > > 
> > > I will very much appreciate help on this, it is blocking my entire  
> > > application development! Thank you very much.
