-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debugpy listen silently crashing #1749
Comments
Not sure what a Ray cluster is, but the broken pipe sometimes happens in our test suite. I believe it's usually from one of two reasons:
This line in your adapter log makes me think it's the latter:
The connection the debuggee has to the adapter process is being killed. What's |
Hi. Thanks for your response!
Correct, that's the python interpreter. The same interpreter is used in local environments, in which this works fine (it only crashes when we run this in a k8s cluster).
I see. Hopefully this leads us to a solution. Is there any way in which we can dig deeper into that? As I'm not sure yet what I could try next... I also don't think I understand the hierarchy of clients/servers that well for the debugger. Seems like the debuggee sets up a debugpy server with debugpy.listen, but that in fact sets up multiple things (a server, client and adapter?) and that all those are something else than the client coming from starting an "attach" in vscode? I.e. there is a debuggee side client/server/(adapter?) and a vscode-side client? |
This md file sort of explains the different parts involved (it's for subprocess debugging so there's an extra debuggee, but the other parts are the same): This code here is being hit:
That code would happen if:
Looking at your logs again, the adapter never gets a connection from the client. Meaning VS code never talks to it. On my local machine, there's a message like so:
That's the port that's being listened on by debugpy and which VS code connects to. In your logs it's showing this:
Is that the port you're using to connect with? |
Environment data
Actual behavior
I'm using the Ray Distributed Debugger (their code here) with Ray on K8S. It runs
debugpy.listen
, but when I check the port on which it listens, nothing is bound to that port (sudo lsof -i :$LISTEN_PORT
). I enabledDEBUGPY_LOG_DIR
to get more detailed logs, and I noticed thatdebugpy.pydevd.NNNN.log
contains this near the end, indicating that it indeed crashed:I looked in the issue trackers of debugpy, pydevd, and ray, and did some googling, and couldn't find much unfortunately. The only thing I found is that this may point to the connection between the local services (there is a client, server, and "debug server" and some incoming client (?) involved in running debugpy on the application side, it seems) breaking. I found this snippet in
debugpy.adapter.NNNN.log
:Lastly, I noticed this in
debugpy.{adapter,server}.NNNN.log
but that seems to be ok, as I also saw this in healthy local runs:All of this crashes already before I try connecting to the debugger.
I was also able to reproduce this without using Ray Distributed Debugger. I just connect to the k8s pod, create a small python script:
Run it and check the log files and see the same crash happening (
BrokenPipeError: [Errno 32] Broken pipe
) in the pydevd logs.When I run all of this locally, everything works fine. When running on ray on k8s, I run into this issue...
These are the full, lightly redacted, logs:
Questions:
Expected behavior
Accepting oncoming connections on the debugpy.listen endpoint.
Steps to reproduce:
I'm afraid it will be hard to reproduce this in an environment other than our "ray on k8s" setup. But details are in the "Actual behavior" section.
The text was updated successfully, but these errors were encountered: