compose: Cannot do interactive debugging

I have launched a Django web application from within fig and commonly use import ipdb; ipdb.set_trace() (or the more common pdb instead of ipdb) which is a common way of debugging apps. What’s supposed to happen is when the code hits that part an interactive debugger appears on the console where the app has been running allowing you to type commands to see the state of the application.

When it’s run from fig though, it appears on the console but since you can’t type anything in it the debugging app quits with an error. Here’s what happens on the console.

web_1     | > /something.py(126)method()
web_1     |     127 
web_1     | --> 128     line_to_debug()
web_1     |     129       # More code...
web_1     | 
web_1     | ipdb> 
web_1     |
web_1     |  ... back to application output since nothing could be entered at ipdb> prompt above ...

There should be a way to allow for interactive debugging which is a very common use case in development. Something like specifying that one of the services in the fig configuration can accept input.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

@aidanlister fig up runs multiple services with ports exposed but non-interactively; fig run runs a single service interactively but without ports exposed by default. --service-ports overrides that default so that it’s running both interactively and with ports exposed, meaning you can run your web app with the debugger turned on.

Now that #485 is merged, this should be possible with fig run --service-ports web.