-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
XDebugError: command is not available #482
Comments
Same problem here with my Zend application. PHP version: 7.1.24
|
Happens here also. Sometimes I need to restart debugging session to get over it. Sometimes I restart whole Visual Studio too. Dunno what causes this. |
If I could see the dbgp log (xdebug3 https://xdebug.org/docs/all_settings#log xdebug2 https://2.xdebug.org/docs/all_settings#remote_log) it would help. The dbgp error is described here: https://xdebug.org/docs/dbgp#error-codes and the code (Xdebug branch 2.9) gets created here https://github.com/xdebug/xdebug/blob/12ffd358e6c566788b84c409bd77584a67ad8755/src/debugger/handler_dbgp.c This tells me, that VSC + adapter are sending |
Hi all, i'm using a docker image to run apache with xdebug 3 (https://github.com/thecodingmachine/docker-images-php). In general my setup seems to work since some breakpoints work correctly. Although others do not. I tested the setup by trying to debug Nextcloud so i set one breakpoint here which works and another one here which does not seem to work since the debugger doesn't break and instead prints the following error messages onto the console:
@zobo i set the xdebug log level to 7 and attached the log file here, hope this helps somehow. My setup (inside the docker container):
Thanks for your effort and let me know if i can provide any additional information. |
Great, thanks for he dump @R0Wi . I'll inspect it and get back to you with conclusions. |
@zobo btw: i have to correct my statement from above: even if there are some errors in the console, all breakpoints seem to be hit correctly. But of course it would be interesting what causes the errors :-) Thanks for investigation 👍 |
Hello @R0Wi . I have researched the issue and came to the following conclusion; It's a design issue. The issue happens when there are concurrent scripts being debugged. There is an already related PR #366, but I'll need to check this specific behavior anyway. The debug adapter (this extension) gets calls from vscode (setBreakPointsRequest, setExceptionBreakPointsRequest, setFunctionBreakPointsRequest). This happens when the user changes any breakpoint or on the start of the debugging session. So if concurrent debug sessions exist (like in your log) VSCode will call those at the beginning of every session. In each of those calls, for each connection a list of existing breakpoints is fetched from Xdebug, then the list is updated by removing current breakpoints and adding them again. The limitation of Xdebug is that the DBGp connection is blocking, and nothing is processed on it, as long as the php process is executing code. Only after a break is hit, there can be any communication on it. Because I see a The proper way to solve this is to delegate the breakpoint management code down from the adapter to the connection level. @R0Wi next time I'll also ask for the VSCode debug log (enabled in launch.json). I'll try to make a PR when time permits and have a look at it with @felixfbecker and @derickr - whenever they have time. |
Great analysis, thanks @zobo. I think i also noticed the described "parallel behaviour" in the VSCode debuggers bottom left corner where the request threads of apache are shown. I noticed multiple entries while debugging and refreshing the Nextcloud webapplication. So this would fit to your suspicion of parallel things going on here. If you need further information or log dumps just let me know, glad to help 👍 |
So what does this mean guys? I want to debug a Magento 2 application and just use vs code for years now. |
Hi @L3P3. I'll try to provide a quick patch for the issue within the current plugin framework. Once I have the other branch ready, would you be willing to test a prerelease? Best! |
Actually, I noticed that setting breakpoints and all that works. I still get the error messages above but for most requests, it works, just about 5% fail. |
This should be solved with the new breakpoint management subsystem. Let me know if there are more problems. |
Still getting this on v1.15.1. Debugging works about half of the time. In my case I'm debugging code that listens for a webhook. This webhook is executed many times in succession from an external service and is thus out of my control. The app itself (and xdebug) runs in a k8s pod locally. Here's a video of the problem. You can see that the debugger works for a few seconds, then test.mp4 |
Hi @nickjanssen ! Thanks for getting back. Can you please provide all the relevant logs? There are a few things I'm thinking about:
But please send me the logs, I would really like to figure out what the issue is. PS: All INI variables are Xdebug 3 specific. If you are still using Xdebug 2 let me know. |
It seems to me that 'command not available' leading to non-functioning breakpoints and debugging in overall most likely occurs when there are multiple asynchronous requests coming. |
Yes, that was the case observed before. The old implementation just reacted to DAP The new implementation however keeps an internal state of breakpoints and stacks changes and sends them later to Xdebug connection when it is available. This is why I am so curious why this would happen, because this means there's an edge case I was not able to find/test for. |
Hmmm.. I have PHP Debug 1.15.1 and now that I remember I haven't seen the problem anymore. So please ignore my previous comment. |
@zobo here's the vscode logs of one session while the debugger crashed. I am using Xdebug 3. https://gist.github.com/nickjanssen/11b56ae62e35a35b8fb3c38dd3182133
Attempting to cat the file simply says it doesn't exist.
|
Maybe it's in a private tmp? See https://xdebug.org/docs/step_debug#troubleshoot |
I have updated my PHP DEBUG extension to v.1.15.1 and I didn't noticed the error anymore.. until now:
|
Hi, if you are using Laravel then maybe you can try to run this command : |
Hi @tvvocold . I'll try, but might not be able to reproduce. A new release is imminent that will also have extended logging. The extension will also log all Xdebug traffic and that should then make it trivial for me to analyze such errors. Should be out in a day or so. I'll let you know and will ask you to try to reproduce the error again with logging on. Thanks! |
@tvvocold Just a bump. The new release is out and has improved logging. All Xdebug packets should be logged in VSCode and that would help me a lot to debug your issue. If you still see it, drop me a log from VSCode and I'll analyze it. Thanks. |
@zobo Thx but I'm OK. You can ping @MarceloLuis1997 to confirm it. |
Hi,
I'm using this awesome extension for a while and sometimes in the Debug Console it shows the error
XDebugError: command is not available
. The debug still works fine after that, but the Debug Console often shows that error.PHP version: 7.4.3
XDebug version: 2.9.6-7.4
Adapter version: v1.14.5
launch.json:
XDebug php.ini config:
Error log:
Code snippet to reproduce: It just randomly shows the error in any endpoint of my laravel application.
The text was updated successfully, but these errors were encountered: