I need to debug remote server, Python.
My Python app is running inside Docker container on some server and I have ssh access to that server.
For remote debugging I want to use rpdb (I don't know other tools for that).
My steps:
pip install rpdbimport rpdb; rpdb.Rpdb(port=5555).set_trace()./redeploy.sh (this command will run my application)telnet 127.0.0.1 5555As a result I get:
ubuntu@ip-10-1-0-345:~$ telnet 127.0.0.1 5555
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
I open url which is supposed to call rpdb and I get nothing. So, how I can reach rpdb from command line then?
You just need to add the addr param to the Rpdb() to accept the connections.
It'll look like this:
import rpdb; rpdb.Rpdb(addr='0.0.0.0', port=5555).set_trace()
Don't forget to add EXPOSE 5555 to your Dockerfile and map the ports on the running container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With