Validate SSH alias configuration and provide clear error messages#6204
Open
Validate SSH alias configuration and provide clear error messages#6204
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
…ray values Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix misleading error message for misconfigured SSH alias settings
Validate SSH alias configuration and provide clear error messages
Jan 22, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This comment was marked as resolved.
This comment was marked as resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When SSH aliases are misconfigured with
sshandpathas separate keys (instead of embedding path in the SSH connection string), users receive cryptic foreach warnings and "Alias not found" errors.Changes
Runner::set_alias(): Detectssh+pathcombination and emit actionable error messageRunner::run_ssh_command(),Runner::set_alias(), andConfigurator::get_aliases()to prevent warnings on malformed alias dataError Message Improvement
Before:
After:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
366891.example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install-network --title=WP CLI Network --subdomains=1 is-installed bin/wp -v origin /home/REDACTED/wor@foo sh k/wp�� 29662' var_export( defiREDACTED bin/ssh li-test-core-dowcp /wp-content /usr/local/bin/m/tmp/wp-cli-test-core-install-cache-6.9/install_c4775ff9eceb34ebd92a3deef4bd8d0b--title=WP CLI Site bash(dns block)c0ff8e.example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install-network --title=WP CLI Network --subdomains=1 ss-than-php-8&&~REDACTED vendor/bin/sh -ssh-alias-errorsh features/class-w/home/REDACTED/work/wp-cli/wp-cli/bin/wp(dns block)example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email(dns block)/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email eature er.feature rk.f�� ature 2>/dev/null bin/wp --local user.email vendor/bin/which uniq(dns block)/usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email rgo/bin/bash sh /hom�� -sqlite-integration-cache/sqlite-database-integration ssspidy <841956+swissspidy@users.noreply.github.com>(dns block)host/usr/bin/ssh ssh -i identityfile.key -T -vvv user@host cd '/path/to/wordpress'; WP_CLI_RUNTIME_ALIAS='{"@foo":{"key":"identityfile.key"}}' wp @foo '--debug' '--version' ndor/bin/bash -v(dns block)/usr/bin/ssh ssh -i identityfile.key -T -vvv user@host cd '/path/to/wordpress'; WP_CLI_RUNTIME_ALIAS='{"@foo":{"key":"identityfile.key"}}' wp @foo '--debug' '--version' tnet/tools/mysql p mysql /home/REDACTED/.ca@foo sh bin/�� user create /home/REDACTED/.local/bin/sh submodules | heawp ABLE_WP_CRON', tcli ndor/bin/sh sh(dns block)proxyhost/usr/bin/ssh ssh -vvv -W [host]:22 proxyhost behat -- cal/bin/php(dns block)/usr/bin/ssh ssh -vvv -W [host]:22 proxyhost core basename tnet/tools/which/tmp/wp-cli-test-core-download-cache-6.9/wp-login.php 00ee2423.4889147sh which /usr/local/bin/g@foo sh /hom�� -handling ) { define( 'DISABLE_WP_CRON', true ); } rgo/bin/sh ain..copilot/fixsh sh sh /usr/bin/php(dns block)staging.example.com/usr/bin/ssh ssh -T -vvv deploy@staging.example.com cd '/var/www/staging'; wp '--debug' 'core' 'version' cli alias rgo/bin/sh /tmp/wp-cli-testrun-phpstan-tests /tmp/wp-cli-test-core-install-ca-c sh wp bin/�� --debug --version /bin/sh ation ost(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.