vscode-php-debug icon indicating copy to clipboard operation
vscode-php-debug copied to clipboard

Debug adapter process has terminated unexpectedly

Open ramya-rao-a opened this issue 9 years ago • 28 comments

From @Yagneshdxt on March 12, 2017 11:26

  • VSCode Version: Code 1.10.2 (8076a19fdcab7e1fc1707952d652f0bb6c6db331, 2017-03-08T14:02:52.799Z)
  • OS Version: Windows_NT ia32 6.1.7601
  • Extensions:
Extension Author Version
php-debug felixfbecker 1.10.0
php-intellisense felixfbecker 1.1.3
csharp ms-vscode 1.7.0
mono-debug ms-vscode 0.15.3
laravel-blade onecentlin 1.8.1

Steps to Reproduce:

  1. click on start debugging button on debugging tab. (I am debugging php file wiht felixfbecker.php-debug extension)
  2. Debugger shows error Debug adapter process has terminated unexpectedly on my developer tool it shows error in workbench.main.js:103

My debugging was working fine before vscode update after vscode update it started showing this error.

Copied from original issue: Microsoft/vscode#22476

ramya-rao-a avatar Mar 12 '17 18:03 ramya-rao-a

@Yagneshdxt Is this happening consistently? Can you share the error you see in the debug console and developer console if any?

cc @felixfbecker

ramya-rao-a avatar Mar 12 '17 18:03 ramya-rao-a

From @felixfbecker on March 12, 2017 18:32

Feel free to move the issue, I need to see some stack trace from eg dev tools

ramya-rao-a avatar Mar 12 '17 18:03 ramya-rao-a

I'm having the same issue with vs code 1.10.2 on osx.

levani avatar Mar 19 '17 17:03 levani

vsdebugerror

Hi @ramya-rao-a please find attached screen shot

If you can help me with steps to get more details about error. I will happy to help you with more detail error log.

Yagneshdxt avatar Mar 28 '17 07:03 Yagneshdxt

What is your launch.json? EACCESS 81 indicates you use port 81 but don't run with root permissions to bind on that port.

felixfbecker avatar Mar 28 '17 07:03 felixfbecker

{ "version": "0.2.0", "configurations": [

        {
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9000
    },
    {
        "name": "Launch currently open script",
        "type": "php",
        "request": "launch",
        "program": "${file}",
        "cwd": "${fileDirname}",
        "port": 81
    }
]

}

This is my launch.json Please let me know what else can I do

Yagneshdxt avatar Mar 28 '17 07:03 Yagneshdxt

The port setting needs to match what you set in your php.ini config as xdebug.remote_port (default 9000). You cannot listen on ports below 1000 without administrator privileges. Please refer to the readme and xdebug documentation for further help.

felixfbecker avatar Mar 28 '17 07:03 felixfbecker

@felixfbecker

My debugger was working fine before I updated VSCode. I never faced any issue. I have not changed any access or any of the setting but suddenly after update it stopped working.

Please help me further. I am not able to find any access issue. I ran VSCode with administrator right but I got the same error.

Please find below my port setting in php.ini file.

; Local Variables: ; tab-width: 4 zend_extension = "D:\Yagnesh\php\ext\php_xdebug-2.5.1-7.1-vc14-nts.dll" xdebug.remote_enable = 1 xdebug.remote_autostart = 1 xdebug.remote_port = 9000 ; End:

Yagneshdxt avatar Mar 28 '17 10:03 Yagneshdxt

Well maybe VS Code broke running as admin. But the log in your screenshot clearly shows listen EACCESS 0.0.0.0:80. Which corresponds to your port setting in launch.json - change the port to 9000

felixfbecker avatar Mar 28 '17 10:03 felixfbecker

I had a different case lately that was not related to port number... Not sure if this is the cause of the problem but this extension doesn't work reliably when there are many concurrent requests being processed. When there are 4-5+ items in call stack and I hit the restart icon (green round arrow) it always crashes with the above message.

