Skip to content

Linter crashes with Xdebug 3 on without listening client #47

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

Closed
jankonas opened this issue Feb 5, 2021 · 0 comments · Fixed by #48
Closed

Linter crashes with Xdebug 3 on without listening client #47

jankonas opened this issue Feb 5, 2021 · 0 comments · Fixed by #48

Comments

@jankonas
Copy link

jankonas commented Feb 5, 2021

When I have Xdebug 3 enabled (xdebug.mode=debug, xdebug.start_with_request=yes), but no listening client for it, PHP emits this message to stderr:

Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.254.254.254:9003 (through xdebug.client_host/xdebug.client_port) :-(

That causes linter to crash with following output:

$ vendor/bin/parallel-lint -e php src tests
Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.254.254.254:9003 (through xdebug.client_host/xdebug.client_port) :-(
PHP 7.3.26 | 10 parallel jobs
............................................................  60/124 (48 %)
.........................................................Error in skip-linting.php process
Error output: Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.254.254.254:9003 (through xdebug.client_host/xdebug.client_port) :-(

Investigating the issue I found this code snippet in ParallelLint.php:

if ($skipLintProcess->getErrorOutput()) {
    $message = "Error in skip-linting.php process\nError output: {$skipLintProcess->getErrorOutput()}";
    throw new \Exception($message);
}

Why is process error determined by stderr content instead of status code of the process? I am adding PR to change that, but maybe there is some reason for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant