PyCharm remote-debugger is connected but stuck
Hi,
I'm using PyCharm's python-debug-server feature in order to debug python code from remote.
I've inserted the needed lines to the code in order to connect to the debug server ('pydevd_pycharm.settrace' etc..).
The remote interpreter succeeded with connecting to the debug server, but then all I see in the debug console is:
Waiting for process connection...
Connected to pydev debugger (build 201.7223.92)
After the connection setup, the debugger is stuck and I cant press on the 'resume program' button, no frames are available, no variables state, step into/over buttons are on disable mode (grayed and can't be pressed), and basically - the debugger is not working...
Please help :)
Thanks
Please sign in to leave a comment.
Hello,
Please attach a screenshot of the Remote Debug Server Configuration https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config , the Debug Console view when the debug started and , "no frames are available, no variables state, step into/over buttons are on disable mode (grayed and can't be pressed)"
Does it happen with any code or a specific one?
Hi,
First, thanks for the reply.
Here are the remote-debug config screenshots:
- Main config
- Mapping config
When I'm starting the debugger, that's how my IDE looks like:
You can see at the console that the debug server is waiting for a connection, and in addition, you can see that I've inserted a set_trace line on line number 350.
When I trigger the app into the code section that connecting the debug server, you can see in the next screenshot that there is a connection, but at that point I'm expecting for the debugger to tell me something about the invalid file path mapping, but here nothing happens, and its just stuck (usually without path mapping configuration like our scenario, I see a new gray tab which offers me three options: 1. download the code file from the remote side, 2. try to find auto path mapping, 3. open path mapping configuration window. In our case that's not happening).
Here you can see that the debugger is connected:
And when I'm moving to the debugger tab (left to the debugger console), you can see that the buttons are grayed and disabled, the the 'Frame are not available' message
Its happens when I'm running a code that deployed inside a remote docker container. When I'm deploying the code on a remote host, everything works fine, but the issues come when trying to debug code which deployed into a docker container on a remote host.
The needed ports are open (you can see that the debugger Is connected) so I don't think its a network issue.
Please help :)
Thanks
You don't seem to have any breakpoints set and pydevd_pycharm.settrace() function has suspend argument set to False.
Have you tried setting it to True?
I have the same issue. Mine occurs when our company changed VPNs. If I go back to previous VPN, problem solved... but it is being phased out, so I can't continue to use it.
Does PyCharm spawn additional communication channels? My suspicion is that the initial connection is fine, but that the VPN blocked the new channels?
I am facing similar issue. Did anyone find the solution.
Same problem.
PyCharm 241.17890.14 on windows (same egg installed into remote ubuntu)
Developing Django app behind Apache2
Put settrace in wsgi.py with port 5678
Console shows that remote process is connected to debugger, but web app doesn't work: always get Timeout error after some time.
Removing settrace restores normal work (without debug ability).
Telnet from remote to localhost on 5678 shows normal connection.
The issue doesn't seem to be reproducible with the latest.
Please make sure you are following these steps to debug your application via the Python debug server:
1. Install the correct version of pydevd_pycharm (which can be found in the debug server configuration).
2. Add the required peace of code to the application.
3. Start the debug server.
4. Run the application.
Also, do you use any VPN or proxy services?
1. Versions match.
2. Wrote whole Django web-app
3. Done
4. Done
And no proxies/vpns OFC. It's restricted environment behing firewall. Only allowed mutual connections between working machine and remote by necessary ports (5678 included).
There is connection to debugger as written in the console. But navigating to any page of web-app hangs application. It throws timeout after 60 seconds (timeout is set in apache2.conf, changable). Without debugger everything works as it should. Apache logs trace8 shows nothing exceptional (except wsgi error with timeout). PyCharm logs don't show any problem.
I cannot turn off Apache as it also serves kerberos module for authentication, and LDAP module which uses it for authorization is highly integrated into app by design. So bare gunicorn or even nginx/gunicorn is not an option.
BTW it's PyCharm Pro with active license and I'm kinda frustrated as it was purchased for extended debug capabilities.
Let's check one last thing before we roll out a bug report (because it clearly looks like a bug so far).
When the application connects to the debugger, it gets suspended, and the user needs to continue execution manually. Could you please check if resuming the application from the debugger helps:
I have the same issue with the latest version (243.21565.199),
I even tried to connect to a debuger from a pure python console on the local machine, and can't connect to the debuger,
When I interrupt it, it gives the following error:
and Here is my debugger config,
And I've been using this debugger for quite a while and this is happening on my new machine with new Pycharm installation,
Please try to workaround from the pinned comment.
I downgraded to version 2024.2.3 and it started working normally again.
Mine is 2024.1.3 (241.17890.14)
Some update.
**masked my local ip
In wsgi.py:
import pydevd_pycharm
pydevd_pycharm.settrace("**.**.**.**", port=5678, stdoutToServer=True, stderrToServer=True, patch_multiprocessing=True, suspend=True)
In PyCharm console :
pydevd_pycharm.settrace('**.**.**.**', port=5678, stdoutToServer=True, stderrToServer=True)
Connected to pydev debugger (build 241.17890.14)
In debugger:
And nothing happens. Browser hangs for timeout set in apache.
Apache errorlog:
[Thu Nov 28 11:55:09.319665 2024] [wsgi:error] [pid 1261290:tid 139887470696192] [client **.**.**.**:58083] Timeout when reading response headers from daemon process 'rescalc': /var/www/rescalc/calculator/wsgi.py, referer: https://mydomain.name/