I managed to reproduce this consistently with a sample project attached to this comment. In this project index.php file is sending multiple ajax requests at the same time. In file2.php - file7.php there is sleep(30) to keep the process in call stack for a while. Try opening file8.php and create new breakpoint somewhere in the top. Than reload the browser where index.php is opened and once the breakpoint is hit try to restart the debug process (that green arrow or ctrl + shift + f5).

rec

https://drive.google.com/file/d/0B7Ls870jI1CLZWFkazdySHdBTFE/view?usp=sharing

levani avatar Mar 28 '17 11:03 levani

@levani that is a different issue, please don't hijack the thread. XDebug's protocol is serial, so if your script is in a running state (not stopped on a breakpoint or ended) because of a sleep or whatever, we cannot send it the request to terminate, so we have to wait until it returns a stopped response. If you impatiently spam the restart button, then VS Code will just spawn a new debug adapter despite the old one not properly terminated which results in an EADDRINUSE error because the port is still blocked by the other process. This is a different error than EACCESS.

felixfbecker avatar Mar 28 '17 11:03 felixfbecker

same for me, after update i can not debug with xDebugger

Version : 1.18.1 So : Win 10

bakeiro avatar Nov 21 '17 15:11 bakeiro

Got this problem too like @bakeiro and I used php_xdebug-2.5.5-5.6-vc11

dodongphure avatar Nov 21 '17 16:11 dodongphure

@felixfbecker After the recent VSCode update I get the above error each time I attempt to debug. This worked fine before the update. This is my launch.json:

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Listen for XDebug",
			"type": "php",
			"request": "launch",
			"port": 9000,
			"pathMappings": {
				"/mnt/[path to my remote working directory]": "${workspaceRoot}/site"
			}
		}
	]
}

DeanNonatomic avatar Nov 21 '17 16:11 DeanNonatomic

@bakeiro same is happening with on my system after update.

rajeev123045 avatar Nov 21 '17 16:11 rajeev123045

Same issue here. Left work yesterday with it working fine and came in today to it being broken. I haven't changed anything.

VSCode 1.18.1 MacOS High Sierra 10.13.1

sp00ls avatar Nov 21 '17 17:11 sp00ls

I started having the same issue a few hours ago.

VSCode 1.18.1 Windows 10

cesarga avatar Nov 21 '17 17:11 cesarga

Same issue started for me : Debug adapter process has terminated unexpectedly

VSCode 1.18.1 Windows 10

ekernd avatar Nov 21 '17 17:11 ekernd

Same problem VSCode 1.18.1 Ubuntu linux 17.10

[14660:1121/123011.834411:INFO:CONSOLE(5)] "[uncaught exception]: Error: read ECONNRESET", source: file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/bootstrap/index.js (5)
[14660:1121/123011.834460:INFO:CONSOLE(5)] "Error: read ECONNRESET
    at exports._errnoException (util.js:1050:11)
    at Pipe.onread (net.js:581:26)", source: file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/bootstrap/index.js (5)
[14660:1121/123011.834476:INFO:CONSOLE(163)] "Uncaught Error: read ECONNRESET", source: events.js (163)
[14660:1121/123011.835207:INFO:CONSOLE(9)] "Debug adapter process has terminated unexpectedly", source: file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js (9)
[14660:1121/123012.921884:INFO:CONSOLE(5)] "[uncaught exception]: Error: read ECONNRESET", source: file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/bootstrap/index.js (5)
[14660:1121/123012.921920:INFO:CONSOLE(5)] "Error: read ECONNRESET
    at exports._errnoException (util.js:1050:11)
    at Pipe.onread (net.js:581:26)", source: file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/bootstrap/index.js (5)
[14660:1121/123012.921937:INFO:CONSOLE(163)] "Uncaught Error: read ECONNRESET", source: events.js (163)
[14660:1121/123012.922326:INFO:CONSOLE(9)] "Debug adapter process has terminated unexpectedly", source: file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js (9)

thisboyiscrazy avatar Nov 21 '17 17:11 thisboyiscrazy

https://github.com/felixfbecker/vscode-php-debug/issues/203

DeanNonatomic avatar Nov 21 '17 17:11 DeanNonatomic